diff --git a/sdk/api/openapi.yaml b/sdk/api/openapi.yaml index 062746b7a12..1fe8cced825 100644 --- a/sdk/api/openapi.yaml +++ b/sdk/api/openapi.yaml @@ -348,7 +348,7 @@ info: | 887|Cannot apply clear down module.| | termsOfService: https://www.finbourne.com/legal/terms-conditions title: LUSID API - version: 0.11.6336 + version: 0.11.6342 x-logo: url: https://www.lusid.com/app/assets/logo_white.png backgroundColor: '#415464' @@ -23638,6 +23638,111 @@ paths: x-fbn-apistatus: Experimental x-content-type: application/json-patch+json x-accepts: application/json + /api/instrumenteventtypes/transactiontemplates: + get: + description: Lists all Transaction Templates. + operationId: ListTransactionTemplates + parameters: + - description: The AsAt time at which to retrieve the Transaction Templates + explode: true + in: query + name: asAt + required: false + schema: + format: date-time + type: string + style: form + x-nullable: true + - description: "The pagination token to use to continue listing Transaction\ + \ Templates from a previous call to list Transaction Templates.\r\n This\ + \ value is returned from the previous call. If a pagination token is provided\ + \ the sortBy, filter, limit, and asAt fields\r\n must not have changed since\ + \ the original request." + explode: true + in: query + name: page + required: false + schema: + maxLength: 500 + minLength: 1 + pattern: "^[a-zA-Z0-9\\+/]*={0,3}$" + type: string + style: form + - description: "When paginating, limit the number of returned results to this\ + \ many." + explode: true + in: query + name: limit + required: false + schema: + format: int32 + maximum: 5000 + minimum: 1 + type: integer + style: form + x-nullable: true + - description: "Expression to filter the result set. Read more about filtering\ + \ results from LUSID here:\r\n https://support.lusid.com/filtering-results-from-lusid." + explode: true + in: query + name: filter + required: false + schema: + maxLength: 16384 + minLength: 0 + pattern: "^[\\s\\S]*$" + type: string + style: form + - description: "A list of field names to sort by, each suffixed by \" ASC\"\ + \ or \" DESC\"" + explode: true + in: query + name: sortBy + required: false + schema: + items: + type: string + type: array + style: form + x-nullable: true + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PagedResourceListOfTransactionTemplate' + application/json: + schema: + $ref: '#/components/schemas/PagedResourceListOfTransactionTemplate' + text/json: + schema: + $ref: '#/components/schemas/PagedResourceListOfTransactionTemplate' + description: The transaction templates. + "400": + content: + text/plain: + schema: + $ref: '#/components/schemas/LusidValidationProblemDetails' + application/json: + schema: + $ref: '#/components/schemas/LusidValidationProblemDetails' + text/json: + schema: + $ref: '#/components/schemas/LusidValidationProblemDetails' + description: The details of the input related failure + default: + content: + application/json: + schema: + $ref: '#/components/schemas/LusidProblemDetails' + description: Error response + security: + - oauth2: [] + summary: "[EXPERIMENTAL] ListTransactionTemplates: List Transaction Templates" + tags: + - Instrument Event Types + x-fbn-apistatus: Experimental + x-accepts: application/json /api/instrumenteventtypes/{instrumentEventType}/transactiontemplates/{instrumentType}/{scope}: delete: description: Delete a transaction template for a particular instrument event @@ -123785,6 +123890,229 @@ components: required: - values type: object + PagedResourceListOfTransactionTemplate: + additionalProperties: false + example: + previousPage: previousPage + nextPage: nextPage + values: + - instrumentType: instrumentType + instrumentEventType: instrumentEventType + componentTransactions: + - transactionFieldMap: + transactionCurrency: transactionCurrency + exchangeRate: exchangeRate + transactionPrice: + price: price + type: type + instrument: instrument + source: source + settlementDate: settlementDate + units: units + type: type + transactionDate: transactionDate + totalConsideration: + amount: amount + currency: currency + transactionId: transactionId + condition: condition + transactionPropertyMap: + - propertyKey: propertyKey + propertyValue: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + - propertyKey: propertyKey + propertyValue: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + displayName: displayName + - transactionFieldMap: + transactionCurrency: transactionCurrency + exchangeRate: exchangeRate + transactionPrice: + price: price + type: type + instrument: instrument + source: source + settlementDate: settlementDate + units: units + type: type + transactionDate: transactionDate + totalConsideration: + amount: amount + currency: currency + transactionId: transactionId + condition: condition + transactionPropertyMap: + - propertyKey: propertyKey + propertyValue: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + - propertyKey: propertyKey + propertyValue: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + displayName: displayName + scope: scope + description: description + links: + - method: method + description: description + href: https://openapi-generator.tech + relation: relation + - method: method + description: description + href: https://openapi-generator.tech + relation: relation + - instrumentType: instrumentType + instrumentEventType: instrumentEventType + componentTransactions: + - transactionFieldMap: + transactionCurrency: transactionCurrency + exchangeRate: exchangeRate + transactionPrice: + price: price + type: type + instrument: instrument + source: source + settlementDate: settlementDate + units: units + type: type + transactionDate: transactionDate + totalConsideration: + amount: amount + currency: currency + transactionId: transactionId + condition: condition + transactionPropertyMap: + - propertyKey: propertyKey + propertyValue: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + - propertyKey: propertyKey + propertyValue: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + displayName: displayName + - transactionFieldMap: + transactionCurrency: transactionCurrency + exchangeRate: exchangeRate + transactionPrice: + price: price + type: type + instrument: instrument + source: source + settlementDate: settlementDate + units: units + type: type + transactionDate: transactionDate + totalConsideration: + amount: amount + currency: currency + transactionId: transactionId + condition: condition + transactionPropertyMap: + - propertyKey: propertyKey + propertyValue: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + - propertyKey: propertyKey + propertyValue: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + displayName: displayName + scope: scope + description: description + links: + - method: method + description: description + href: https://openapi-generator.tech + relation: relation + - method: method + description: description + href: https://openapi-generator.tech + relation: relation + links: + - method: method + description: description + href: https://openapi-generator.tech + relation: relation + - method: method + description: description + href: https://openapi-generator.tech + relation: relation + href: https://openapi-generator.tech + properties: + nextPage: + nullable: true + type: string + previousPage: + nullable: true + type: string + values: + items: + $ref: '#/components/schemas/TransactionTemplate' + type: array + href: + format: uri + nullable: true + type: string + links: + items: + $ref: '#/components/schemas/Link' + nullable: true + type: array + required: + - values + type: object PagedResourceListOfTranslationScriptId: additionalProperties: false example: @@ -126214,10 +126542,19 @@ components: cost: amount: 0.8008281904610115 currency: currency + amortisedCostPortfolioCcy: + amount: 0.8008281904610115 + currency: currency instrumentScope: instrumentScope units: 0.8008281904610115 holdingTypeName: holdingTypeName holdingId: 1 + amortisedCost: + amount: 0.8008281904610115 + currency: currency + notionalCost: + amount: 0.8008281904610115 + currency: currency holdingType: holdingType instrumentUid: instrumentUid currency: currency @@ -126528,6 +126865,12 @@ components: format: int64 nullable: true type: integer + notionalCost: + $ref: '#/components/schemas/CurrencyAndAmount' + amortisedCost: + $ref: '#/components/schemas/CurrencyAndAmount' + amortisedCostPortfolioCcy: + $ref: '#/components/schemas/CurrencyAndAmount' required: - cost - costPortfolioCcy @@ -152720,10 +153063,19 @@ components: cost: amount: 0.8008281904610115 currency: currency + amortisedCostPortfolioCcy: + amount: 0.8008281904610115 + currency: currency instrumentScope: instrumentScope units: 0.8008281904610115 holdingTypeName: holdingTypeName holdingId: 1 + amortisedCost: + amount: 0.8008281904610115 + currency: currency + notionalCost: + amount: 0.8008281904610115 + currency: currency holdingType: holdingType instrumentUid: instrumentUid currency: currency @@ -152990,10 +153342,19 @@ components: cost: amount: 0.8008281904610115 currency: currency + amortisedCostPortfolioCcy: + amount: 0.8008281904610115 + currency: currency instrumentScope: instrumentScope units: 0.8008281904610115 holdingTypeName: holdingTypeName holdingId: 1 + amortisedCost: + amount: 0.8008281904610115 + currency: currency + notionalCost: + amount: 0.8008281904610115 + currency: currency holdingType: holdingType instrumentUid: instrumentUid currency: currency @@ -153958,10 +154319,19 @@ components: cost: amount: 0.8008281904610115 currency: currency + amortisedCostPortfolioCcy: + amount: 0.8008281904610115 + currency: currency instrumentScope: instrumentScope units: 0.8008281904610115 holdingTypeName: holdingTypeName holdingId: 1 + amortisedCost: + amount: 0.8008281904610115 + currency: currency + notionalCost: + amount: 0.8008281904610115 + currency: currency holdingType: holdingType instrumentUid: instrumentUid currency: currency @@ -154228,10 +154598,19 @@ components: cost: amount: 0.8008281904610115 currency: currency + amortisedCostPortfolioCcy: + amount: 0.8008281904610115 + currency: currency instrumentScope: instrumentScope units: 0.8008281904610115 holdingTypeName: holdingTypeName holdingId: 1 + amortisedCost: + amount: 0.8008281904610115 + currency: currency + notionalCost: + amount: 0.8008281904610115 + currency: currency holdingType: holdingType instrumentUid: instrumentUid currency: currency diff --git a/sdk/docs/InstrumentEventTypesApi.md b/sdk/docs/InstrumentEventTypesApi.md index 9a36bc92321..e520d66dfe1 100644 --- a/sdk/docs/InstrumentEventTypesApi.md +++ b/sdk/docs/InstrumentEventTypesApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://www.lusid.com/api* | [**deleteTransactionTemplate**](InstrumentEventTypesApi.md#deleteTransactionTemplate) | **DELETE** /api/instrumenteventtypes/{instrumentEventType}/transactiontemplates/{instrumentType}/{scope} | [EXPERIMENTAL] DeleteTransactionTemplate: Delete Transaction Template | | [**getTransactionTemplate**](InstrumentEventTypesApi.md#getTransactionTemplate) | **GET** /api/instrumenteventtypes/{instrumentEventType}/transactiontemplates/{instrumentType}/{scope} | [EXPERIMENTAL] GetTransactionTemplate: Get Transaction Template | | [**getTransactionTemplateSpecification**](InstrumentEventTypesApi.md#getTransactionTemplateSpecification) | **GET** /api/instrumenteventtypes/{instrumentEventType}/transactiontemplatespecification | [EXPERIMENTAL] GetTransactionTemplateSpecification: Get Transaction Template Specification. | +| [**listTransactionTemplates**](InstrumentEventTypesApi.md#listTransactionTemplates) | **GET** /api/instrumenteventtypes/transactiontemplates | [EXPERIMENTAL] ListTransactionTemplates: List Transaction Templates | | [**updateTransactionTemplate**](InstrumentEventTypesApi.md#updateTransactionTemplate) | **PUT** /api/instrumenteventtypes/{instrumentEventType}/transactiontemplates/{instrumentType}/{scope} | [EXPERIMENTAL] UpdateTransactionTemplate: Update Transaction Template | @@ -308,6 +309,89 @@ public class Example { | **400** | The details of the input related failure | - | | **0** | Error response | - | + +# **listTransactionTemplates** +> PagedResourceListOfTransactionTemplate listTransactionTemplates().asAt(asAt).page(page).limit(limit).filter(filter).sortBy(sortBy).execute(); + +[EXPERIMENTAL] ListTransactionTemplates: List Transaction Templates + +Lists all Transaction Templates. + +### Example +```java +// Import classes: +import com.finbourne.lusid.ApiClient; +import com.finbourne.lusid.ApiException; +import com.finbourne.lusid.Configuration; +import com.finbourne.lusid.auth.*; +import com.finbourne.lusid.models.*; +import com.finbourne.lusid.api.InstrumentEventTypesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://www.lusid.com/api"); + + // Configure OAuth2 access token for authorization: oauth2 + OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2"); + oauth2.setAccessToken("YOUR ACCESS TOKEN"); + + InstrumentEventTypesApi apiInstance = new InstrumentEventTypesApi(defaultClient); + OffsetDateTime asAt = OffsetDateTime.now(); // OffsetDateTime | The AsAt time at which to retrieve the Transaction Templates + String page = "page_example"; // String | The pagination token to use to continue listing Transaction Templates from a previous call to list Transaction Templates. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, limit, and asAt fields must not have changed since the original request. + Integer limit = 56; // Integer | When paginating, limit the number of returned results to this many. + String filter = "filter_example"; // String | Expression to filter the result set. Read more about filtering results from LUSID here: https://support.lusid.com/filtering-results-from-lusid. + List sortBy = Arrays.asList(); // List | A list of field names to sort by, each suffixed by \" ASC\" or \" DESC\" + try { + PagedResourceListOfTransactionTemplate result = apiInstance.listTransactionTemplates() + .asAt(asAt) + .page(page) + .limit(limit) + .filter(filter) + .sortBy(sortBy) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InstrumentEventTypesApi#listTransactionTemplates"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asAt** | **OffsetDateTime**| The AsAt time at which to retrieve the Transaction Templates | [optional] | +| **page** | **String**| The pagination token to use to continue listing Transaction Templates from a previous call to list Transaction Templates. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, limit, and asAt fields must not have changed since the original request. | [optional] | +| **limit** | **Integer**| When paginating, limit the number of returned results to this many. | [optional] | +| **filter** | **String**| Expression to filter the result set. Read more about filtering results from LUSID here: https://support.lusid.com/filtering-results-from-lusid. | [optional] | +| **sortBy** | [**List<String>**](String.md)| A list of field names to sort by, each suffixed by \" ASC\" or \" DESC\" | [optional] | + +### Return type + +[**PagedResourceListOfTransactionTemplate**](PagedResourceListOfTransactionTemplate.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain, application/json, text/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The transaction templates. | - | +| **400** | The details of the input related failure | - | +| **0** | Error response | - | + # **updateTransactionTemplate** > TransactionTemplate updateTransactionTemplate(instrumentEventType, instrumentType, scope, transactionTemplateRequest).execute(); diff --git a/sdk/docs/PagedResourceListOfTransactionTemplate.md b/sdk/docs/PagedResourceListOfTransactionTemplate.md new file mode 100644 index 00000000000..59e1b11263e --- /dev/null +++ b/sdk/docs/PagedResourceListOfTransactionTemplate.md @@ -0,0 +1,17 @@ + + +# PagedResourceListOfTransactionTemplate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nextPage** | **String** | | [optional] | +|**previousPage** | **String** | | [optional] | +|**values** | [**List<TransactionTemplate>**](TransactionTemplate.md) | | | +|**href** | **URI** | | [optional] | +|**links** | [**List<Link>**](Link.md) | | [optional] | + + + diff --git a/sdk/docs/PortfolioHolding.md b/sdk/docs/PortfolioHolding.md index 82cb25c2595..713ab3f26ea 100644 --- a/sdk/docs/PortfolioHolding.md +++ b/sdk/docs/PortfolioHolding.md @@ -21,6 +21,9 @@ A list of holdings. |**currency** | **String** | The holding currency. | [optional] | |**holdingTypeName** | **String** | The decoded type of the holding e.g. Position, Balance, CashCommitment, Receivable, ForwardFX etc. | [optional] | |**holdingId** | **Long** | A single identifier for the holding within the portfolio. The holdingId is constructed from the LusidInstrumentId, sub-holding keys and currrency and is unique within the portfolio. | [optional] | +|**notionalCost** | [**CurrencyAndAmount**](CurrencyAndAmount.md) | | [optional] | +|**amortisedCost** | [**CurrencyAndAmount**](CurrencyAndAmount.md) | | [optional] | +|**amortisedCostPortfolioCcy** | [**CurrencyAndAmount**](CurrencyAndAmount.md) | | [optional] | diff --git a/sdk/pom.xml b/sdk/pom.xml index 80f52a869a4..46e9b42fd8b 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -5,7 +5,7 @@ lusid-sdk jar lusid-sdk - 2.0.551 + 2.0.557 https://github.com/finbourne/lusid-sdk-java lusid diff --git a/sdk/src/main/java/com/finbourne/lusid/ApiClient.java b/sdk/src/main/java/com/finbourne/lusid/ApiClient.java index 0c9176f637f..8c9150e3432 100644 --- a/sdk/src/main/java/com/finbourne/lusid/ApiClient.java +++ b/sdk/src/main/java/com/finbourne/lusid/ApiClient.java @@ -208,7 +208,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2.0.551/java"); + setUserAgent("OpenAPI-Generator/2.0.557/java"); authentications = new HashMap(); } diff --git a/sdk/src/main/java/com/finbourne/lusid/Configuration.java b/sdk/src/main/java/com/finbourne/lusid/Configuration.java index 593194821bb..1b9a6aeca8f 100644 --- a/sdk/src/main/java/com/finbourne/lusid/Configuration.java +++ b/sdk/src/main/java/com/finbourne/lusid/Configuration.java @@ -12,7 +12,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "2.0.551"; + public static final String VERSION = "2.0.557"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/sdk/src/main/java/com/finbourne/lusid/JSON.java b/sdk/src/main/java/com/finbourne/lusid/JSON.java index 4ea1a2078a8..e49623bfc6a 100644 --- a/sdk/src/main/java/com/finbourne/lusid/JSON.java +++ b/sdk/src/main/java/com/finbourne/lusid/JSON.java @@ -2210,6 +2210,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfReferenceListResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfRelationshipDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfSequenceDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfTransactionTemplate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfTranslationScriptId.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfVirtualRow.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.Participation.CustomTypeAdapterFactory()); diff --git a/sdk/src/main/java/com/finbourne/lusid/api/InstrumentEventTypesApi.java b/sdk/src/main/java/com/finbourne/lusid/api/InstrumentEventTypesApi.java index 8f080c9e8d1..bd520d5366a 100644 --- a/sdk/src/main/java/com/finbourne/lusid/api/InstrumentEventTypesApi.java +++ b/sdk/src/main/java/com/finbourne/lusid/api/InstrumentEventTypesApi.java @@ -27,6 +27,7 @@ import com.finbourne.lusid.model.LusidProblemDetails; import com.finbourne.lusid.model.LusidValidationProblemDetails; import java.time.OffsetDateTime; +import com.finbourne.lusid.model.PagedResourceListOfTransactionTemplate; import com.finbourne.lusid.model.TransactionTemplate; import com.finbourne.lusid.model.TransactionTemplateRequest; import com.finbourne.lusid.model.TransactionTemplateSpecification; @@ -811,6 +812,236 @@ public okhttp3.Call executeAsync(final ApiCallback sortBy, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/instrumenteventtypes/transactiontemplates"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (asAt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asAt", asAt)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (filter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); + } + + if (sortBy != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "sortBy", sortBy)); + } + + final String[] localVarAccepts = { + "text/plain", + "application/json", + "text/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "oauth2" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listTransactionTemplatesValidateBeforeCall(OffsetDateTime asAt, String page, Integer limit, String filter, List sortBy, final ApiCallback _callback) throws ApiException { + return listTransactionTemplatesCall(asAt, page, limit, filter, sortBy, _callback); + + } + + + private ApiResponse listTransactionTemplatesWithHttpInfo(OffsetDateTime asAt, String page, Integer limit, String filter, List sortBy) throws ApiException { + okhttp3.Call localVarCall = listTransactionTemplatesValidateBeforeCall(asAt, page, limit, filter, sortBy, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listTransactionTemplatesAsync(OffsetDateTime asAt, String page, Integer limit, String filter, List sortBy, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listTransactionTemplatesValidateBeforeCall(asAt, page, limit, filter, sortBy, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistTransactionTemplatesRequest { + private OffsetDateTime asAt; + private String page; + private Integer limit; + private String filter; + private List sortBy; + + private APIlistTransactionTemplatesRequest() { + } + + /** + * Set asAt + * @param asAt The AsAt time at which to retrieve the Transaction Templates (optional) + * @return APIlistTransactionTemplatesRequest + */ + public APIlistTransactionTemplatesRequest asAt(OffsetDateTime asAt) { + this.asAt = asAt; + return this; + } + + /** + * Set page + * @param page The pagination token to use to continue listing Transaction Templates from a previous call to list Transaction Templates. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, limit, and asAt fields must not have changed since the original request. (optional) + * @return APIlistTransactionTemplatesRequest + */ + public APIlistTransactionTemplatesRequest page(String page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit When paginating, limit the number of returned results to this many. (optional) + * @return APIlistTransactionTemplatesRequest + */ + public APIlistTransactionTemplatesRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set filter + * @param filter Expression to filter the result set. Read more about filtering results from LUSID here: https://support.lusid.com/filtering-results-from-lusid. (optional) + * @return APIlistTransactionTemplatesRequest + */ + public APIlistTransactionTemplatesRequest filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Set sortBy + * @param sortBy A list of field names to sort by, each suffixed by \" ASC\" or \" DESC\" (optional) + * @return APIlistTransactionTemplatesRequest + */ + public APIlistTransactionTemplatesRequest sortBy(List sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Build call for listTransactionTemplates + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 The transaction templates. -
400 The details of the input related failure -
0 Error response -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listTransactionTemplatesCall(asAt, page, limit, filter, sortBy, _callback); + } + + /** + * Execute listTransactionTemplates request + * @return PagedResourceListOfTransactionTemplate + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 The transaction templates. -
400 The details of the input related failure -
0 Error response -
+ */ + public PagedResourceListOfTransactionTemplate execute() throws ApiException { + ApiResponse localVarResp = listTransactionTemplatesWithHttpInfo(asAt, page, limit, filter, sortBy); + return localVarResp.getData(); + } + + /** + * Execute listTransactionTemplates request with HTTP info returned + * @return ApiResponse<PagedResourceListOfTransactionTemplate> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 The transaction templates. -
400 The details of the input related failure -
0 Error response -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listTransactionTemplatesWithHttpInfo(asAt, page, limit, filter, sortBy); + } + + /** + * Execute listTransactionTemplates request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 The transaction templates. -
400 The details of the input related failure -
0 Error response -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listTransactionTemplatesAsync(asAt, page, limit, filter, sortBy, _callback); + } + } + + /** + * [EXPERIMENTAL] ListTransactionTemplates: List Transaction Templates + * Lists all Transaction Templates. + * @return APIlistTransactionTemplatesRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 The transaction templates. -
400 The details of the input related failure -
0 Error response -
+ */ + public APIlistTransactionTemplatesRequest listTransactionTemplates() { + return new APIlistTransactionTemplatesRequest(); + } private okhttp3.Call updateTransactionTemplateCall(String instrumentEventType, String instrumentType, String scope, TransactionTemplateRequest transactionTemplateRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers diff --git a/sdk/src/main/java/com/finbourne/lusid/model/PagedResourceListOfTransactionTemplate.java b/sdk/src/main/java/com/finbourne/lusid/model/PagedResourceListOfTransactionTemplate.java new file mode 100644 index 00000000000..47867c74422 --- /dev/null +++ b/sdk/src/main/java/com/finbourne/lusid/model/PagedResourceListOfTransactionTemplate.java @@ -0,0 +1,380 @@ +/* + * LUSID API + * + * Contact: info@finbourne.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.finbourne.lusid.model; + +import java.util.Objects; +import com.finbourne.lusid.model.Link; +import com.finbourne.lusid.model.TransactionTemplate; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.finbourne.lusid.JSON; + +/** + * PagedResourceListOfTransactionTemplate + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PagedResourceListOfTransactionTemplate { + public static final String SERIALIZED_NAME_NEXT_PAGE = "nextPage"; + @SerializedName(SERIALIZED_NAME_NEXT_PAGE) + private String nextPage; + + public static final String SERIALIZED_NAME_PREVIOUS_PAGE = "previousPage"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_PAGE) + private String previousPage; + + public static final String SERIALIZED_NAME_VALUES = "values"; + @SerializedName(SERIALIZED_NAME_VALUES) + private List values = new ArrayList<>(); + + public static final String SERIALIZED_NAME_HREF = "href"; + @SerializedName(SERIALIZED_NAME_HREF) + private URI href; + + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + private List links; + + public PagedResourceListOfTransactionTemplate() { + } + + public PagedResourceListOfTransactionTemplate nextPage(String nextPage) { + + this.nextPage = nextPage; + return this; + } + + /** + * Get nextPage + * @return nextPage + **/ + @jakarta.annotation.Nullable + public String getNextPage() { + return nextPage; + } + + + public void setNextPage(String nextPage) { + this.nextPage = nextPage; + } + + + public PagedResourceListOfTransactionTemplate previousPage(String previousPage) { + + this.previousPage = previousPage; + return this; + } + + /** + * Get previousPage + * @return previousPage + **/ + @jakarta.annotation.Nullable + public String getPreviousPage() { + return previousPage; + } + + + public void setPreviousPage(String previousPage) { + this.previousPage = previousPage; + } + + + public PagedResourceListOfTransactionTemplate values(List values) { + + this.values = values; + return this; + } + + public PagedResourceListOfTransactionTemplate addValuesItem(TransactionTemplate valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Get values + * @return values + **/ + @jakarta.annotation.Nonnull + public List getValues() { + return values; + } + + + public void setValues(List values) { + this.values = values; + } + + + public PagedResourceListOfTransactionTemplate href(URI href) { + + this.href = href; + return this; + } + + /** + * Get href + * @return href + **/ + @jakarta.annotation.Nullable + public URI getHref() { + return href; + } + + + public void setHref(URI href) { + this.href = href; + } + + + public PagedResourceListOfTransactionTemplate links(List links) { + + this.links = links; + return this; + } + + public PagedResourceListOfTransactionTemplate addLinksItem(Link linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Get links + * @return links + **/ + @jakarta.annotation.Nullable + public List getLinks() { + return links; + } + + + public void setLinks(List links) { + this.links = links; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PagedResourceListOfTransactionTemplate pagedResourceListOfTransactionTemplate = (PagedResourceListOfTransactionTemplate) o; + return Objects.equals(this.nextPage, pagedResourceListOfTransactionTemplate.nextPage) && + Objects.equals(this.previousPage, pagedResourceListOfTransactionTemplate.previousPage) && + Objects.equals(this.values, pagedResourceListOfTransactionTemplate.values) && + Objects.equals(this.href, pagedResourceListOfTransactionTemplate.href) && + Objects.equals(this.links, pagedResourceListOfTransactionTemplate.links); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(nextPage, previousPage, values, href, links); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PagedResourceListOfTransactionTemplate {\n"); + sb.append(" nextPage: ").append(toIndentedString(nextPage)).append("\n"); + sb.append(" previousPage: ").append(toIndentedString(previousPage)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append(" href: ").append(toIndentedString(href)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nextPage"); + openapiFields.add("previousPage"); + openapiFields.add("values"); + openapiFields.add("href"); + openapiFields.add("links"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("values"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PagedResourceListOfTransactionTemplate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PagedResourceListOfTransactionTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PagedResourceListOfTransactionTemplate is not found in the empty JSON string", PagedResourceListOfTransactionTemplate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PagedResourceListOfTransactionTemplate.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("nextPage") != null && !jsonObj.get("nextPage").isJsonNull()) && !jsonObj.get("nextPage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nextPage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nextPage").toString())); + } + if ((jsonObj.get("previousPage") != null && !jsonObj.get("previousPage").isJsonNull()) && !jsonObj.get("previousPage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `previousPage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previousPage").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("values").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); + } + + JsonArray jsonArrayvalues = jsonObj.getAsJsonArray("values"); + // validate the required field `values` (array) + for (int i = 0; i < jsonArrayvalues.size(); i++) { + TransactionTemplate.validateJsonElement(jsonArrayvalues.get(i)); + }; + if ((jsonObj.get("href") != null && !jsonObj.get("href").isJsonNull()) && !jsonObj.get("href").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); + } + if (jsonObj.get("links") != null && !jsonObj.get("links").isJsonNull()) { + JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links"); + if (jsonArraylinks != null) { + // ensure the json data is an array + if (!jsonObj.get("links").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString())); + } + + // validate the optional field `links` (array) + for (int i = 0; i < jsonArraylinks.size(); i++) { + Link.validateJsonElement(jsonArraylinks.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PagedResourceListOfTransactionTemplate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PagedResourceListOfTransactionTemplate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PagedResourceListOfTransactionTemplate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PagedResourceListOfTransactionTemplate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PagedResourceListOfTransactionTemplate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PagedResourceListOfTransactionTemplate given an JSON string + * + * @param jsonString JSON string + * @return An instance of PagedResourceListOfTransactionTemplate + * @throws IOException if the JSON string is invalid with respect to PagedResourceListOfTransactionTemplate + */ + public static PagedResourceListOfTransactionTemplate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PagedResourceListOfTransactionTemplate.class); + } + + /** + * Convert an instance of PagedResourceListOfTransactionTemplate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/sdk/src/main/java/com/finbourne/lusid/model/PortfolioHolding.java b/sdk/src/main/java/com/finbourne/lusid/model/PortfolioHolding.java index 452fef6a4c7..7c4089ffcc8 100644 --- a/sdk/src/main/java/com/finbourne/lusid/model/PortfolioHolding.java +++ b/sdk/src/main/java/com/finbourne/lusid/model/PortfolioHolding.java @@ -108,6 +108,18 @@ public class PortfolioHolding { @SerializedName(SERIALIZED_NAME_HOLDING_ID) private Long holdingId; + public static final String SERIALIZED_NAME_NOTIONAL_COST = "notionalCost"; + @SerializedName(SERIALIZED_NAME_NOTIONAL_COST) + private CurrencyAndAmount notionalCost; + + public static final String SERIALIZED_NAME_AMORTISED_COST = "amortisedCost"; + @SerializedName(SERIALIZED_NAME_AMORTISED_COST) + private CurrencyAndAmount amortisedCost; + + public static final String SERIALIZED_NAME_AMORTISED_COST_PORTFOLIO_CCY = "amortisedCostPortfolioCcy"; + @SerializedName(SERIALIZED_NAME_AMORTISED_COST_PORTFOLIO_CCY) + private CurrencyAndAmount amortisedCostPortfolioCcy; + public PortfolioHolding() { } @@ -400,6 +412,69 @@ public void setHoldingId(Long holdingId) { } + public PortfolioHolding notionalCost(CurrencyAndAmount notionalCost) { + + this.notionalCost = notionalCost; + return this; + } + + /** + * Get notionalCost + * @return notionalCost + **/ + @jakarta.annotation.Nullable + public CurrencyAndAmount getNotionalCost() { + return notionalCost; + } + + + public void setNotionalCost(CurrencyAndAmount notionalCost) { + this.notionalCost = notionalCost; + } + + + public PortfolioHolding amortisedCost(CurrencyAndAmount amortisedCost) { + + this.amortisedCost = amortisedCost; + return this; + } + + /** + * Get amortisedCost + * @return amortisedCost + **/ + @jakarta.annotation.Nullable + public CurrencyAndAmount getAmortisedCost() { + return amortisedCost; + } + + + public void setAmortisedCost(CurrencyAndAmount amortisedCost) { + this.amortisedCost = amortisedCost; + } + + + public PortfolioHolding amortisedCostPortfolioCcy(CurrencyAndAmount amortisedCostPortfolioCcy) { + + this.amortisedCostPortfolioCcy = amortisedCostPortfolioCcy; + return this; + } + + /** + * Get amortisedCostPortfolioCcy + * @return amortisedCostPortfolioCcy + **/ + @jakarta.annotation.Nullable + public CurrencyAndAmount getAmortisedCostPortfolioCcy() { + return amortisedCostPortfolioCcy; + } + + + public void setAmortisedCostPortfolioCcy(CurrencyAndAmount amortisedCostPortfolioCcy) { + this.amortisedCostPortfolioCcy = amortisedCostPortfolioCcy; + } + + @Override public boolean equals(Object o) { @@ -422,7 +497,10 @@ public boolean equals(Object o) { Objects.equals(this.transaction, portfolioHolding.transaction) && Objects.equals(this.currency, portfolioHolding.currency) && Objects.equals(this.holdingTypeName, portfolioHolding.holdingTypeName) && - Objects.equals(this.holdingId, portfolioHolding.holdingId); + Objects.equals(this.holdingId, portfolioHolding.holdingId) && + Objects.equals(this.notionalCost, portfolioHolding.notionalCost) && + Objects.equals(this.amortisedCost, portfolioHolding.amortisedCost) && + Objects.equals(this.amortisedCostPortfolioCcy, portfolioHolding.amortisedCostPortfolioCcy); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -431,7 +509,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(instrumentScope, instrumentUid, subHoldingKeys, properties, holdingType, units, settledUnits, cost, costPortfolioCcy, transaction, currency, holdingTypeName, holdingId); + return Objects.hash(instrumentScope, instrumentUid, subHoldingKeys, properties, holdingType, units, settledUnits, cost, costPortfolioCcy, transaction, currency, holdingTypeName, holdingId, notionalCost, amortisedCost, amortisedCostPortfolioCcy); } private static int hashCodeNullable(JsonNullable a) { @@ -458,6 +536,9 @@ public String toString() { sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" holdingTypeName: ").append(toIndentedString(holdingTypeName)).append("\n"); sb.append(" holdingId: ").append(toIndentedString(holdingId)).append("\n"); + sb.append(" notionalCost: ").append(toIndentedString(notionalCost)).append("\n"); + sb.append(" amortisedCost: ").append(toIndentedString(amortisedCost)).append("\n"); + sb.append(" amortisedCostPortfolioCcy: ").append(toIndentedString(amortisedCostPortfolioCcy)).append("\n"); sb.append("}"); return sb.toString(); } @@ -493,6 +574,9 @@ private String toIndentedString(Object o) { openapiFields.add("currency"); openapiFields.add("holdingTypeName"); openapiFields.add("holdingId"); + openapiFields.add("notionalCost"); + openapiFields.add("amortisedCost"); + openapiFields.add("amortisedCostPortfolioCcy"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -547,6 +631,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("holdingTypeName") != null && !jsonObj.get("holdingTypeName").isJsonNull()) && !jsonObj.get("holdingTypeName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `holdingTypeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holdingTypeName").toString())); } + // validate the optional field `notionalCost` + if (jsonObj.get("notionalCost") != null && !jsonObj.get("notionalCost").isJsonNull()) { + CurrencyAndAmount.validateJsonElement(jsonObj.get("notionalCost")); + } + // validate the optional field `amortisedCost` + if (jsonObj.get("amortisedCost") != null && !jsonObj.get("amortisedCost").isJsonNull()) { + CurrencyAndAmount.validateJsonElement(jsonObj.get("amortisedCost")); + } + // validate the optional field `amortisedCostPortfolioCcy` + if (jsonObj.get("amortisedCostPortfolioCcy") != null && !jsonObj.get("amortisedCostPortfolioCcy").isJsonNull()) { + CurrencyAndAmount.validateJsonElement(jsonObj.get("amortisedCostPortfolioCcy")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory {