All URIs are relative to https://www.lusid.com/api
Method | HTTP request | Description |
---|---|---|
deleteBlock | DELETE /api/blocks/{scope}/{code} | [EARLY ACCESS] DeleteBlock: Delete block |
getBlock | GET /api/blocks/{scope}/{code} | [EARLY ACCESS] GetBlock: Get Block |
listBlocks | GET /api/blocks | [EARLY ACCESS] ListBlocks: List Blocks |
upsertBlocks | POST /api/blocks | [EARLY ACCESS] UpsertBlocks: Upsert Block |
DeletedEntityResponse deleteBlock(scope, code)
[EARLY ACCESS] DeleteBlock: Delete block
Delete an block. Deletion will be valid from the block's creation datetime. This means that the block will no longer exist at any effective datetime from the asAt datetime of deletion.
import com.finbourne.lusid.model.*;
import com.finbourne.lusid.api.BlocksApi;
import com.finbourne.lusid.extensions.ApiConfigurationException;
import com.finbourne.lusid.extensions.ApiFactoryBuilder;
import com.finbourne.lusid.extensions.auth.FinbourneTokenException;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
public class BlocksApiExample {
public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException, ApiConfigurationException, FinbourneTokenException {
String fileName = "secrets.json";
try(PrintWriter writer = new PrintWriter(fileName, "UTF-8")) {
writer.write("{" +
"\"api\": {" +
" \"tokenUrl\": \"<your-token-url>\"," +
" \"lusidUrl\": \"https://<your-domain>.lusid.com/api\"," +
" \"username\": \"<your-username>\"," +
" \"password\": \"<your-password>\"," +
" \"clientId\": \"<your-client-id>\"," +
" \"clientSecret\": \"<your-client-secret>\"" +
" }" +
"}");
}
// uncomment the below to use configuration overrides
// ConfigurationOptions opts = new ConfigurationOptions();
// opts.setTotalTimeoutMs(2000);
// uncomment the below to use an api factory with overrides
// ApiFactory apiFactory = ApiFactoryBuilder.build(fileName, opts);
// BlocksApi apiInstance = apiFactory.build(BlocksApi.class);
BlocksApi apiInstance = ApiFactoryBuilder.build(fileName).build(BlocksApi.class);
String scope = "scope_example"; // String | The block scope.
String code = "code_example"; // String | The block's code. This, together with the scope uniquely identifies the block to delete.
try {
// uncomment the below to set overrides at the request level
// DeletedEntityResponse result = apiInstance.deleteBlock(scope, code).execute(opts);
DeletedEntityResponse result = apiInstance.deleteBlock(scope, code).execute();
System.out.println(result.toJson());
} catch (ApiException e) {
System.err.println("Exception when calling BlocksApi#deleteBlock");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
scope | String | The block scope. | |
code | String | The block's code. This, together with the scope uniquely identifies the block to delete. |
- Content-Type: Not defined
- Accept: text/plain, application/json, text/json
Status code | Description | Response headers |
---|---|---|
200 | The response from deleting an block. | - |
400 | The details of the input related failure | - |
0 | Error response | - |
Back to top • Back to API list • Back to Model list • Back to README
Block getBlock(scope, code, asAt, propertyKeys)
[EARLY ACCESS] GetBlock: Get Block
Fetch a Block that matches the specified identifier
import com.finbourne.lusid.model.*;
import com.finbourne.lusid.api.BlocksApi;
import com.finbourne.lusid.extensions.ApiConfigurationException;
import com.finbourne.lusid.extensions.ApiFactoryBuilder;
import com.finbourne.lusid.extensions.auth.FinbourneTokenException;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
public class BlocksApiExample {
public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException, ApiConfigurationException, FinbourneTokenException {
String fileName = "secrets.json";
try(PrintWriter writer = new PrintWriter(fileName, "UTF-8")) {
writer.write("{" +
"\"api\": {" +
" \"tokenUrl\": \"<your-token-url>\"," +
" \"lusidUrl\": \"https://<your-domain>.lusid.com/api\"," +
" \"username\": \"<your-username>\"," +
" \"password\": \"<your-password>\"," +
" \"clientId\": \"<your-client-id>\"," +
" \"clientSecret\": \"<your-client-secret>\"" +
" }" +
"}");
}
// uncomment the below to use configuration overrides
// ConfigurationOptions opts = new ConfigurationOptions();
// opts.setTotalTimeoutMs(2000);
// uncomment the below to use an api factory with overrides
// ApiFactory apiFactory = ApiFactoryBuilder.build(fileName, opts);
// BlocksApi apiInstance = apiFactory.build(BlocksApi.class);
BlocksApi apiInstance = ApiFactoryBuilder.build(fileName).build(BlocksApi.class);
String scope = "scope_example"; // String | The scope to which the block belongs.
String code = "code_example"; // String | The block's unique identifier.
OffsetDateTime asAt = OffsetDateTime.now(); // OffsetDateTime | The asAt datetime at which to retrieve the block. Defaults to return the latest version of the block if not specified.
List<String> propertyKeys = Arrays.asList(); // List<String> | A list of property keys from the \"Block\" domain to decorate onto the block. These take the format {domain}/{scope}/{code} e.g. \"Block/system/Name\".
try {
// uncomment the below to set overrides at the request level
// Block result = apiInstance.getBlock(scope, code, asAt, propertyKeys).execute(opts);
Block result = apiInstance.getBlock(scope, code, asAt, propertyKeys).execute();
System.out.println(result.toJson());
} catch (ApiException e) {
System.err.println("Exception when calling BlocksApi#getBlock");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
scope | String | The scope to which the block belongs. | |
code | String | The block's unique identifier. | |
asAt | OffsetDateTime | The asAt datetime at which to retrieve the block. Defaults to return the latest version of the block if not specified. | [optional] |
propertyKeys | List<String> | A list of property keys from the "Block" domain to decorate onto the block. These take the format {domain}/{scope}/{code} e.g. "Block/system/Name". | [optional] |
- Content-Type: Not defined
- Accept: text/plain, application/json, text/json
Status code | Description | Response headers |
---|---|---|
200 | The block matching the given identifier. | - |
400 | The details of the input related failure | - |
0 | Error response | - |
Back to top • Back to API list • Back to Model list • Back to README
PagedResourceListOfBlock listBlocks(asAt, page, sortBy, limit, filter, propertyKeys)
[EARLY ACCESS] ListBlocks: List Blocks
Fetch the last pre-AsAt date version of each block in scope (does not fetch the entire history).
import com.finbourne.lusid.model.*;
import com.finbourne.lusid.api.BlocksApi;
import com.finbourne.lusid.extensions.ApiConfigurationException;
import com.finbourne.lusid.extensions.ApiFactoryBuilder;
import com.finbourne.lusid.extensions.auth.FinbourneTokenException;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
public class BlocksApiExample {
public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException, ApiConfigurationException, FinbourneTokenException {
String fileName = "secrets.json";
try(PrintWriter writer = new PrintWriter(fileName, "UTF-8")) {
writer.write("{" +
"\"api\": {" +
" \"tokenUrl\": \"<your-token-url>\"," +
" \"lusidUrl\": \"https://<your-domain>.lusid.com/api\"," +
" \"username\": \"<your-username>\"," +
" \"password\": \"<your-password>\"," +
" \"clientId\": \"<your-client-id>\"," +
" \"clientSecret\": \"<your-client-secret>\"" +
" }" +
"}");
}
// uncomment the below to use configuration overrides
// ConfigurationOptions opts = new ConfigurationOptions();
// opts.setTotalTimeoutMs(2000);
// uncomment the below to use an api factory with overrides
// ApiFactory apiFactory = ApiFactoryBuilder.build(fileName, opts);
// BlocksApi apiInstance = apiFactory.build(BlocksApi.class);
BlocksApi apiInstance = ApiFactoryBuilder.build(fileName).build(BlocksApi.class);
OffsetDateTime asAt = OffsetDateTime.now(); // OffsetDateTime | The asAt datetime at which to retrieve the block. Defaults to return the latest version of the block if not specified.
String page = "page_example"; // String | The pagination token to use to continue listing blocks from a previous call to list blocks. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, effectiveAt, and asAt fields must not have changed since the original request.
List<String> sortBy = Arrays.asList(); // List<String> | A list of field names or properties to sort by, each suffixed by \" ASC\" or \" DESC\".
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<String> propertyKeys = Arrays.asList(); // List<String> | A list of property keys from the \"Block\" domain to decorate onto each block. These take the format {domain}/{scope}/{code} e.g. \"Block/system/Name\". All properties, except derived properties, are returned by default, without specifying here.
try {
// uncomment the below to set overrides at the request level
// PagedResourceListOfBlock result = apiInstance.listBlocks(asAt, page, sortBy, limit, filter, propertyKeys).execute(opts);
PagedResourceListOfBlock result = apiInstance.listBlocks(asAt, page, sortBy, limit, filter, propertyKeys).execute();
System.out.println(result.toJson());
} catch (ApiException e) {
System.err.println("Exception when calling BlocksApi#listBlocks");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
asAt | OffsetDateTime | The asAt datetime at which to retrieve the block. Defaults to return the latest version of the block if not specified. | [optional] |
page | String | The pagination token to use to continue listing blocks from a previous call to list blocks. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, effectiveAt, and asAt fields must not have changed since the original request. | [optional] |
sortBy | List<String> | A list of field names or properties to sort by, each suffixed by " ASC" or " DESC". | [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] |
propertyKeys | List<String> | A list of property keys from the "Block" domain to decorate onto each block. These take the format {domain}/{scope}/{code} e.g. "Block/system/Name". All properties, except derived properties, are returned by default, without specifying here. | [optional] |
- Content-Type: Not defined
- Accept: text/plain, application/json, text/json
Status code | Description | Response headers |
---|---|---|
200 | Blocks in scope. | - |
400 | The details of the input related failure | - |
0 | Error response | - |
Back to top • Back to API list • Back to Model list • Back to README
ResourceListOfBlock upsertBlocks(blockSetRequest)
[EARLY ACCESS] UpsertBlocks: Upsert Block
Upsert; update existing blocks with given ids, or create new blocks otherwise.
import com.finbourne.lusid.model.*;
import com.finbourne.lusid.api.BlocksApi;
import com.finbourne.lusid.extensions.ApiConfigurationException;
import com.finbourne.lusid.extensions.ApiFactoryBuilder;
import com.finbourne.lusid.extensions.auth.FinbourneTokenException;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
public class BlocksApiExample {
public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException, ApiConfigurationException, FinbourneTokenException {
String fileName = "secrets.json";
try(PrintWriter writer = new PrintWriter(fileName, "UTF-8")) {
writer.write("{" +
"\"api\": {" +
" \"tokenUrl\": \"<your-token-url>\"," +
" \"lusidUrl\": \"https://<your-domain>.lusid.com/api\"," +
" \"username\": \"<your-username>\"," +
" \"password\": \"<your-password>\"," +
" \"clientId\": \"<your-client-id>\"," +
" \"clientSecret\": \"<your-client-secret>\"" +
" }" +
"}");
}
// uncomment the below to use configuration overrides
// ConfigurationOptions opts = new ConfigurationOptions();
// opts.setTotalTimeoutMs(2000);
// uncomment the below to use an api factory with overrides
// ApiFactory apiFactory = ApiFactoryBuilder.build(fileName, opts);
// BlocksApi apiInstance = apiFactory.build(BlocksApi.class);
BlocksApi apiInstance = ApiFactoryBuilder.build(fileName).build(BlocksApi.class);
BlockSetRequest blockSetRequest = new BlockSetRequest(); // BlockSetRequest | The collection of block requests.
try {
// uncomment the below to set overrides at the request level
// ResourceListOfBlock result = apiInstance.upsertBlocks(blockSetRequest).execute(opts);
ResourceListOfBlock result = apiInstance.upsertBlocks(blockSetRequest).execute();
System.out.println(result.toJson());
} catch (ApiException e) {
System.err.println("Exception when calling BlocksApi#upsertBlocks");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
blockSetRequest | BlockSetRequest | The collection of block requests. | [optional] |
- Content-Type: application/json-patch+json, application/json, text/json, application/*+json
- Accept: text/plain, application/json, text/json
Status code | Description | Response headers |
---|---|---|
201 | A collection of blocks. | - |
400 | The details of the input related failure | - |
0 | Error response | - |
Back to top • Back to API list • Back to Model list • Back to README