diff --git a/README.md b/README.md index d543a0766e6..e155e0cf03a 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ This code is automatically generated by the [OpenAPI Generator](https://openapi- ## Versions -- API version: 0.11.7522 -- SDK version: 2.0.1386 +- API version: 0.11.7531 +- SDK version: 2.0.1387 ## Requirements @@ -47,7 +47,7 @@ Add this dependency to your pom.xml com.finbourne lusid-sdk - 2.0.1386 + 2.0.1387 ``` @@ -61,7 +61,7 @@ Add this dependency to your build.gradle } dependencies { - implementation "com.finbourne:lusid-sdk:2.0.1386" + implementation "com.finbourne:lusid-sdk:2.0.1387" } ``` diff --git a/sdk/README.md b/sdk/README.md index ef7f8ff1aa2..5e01afaeb3d 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -199,7 +199,7 @@ Class | Method | HTTP request | Description *DerivedTransactionPortfoliosApi* | [**deleteDerivedPortfolioDetails**](docs/DerivedTransactionPortfoliosApi.md#deletederivedportfoliodetails) | **DELETE** /api/derivedtransactionportfolios/{scope}/{code}/details | [EARLY ACCESS] DeleteDerivedPortfolioDetails: Delete derived portfolio details *EntitiesApi* | [**getCustomEntityByEntityUniqueId**](docs/EntitiesApi.md#getcustomentitybyentityuniqueid) | **GET** /api/entities/customentities/{entityUniqueId} | [EXPERIMENTAL] GetCustomEntityByEntityUniqueId: Get a Custom Entity instance by its EntityUniqueId *EntitiesApi* | [**getDataTypeByEntityUniqueId**](docs/EntitiesApi.md#getdatatypebyentityuniqueid) | **GET** /api/entities/datatypes/{entityUniqueId} | [EXPERIMENTAL] GetDataTypeByEntityUniqueId: Get DataType by EntityUniqueId -*EntitiesApi* | [**getEntityHistory**](docs/EntitiesApi.md#getentityhistory) | **GET** /api/entities/{entityType}/{entityUniqueId}/history | [EXPERIMENTAL] GetEntityHistory: List an entity's history information +*EntitiesApi* | [**getEntityHistory**](docs/EntitiesApi.md#getentityhistory) | **GET** /api/entities/{entityType}/{entityUniqueId}/history | [EARLY ACCESS] GetEntityHistory: List an entity's history information *EntitiesApi* | [**getInstrumentByEntityUniqueId**](docs/EntitiesApi.md#getinstrumentbyentityuniqueid) | **GET** /api/entities/instruments/{entityUniqueId} | [EXPERIMENTAL] GetInstrumentByEntityUniqueId: Get instrument by EntityUniqueId *EntitiesApi* | [**getPortfolioByEntityUniqueId**](docs/EntitiesApi.md#getportfoliobyentityuniqueid) | **GET** /api/entities/portfolios/{entityUniqueId} | [EXPERIMENTAL] GetPortfolioByEntityUniqueId: Get portfolio by EntityUniqueId *EntitiesApi* | [**getPortfolioChanges**](docs/EntitiesApi.md#getportfoliochanges) | **GET** /api/entities/changes/portfolios | GetPortfolioChanges: Get the next change to each portfolio in a scope. @@ -548,6 +548,7 @@ Class | Method | HTTP request | Description *TimelinesApi* | [**getClosedPeriod**](docs/TimelinesApi.md#getclosedperiod) | **GET** /api/timelines/{scope}/{code}/closedperiods/{closedPeriodId} | [EXPERIMENTAL] GetClosedPeriod: Gets a Closed Period entity. *TimelinesApi* | [**getTimeline**](docs/TimelinesApi.md#gettimeline) | **GET** /api/timelines/{scope}/{code} | [EXPERIMENTAL] GetTimeline: Get a single Timeline by scope and code. *TimelinesApi* | [**listClosedPeriods**](docs/TimelinesApi.md#listclosedperiods) | **GET** /api/timelines/{scope}/{code}/closedperiods | [EXPERIMENTAL] ListClosedPeriods: List ClosedPeriods for a specified Timeline. +*TimelinesApi* | [**listTimelines**](docs/TimelinesApi.md#listtimelines) | **GET** /api/timelines | [EXPERIMENTAL] ListTimelines: List Timelines *TimelinesApi* | [**updateTimeline**](docs/TimelinesApi.md#updatetimeline) | **PUT** /api/timelines/{scope}/{code} | [EXPERIMENTAL] UpdateTimeline: Update Timeline defined by scope and code *TransactionConfigurationApi* | [**deleteSideDefinition**](docs/TransactionConfigurationApi.md#deletesidedefinition) | **DELETE** /api/transactionconfiguration/sides/{side}/$delete | DeleteSideDefinition: Delete the given side definition *TransactionConfigurationApi* | [**deleteTransactionType**](docs/TransactionConfigurationApi.md#deletetransactiontype) | **DELETE** /api/transactionconfiguration/types/{source}/{type} | DeleteTransactionType: Delete a transaction type @@ -1343,6 +1344,7 @@ Class | Method | HTTP request | Description - [PagedResourceListOfStagedModification](docs/PagedResourceListOfStagedModification.md) - [PagedResourceListOfStagedModificationsRequestedChangeInterval](docs/PagedResourceListOfStagedModificationsRequestedChangeInterval.md) - [PagedResourceListOfStagingRuleSet](docs/PagedResourceListOfStagingRuleSet.md) + - [PagedResourceListOfTimeline](docs/PagedResourceListOfTimeline.md) - [PagedResourceListOfTransactionTemplate](docs/PagedResourceListOfTransactionTemplate.md) - [PagedResourceListOfTransactionTemplateSpecification](docs/PagedResourceListOfTransactionTemplateSpecification.md) - [PagedResourceListOfTranslationScriptId](docs/PagedResourceListOfTranslationScriptId.md) diff --git a/sdk/api/openapi.yaml b/sdk/api/openapi.yaml index 3be9c4f09b1..0045deed352 100644 --- a/sdk/api/openapi.yaml +++ b/sdk/api/openapi.yaml @@ -385,9 +385,11 @@ info: | 942|Action would create a circular dependency.| | | 944|Derived Property calculation not complete.| | | 945|Derived Property is not filterable.| | + | 946|The conditions provided have one or more errors.| | + | 947|The property/identifier domain and entity domain do not match.| | termsOfService: https://www.finbourne.com/legal/terms-conditions title: LUSID API - version: 0.11.7522 + version: 0.11.7531 x-logo: url: https://www.lusid.com/app/assets/logo_white.png backgroundColor: '#415464' @@ -1103,6 +1105,10 @@ info: title: Derived Property calculation not complete. "945": title: Derived Property is not filterable. + "946": + title: The conditions provided have one or more errors. + "947": + title: The property/identifier domain and entity domain do not match. x-fbn-description: "LUSID is an API-first, SaaS-native investment data management\ \ platform. It models entities such as instruments, portfolios, transactions and\ \ holdings to manage and value portfolios, and supports data integrations, flexible\ @@ -28257,10 +28263,10 @@ paths: description: Error response security: - oauth2: [] - summary: "[EXPERIMENTAL] GetEntityHistory: List an entity's history information" + summary: "[EARLY ACCESS] GetEntityHistory: List an entity's history information" tags: - Entities - x-fbn-apistatus: Experimental + x-fbn-apistatus: EarlyAccess x-accepts: application/json /api/executions: get: @@ -93379,6 +93385,222 @@ paths: x-content-type: application/json-patch+json x-accepts: application/json /api/timelines: + get: + description: List all the Timelines matching a particular criteria. + operationId: ListTimelines + parameters: + - description: The asAt datetime at which to list the Timelines. Defaults to + returning the latest version of each Timeline if not specified. + explode: true + in: query + name: asAt + required: false + schema: + format: date-time + type: string + style: form + x-nullable: true + - description: "The effective datetime or cut label at which to list the Timelines.\r\ + \n Note that Timelines are monotemporal, the effectiveAt is for Timevariant\ + \ Properties on the Timeline only.\r\n Defaults to the current LUSID system\ + \ datetime if not specified." + explode: true + in: query + name: effectiveAt + required: false + schema: + format: dateorcutlabel + maxLength: 256 + minLength: 0 + pattern: "^[a-zA-Z0-9\\-_\\+:\\.]+$" + type: string + style: form + - description: "The pagination token to use to continue listing Timelines; this\r\ + \n value is returned from the previous call. If a pagination token is provided,\ + \ the filter, effectiveAt\r\n and asAt fields 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 results to this number. Defaults\ + \ to 100 if not specified." + 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 results.\r\n For example, to filter\ + \ on the displayName, specify \"displayName eq 'AccountingTimeline'\". For\ + \ more information about filtering\r\n results, see https://support.lusid.com/knowledgebase/article/KA-01914." + 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 or properties 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 + - description: "A list of property keys from the 'Timeline' domain to decorate\ + \ onto each Timeline.\r\n These must take the format {domain}/{scope}/{code},\ + \ for example 'Timeline/Account/id'." + explode: true + in: query + name: propertyKeys + required: false + schema: + items: + description: "The key that uniquely identifies the property. It has the\ + \ format {domain}/{scope}/{code}." + type: string + type: array + style: form + x-nullable: true + responses: + "200": + content: + text/plain: + example: + values: + - id: + scope: MySourceScope + code: MySourceTimelineCode + displayName: AccountingTimeline + description: A Timeline for Accounting + properties: + Timeline/Accounting/MyCode: + key: Timeline/Accounting/MyCode + value: + labelValue: PropertyValue1 + effectiveFrom: 2024-01-01T00:00:00.0000000+00:00 + effectiveUntil: 2024-01-02T00:00:00.0000000+00:00 + version: + effectiveFrom: 2024-01-01T00:00:00.0000000+00:00 + asAtDate: 2024-01-01T00:00:00.0000000+00:00 + asAtCreated: 2024-01-01T00:00:00.0000000+00:00 + userIdCreated: userId + requestIdCreated: requestId + asAtModified: 2024-01-01T00:00:00.0000000+00:00 + userIdModified: userId + requestIdModified: userId + asAtVersionNumber: 1 + entityUniqueId: 00000000-0000-0000-0000-000000000000 + href: http://example.com + links: [] + schema: + $ref: '#/components/schemas/PagedResourceListOfTimeline' + application/json: + example: + values: + - id: + scope: MySourceScope + code: MySourceTimelineCode + displayName: AccountingTimeline + description: A Timeline for Accounting + properties: + Timeline/Accounting/MyCode: + key: Timeline/Accounting/MyCode + value: + labelValue: PropertyValue1 + effectiveFrom: 2024-01-01T00:00:00.0000000+00:00 + effectiveUntil: 2024-01-02T00:00:00.0000000+00:00 + version: + effectiveFrom: 2024-01-01T00:00:00.0000000+00:00 + asAtDate: 2024-01-01T00:00:00.0000000+00:00 + asAtCreated: 2024-01-01T00:00:00.0000000+00:00 + userIdCreated: userId + requestIdCreated: requestId + asAtModified: 2024-01-01T00:00:00.0000000+00:00 + userIdModified: userId + requestIdModified: userId + asAtVersionNumber: 1 + entityUniqueId: 00000000-0000-0000-0000-000000000000 + href: http://example.com + links: [] + schema: + $ref: '#/components/schemas/PagedResourceListOfTimeline' + text/json: + example: + values: + - id: + scope: MySourceScope + code: MySourceTimelineCode + displayName: AccountingTimeline + description: A Timeline for Accounting + properties: + Timeline/Accounting/MyCode: + key: Timeline/Accounting/MyCode + value: + labelValue: PropertyValue1 + effectiveFrom: 2024-01-01T00:00:00.0000000+00:00 + effectiveUntil: 2024-01-02T00:00:00.0000000+00:00 + version: + effectiveFrom: 2024-01-01T00:00:00.0000000+00:00 + asAtDate: 2024-01-01T00:00:00.0000000+00:00 + asAtCreated: 2024-01-01T00:00:00.0000000+00:00 + userIdCreated: userId + requestIdCreated: requestId + asAtModified: 2024-01-01T00:00:00.0000000+00:00 + userIdModified: userId + requestIdModified: userId + asAtVersionNumber: 1 + entityUniqueId: 00000000-0000-0000-0000-000000000000 + href: http://example.com + links: [] + schema: + $ref: '#/components/schemas/PagedResourceListOfTimeline' + description: The requested Timelines. + "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] ListTimelines: List Timelines" + tags: + - Timelines + x-fbn-apistatus: Experimental + x-accepts: application/json post: description: "Creates a Timeline. Returns the created Timeline at the current\ \ effectiveAt.\r\nNote that Timelines are mono-temporal, however they can\ @@ -173801,6 +174023,127 @@ components: required: - values type: object + PagedResourceListOfTimeline: + additionalProperties: false + example: + previousPage: previousPage + nextPage: nextPage + values: + - displayName: displayName + 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 + id: + code: code + scope: scope + href: https://openapi-generator.tech + version: + asAtModified: 2000-01-23T04:56:07.000+00:00 + userIdModified: userIdModified + asAtVersionNumber: 6 + stagedModificationIdModified: stagedModificationIdModified + asAtCreated: 2000-01-23T04:56:07.000+00:00 + requestIdCreated: requestIdCreated + entityUniqueId: entityUniqueId + userIdCreated: userIdCreated + requestIdModified: requestIdModified + effectiveFrom: 2000-01-23T04:56:07.000+00:00 + asAtDate: 2000-01-23T04:56:07.000+00:00 + properties: + key: + effectiveUntil: 2000-01-23T04:56:07.000+00:00 + value: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + effectiveFrom: 2000-01-23T04:56:07.000+00:00 + key: key + - displayName: displayName + 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 + id: + code: code + scope: scope + href: https://openapi-generator.tech + version: + asAtModified: 2000-01-23T04:56:07.000+00:00 + userIdModified: userIdModified + asAtVersionNumber: 6 + stagedModificationIdModified: stagedModificationIdModified + asAtCreated: 2000-01-23T04:56:07.000+00:00 + requestIdCreated: requestIdCreated + entityUniqueId: entityUniqueId + userIdCreated: userIdCreated + requestIdModified: requestIdModified + effectiveFrom: 2000-01-23T04:56:07.000+00:00 + asAtDate: 2000-01-23T04:56:07.000+00:00 + properties: + key: + effectiveUntil: 2000-01-23T04:56:07.000+00:00 + value: + metricValue: + unit: unit + value: 0.8008281904610115 + labelValue: labelValue + labelValueSet: + values: + - values + - values + effectiveFrom: 2000-01-23T04:56:07.000+00:00 + key: key + 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/Timeline' + type: array + href: + format: uri + nullable: true + type: string + links: + items: + $ref: '#/components/schemas/Link' + nullable: true + type: array + required: + - values + type: object PagedResourceListOfTransactionTemplate: additionalProperties: false example: diff --git a/sdk/docs/EntitiesApi.md b/sdk/docs/EntitiesApi.md index 3d6277a0952..47029462cc2 100644 --- a/sdk/docs/EntitiesApi.md +++ b/sdk/docs/EntitiesApi.md @@ -6,7 +6,7 @@ All URIs are relative to *https://www.lusid.com/api* |------------- | ------------- | -------------| | [**getCustomEntityByEntityUniqueId**](EntitiesApi.md#getCustomEntityByEntityUniqueId) | **GET** /api/entities/customentities/{entityUniqueId} | [EXPERIMENTAL] GetCustomEntityByEntityUniqueId: Get a Custom Entity instance by its EntityUniqueId | | [**getDataTypeByEntityUniqueId**](EntitiesApi.md#getDataTypeByEntityUniqueId) | **GET** /api/entities/datatypes/{entityUniqueId} | [EXPERIMENTAL] GetDataTypeByEntityUniqueId: Get DataType by EntityUniqueId | -| [**getEntityHistory**](EntitiesApi.md#getEntityHistory) | **GET** /api/entities/{entityType}/{entityUniqueId}/history | [EXPERIMENTAL] GetEntityHistory: List an entity's history information | +| [**getEntityHistory**](EntitiesApi.md#getEntityHistory) | **GET** /api/entities/{entityType}/{entityUniqueId}/history | [EARLY ACCESS] GetEntityHistory: List an entity's history information | | [**getInstrumentByEntityUniqueId**](EntitiesApi.md#getInstrumentByEntityUniqueId) | **GET** /api/entities/instruments/{entityUniqueId} | [EXPERIMENTAL] GetInstrumentByEntityUniqueId: Get instrument by EntityUniqueId | | [**getPortfolioByEntityUniqueId**](EntitiesApi.md#getPortfolioByEntityUniqueId) | **GET** /api/entities/portfolios/{entityUniqueId} | [EXPERIMENTAL] GetPortfolioByEntityUniqueId: Get portfolio by EntityUniqueId | | [**getPortfolioChanges**](EntitiesApi.md#getPortfolioChanges) | **GET** /api/entities/changes/portfolios | GetPortfolioChanges: Get the next change to each portfolio in a scope. | @@ -210,7 +210,7 @@ public class EntitiesApiExample { > ResourceListOfChangeInterval getEntityHistory(entityType, entityUniqueId, asAt, page, limit, filter, sortBy) -[EXPERIMENTAL] GetEntityHistory: List an entity's history information +[EARLY ACCESS] GetEntityHistory: List an entity's history information Retrieve a page of an entity's change history up to a particular point in AsAt time. diff --git a/sdk/docs/PagedResourceListOfTimeline.md b/sdk/docs/PagedResourceListOfTimeline.md new file mode 100644 index 00000000000..816da3a6ba7 --- /dev/null +++ b/sdk/docs/PagedResourceListOfTimeline.md @@ -0,0 +1,20 @@ + + +# PagedResourceListOfTimeline + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nextPage** | **String** | | [optional] | +|**previousPage** | **String** | | [optional] | +|**values** | [**List<Timeline>**](Timeline.md) | | | +|**href** | **URI** | | [optional] | +|**links** | [**List<Link>**](Link.md) | | [optional] | + + + +[Back to Model list](../README.md#documentation-for-models) • [Back to API list](../README.md#documentation-for-api-endpoints) • [Back to README](../README.md) + + diff --git a/sdk/docs/TimelinesApi.md b/sdk/docs/TimelinesApi.md index fd1f9f14a54..c469463774f 100644 --- a/sdk/docs/TimelinesApi.md +++ b/sdk/docs/TimelinesApi.md @@ -10,6 +10,7 @@ All URIs are relative to *https://www.lusid.com/api* | [**getClosedPeriod**](TimelinesApi.md#getClosedPeriod) | **GET** /api/timelines/{scope}/{code}/closedperiods/{closedPeriodId} | [EXPERIMENTAL] GetClosedPeriod: Gets a Closed Period entity. | | [**getTimeline**](TimelinesApi.md#getTimeline) | **GET** /api/timelines/{scope}/{code} | [EXPERIMENTAL] GetTimeline: Get a single Timeline by scope and code. | | [**listClosedPeriods**](TimelinesApi.md#listClosedPeriods) | **GET** /api/timelines/{scope}/{code}/closedperiods | [EXPERIMENTAL] ListClosedPeriods: List ClosedPeriods for a specified Timeline. | +| [**listTimelines**](TimelinesApi.md#listTimelines) | **GET** /api/timelines | [EXPERIMENTAL] ListTimelines: List Timelines | | [**updateTimeline**](TimelinesApi.md#updateTimeline) | **PUT** /api/timelines/{scope}/{code} | [EXPERIMENTAL] UpdateTimeline: Update Timeline defined by scope and code | @@ -596,6 +597,109 @@ public class TimelinesApiExample { [Back to top](#) • [Back to API list](../README.md#documentation-for-api-endpoints) • [Back to Model list](../README.md#documentation-for-models) • [Back to README](../README.md) +## listTimelines + +> PagedResourceListOfTimeline listTimelines(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys) + +[EXPERIMENTAL] ListTimelines: List Timelines + +List all the Timelines matching a particular criteria. + +### Example + +```java +import com.finbourne.lusid.model.*; +import com.finbourne.lusid.api.TimelinesApi; +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 TimelinesApiExample { + + 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\": \"\"," + + " \"lusidUrl\": \"https://.lusid.com/api\"," + + " \"username\": \"\"," + + " \"password\": \"\"," + + " \"clientId\": \"\"," + + " \"clientSecret\": \"\"" + + " }" + + "}"); + } + + // 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); + // TimelinesApi apiInstance = apiFactory.build(TimelinesApi.class); + + TimelinesApi apiInstance = ApiFactoryBuilder.build(fileName).build(TimelinesApi.class); + OffsetDateTime asAt = OffsetDateTime.now(); // OffsetDateTime | The asAt datetime at which to list the Timelines. Defaults to returning the latest version of each Timeline if not specified. + String effectiveAt = "effectiveAt_example"; // String | The effective datetime or cut label at which to list the Timelines. Note that Timelines are monotemporal, the effectiveAt is for Timevariant Properties on the Timeline only. Defaults to the current LUSID system datetime if not specified. + String page = "page_example"; // String | The pagination token to use to continue listing Timelines; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request. + Integer limit = 56; // Integer | When paginating, limit the results to this number. Defaults to 100 if not specified. + String filter = "filter_example"; // String | Expression to filter the results. For example, to filter on the displayName, specify \"displayName eq 'AccountingTimeline'\". For more information about filtering results, see https://support.lusid.com/knowledgebase/article/KA-01914. + List sortBy = Arrays.asList(); // List | A list of field names or properties to sort by, each suffixed by \" ASC\" or \" DESC\" + List propertyKeys = Arrays.asList(); // List | A list of property keys from the 'Timeline' domain to decorate onto each Timeline. These must take the format {domain}/{scope}/{code}, for example 'Timeline/Account/id'. + try { + // uncomment the below to set overrides at the request level + // PagedResourceListOfTimeline result = apiInstance.listTimelines(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys).execute(opts); + + PagedResourceListOfTimeline result = apiInstance.listTimelines(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys).execute(); + System.out.println(result.toJson()); + } catch (ApiException e) { + System.err.println("Exception when calling TimelinesApi#listTimelines"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **asAt** | **OffsetDateTime**| The asAt datetime at which to list the Timelines. Defaults to returning the latest version of each Timeline if not specified. | [optional] | +| **effectiveAt** | **String**| The effective datetime or cut label at which to list the Timelines. Note that Timelines are monotemporal, the effectiveAt is for Timevariant Properties on the Timeline only. Defaults to the current LUSID system datetime if not specified. | [optional] | +| **page** | **String**| The pagination token to use to continue listing Timelines; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request. | [optional] | +| **limit** | **Integer**| When paginating, limit the results to this number. Defaults to 100 if not specified. | [optional] | +| **filter** | **String**| Expression to filter the results. For example, to filter on the displayName, specify \"displayName eq 'AccountingTimeline'\". For more information about filtering results, see https://support.lusid.com/knowledgebase/article/KA-01914. | [optional] | +| **sortBy** | [**List<String>**](String.md)| A list of field names or properties to sort by, each suffixed by \" ASC\" or \" DESC\" | [optional] | +| **propertyKeys** | [**List<String>**](String.md)| A list of property keys from the 'Timeline' domain to decorate onto each Timeline. These must take the format {domain}/{scope}/{code}, for example 'Timeline/Account/id'. | [optional] | + +### Return type + +[**PagedResourceListOfTimeline**](PagedResourceListOfTimeline.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain, application/json, text/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The requested Timelines. | - | +| **400** | The details of the input related failure | - | +| **0** | Error response | - | + +[Back to top](#) • [Back to API list](../README.md#documentation-for-api-endpoints) • [Back to Model list](../README.md#documentation-for-models) • [Back to README](../README.md) + + ## updateTimeline > Timeline updateTimeline(scope, code, updateTimelineRequest) diff --git a/sdk/pom.xml b/sdk/pom.xml index 47dce2c6c42..a2d6206f9ca 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -5,7 +5,7 @@ lusid-sdk jar lusid-sdk - 2.0.1386 + 2.0.1387 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 03b5b8e921f..b6977d58985 100644 --- a/sdk/src/main/java/com/finbourne/lusid/ApiClient.java +++ b/sdk/src/main/java/com/finbourne/lusid/ApiClient.java @@ -212,7 +212,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2.0.1386/java"); + setUserAgent("OpenAPI-Generator/2.0.1387/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 7b1e48495b0..55648d3825f 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.1386"; + public static final String VERSION = "2.0.1387"; 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 8c21d89a6ce..c501aa5b81c 100644 --- a/sdk/src/main/java/com/finbourne/lusid/JSON.java +++ b/sdk/src/main/java/com/finbourne/lusid/JSON.java @@ -2931,6 +2931,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfStagedModification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfStagedModificationsRequestedChangeInterval.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfStagingRuleSet.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfTimeline.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfTransactionTemplate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfTransactionTemplateSpecification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.finbourne.lusid.model.PagedResourceListOfTranslationScriptId.CustomTypeAdapterFactory()); diff --git a/sdk/src/main/java/com/finbourne/lusid/api/EntitiesApi.java b/sdk/src/main/java/com/finbourne/lusid/api/EntitiesApi.java index ca1e3a74ff1..adb38c958e4 100644 --- a/sdk/src/main/java/com/finbourne/lusid/api/EntitiesApi.java +++ b/sdk/src/main/java/com/finbourne/lusid/api/EntitiesApi.java @@ -918,7 +918,7 @@ public okhttp3.Call executeAsync(final ApiCallback } /** - * [EXPERIMENTAL] GetEntityHistory: List an entity's history information + * [EARLY ACCESS] GetEntityHistory: List an entity's history information * Retrieve a page of an entity's change history up to a particular point in AsAt time. * @param entityType The type of the entity to list the change history for. (required) * @param entityUniqueId The universally unique identifier of the entity. (required) diff --git a/sdk/src/main/java/com/finbourne/lusid/api/TimelinesApi.java b/sdk/src/main/java/com/finbourne/lusid/api/TimelinesApi.java index cdc490002de..daebbe96afc 100644 --- a/sdk/src/main/java/com/finbourne/lusid/api/TimelinesApi.java +++ b/sdk/src/main/java/com/finbourne/lusid/api/TimelinesApi.java @@ -33,6 +33,7 @@ import com.finbourne.lusid.model.LusidValidationProblemDetails; import java.time.OffsetDateTime; import com.finbourne.lusid.model.PagedResourceListOfClosedPeriod; +import com.finbourne.lusid.model.PagedResourceListOfTimeline; import com.finbourne.lusid.model.Timeline; import com.finbourne.lusid.model.UpdateTimelineRequest; @@ -1711,6 +1712,334 @@ public okhttp3.Call executeAsync(final ApiCallback sortBy, List propertyKeys, final ApiCallback _callback) throws ApiException { + return listTimelinesCall(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, _callback, new ConfigurationOptions()); + } + + private okhttp3.Call listTimelinesCall(OffsetDateTime asAt, String effectiveAt, String page, Integer limit, String filter, List sortBy, List propertyKeys, final ApiCallback _callback, ConfigurationOptions opts) 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/timelines"; + + 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 (effectiveAt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("effectiveAt", effectiveAt)); + } + + 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)); + } + + if (propertyKeys != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "propertyKeys", propertyKeys)); + } + + 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, opts); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listTimelinesValidateBeforeCall(OffsetDateTime asAt, String effectiveAt, String page, Integer limit, String filter, List sortBy, List propertyKeys, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException { + return listTimelinesCall(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, _callback, opts); + + } + + + private ApiResponse listTimelinesWithHttpInfo(OffsetDateTime asAt, String effectiveAt, String page, Integer limit, String filter, List sortBy, List propertyKeys) throws ApiException { + okhttp3.Call localVarCall = listTimelinesValidateBeforeCall(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, null, new ConfigurationOptions()); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private ApiResponse listTimelinesWithHttpInfo(OffsetDateTime asAt, String effectiveAt, String page, Integer limit, String filter, List sortBy, List propertyKeys, ConfigurationOptions opts) throws ApiException { + okhttp3.Call localVarCall = listTimelinesValidateBeforeCall(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, null, opts); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + private okhttp3.Call listTimelinesAsync(OffsetDateTime asAt, String effectiveAt, String page, Integer limit, String filter, List sortBy, List propertyKeys, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listTimelinesValidateBeforeCall(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, _callback, new ConfigurationOptions()); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + private okhttp3.Call listTimelinesAsync(OffsetDateTime asAt, String effectiveAt, String page, Integer limit, String filter, List sortBy, List propertyKeys, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException { + + okhttp3.Call localVarCall = listTimelinesValidateBeforeCall(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, _callback, opts); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + public class APIlistTimelinesRequest { + private OffsetDateTime asAt; + private String effectiveAt; + private String page; + private Integer limit; + private String filter; + private List sortBy; + private List propertyKeys; + + private APIlistTimelinesRequest() { + } + + /** + * Set asAt + * @param asAt The asAt datetime at which to list the Timelines. Defaults to returning the latest version of each Timeline if not specified. (optional) + * @return APIlistTimelinesRequest + */ + public APIlistTimelinesRequest asAt(OffsetDateTime asAt) { + this.asAt = asAt; + return this; + } + + /** + * Set effectiveAt + * @param effectiveAt The effective datetime or cut label at which to list the Timelines. Note that Timelines are monotemporal, the effectiveAt is for Timevariant Properties on the Timeline only. Defaults to the current LUSID system datetime if not specified. (optional) + * @return APIlistTimelinesRequest + */ + public APIlistTimelinesRequest effectiveAt(String effectiveAt) { + this.effectiveAt = effectiveAt; + return this; + } + + /** + * Set page + * @param page The pagination token to use to continue listing Timelines; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request. (optional) + * @return APIlistTimelinesRequest + */ + public APIlistTimelinesRequest page(String page) { + this.page = page; + return this; + } + + /** + * Set limit + * @param limit When paginating, limit the results to this number. Defaults to 100 if not specified. (optional) + * @return APIlistTimelinesRequest + */ + public APIlistTimelinesRequest limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set filter + * @param filter Expression to filter the results. For example, to filter on the displayName, specify \"displayName eq 'AccountingTimeline'\". For more information about filtering results, see https://support.lusid.com/knowledgebase/article/KA-01914. (optional) + * @return APIlistTimelinesRequest + */ + public APIlistTimelinesRequest filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Set sortBy + * @param sortBy A list of field names or properties to sort by, each suffixed by \" ASC\" or \" DESC\" (optional) + * @return APIlistTimelinesRequest + */ + public APIlistTimelinesRequest sortBy(List sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Set propertyKeys + * @param propertyKeys A list of property keys from the 'Timeline' domain to decorate onto each Timeline. These must take the format {domain}/{scope}/{code}, for example 'Timeline/Account/id'. (optional) + * @return APIlistTimelinesRequest + */ + public APIlistTimelinesRequest propertyKeys(List propertyKeys) { + this.propertyKeys = propertyKeys; + return this; + } + + /** + * Build call for listTimelines + * @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 requested Timelines. -
400 The details of the input related failure -
0 Error response -
+ */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return listTimelinesCall(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, _callback); + } + + /** + * Execute listTimelines request + * @return PagedResourceListOfTimeline + * @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 requested Timelines. -
400 The details of the input related failure -
0 Error response -
+ */ + public PagedResourceListOfTimeline execute() throws ApiException { + ApiResponse localVarResp = listTimelinesWithHttpInfo(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys); + return localVarResp.getData(); + } + + /** + * Execute listTimelines request. Use any specified configuration options to override any other configuration for this request only. + * @return PagedResourceListOfTimeline + * @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 requested Timelines. -
400 The details of the input related failure -
0 Error response -
+ */ + public PagedResourceListOfTimeline execute(ConfigurationOptions opts) throws ApiException { + ApiResponse localVarResp = listTimelinesWithHttpInfo(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, opts); + return localVarResp.getData(); + } + + /** + * Execute listTimelines request with HTTP info returned + * @return ApiResponse<PagedResourceListOfTimeline> + * @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 requested Timelines. -
400 The details of the input related failure -
0 Error response -
+ */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listTimelinesWithHttpInfo(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys); + } + + /** + * Execute listTimelines request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only. + * @return ApiResponse<PagedResourceListOfTimeline> + * @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 requested Timelines. -
400 The details of the input related failure -
0 Error response -
+ */ + public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException { + return listTimelinesWithHttpInfo(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, opts); + } + + /** + * Execute listTimelines 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 requested Timelines. -
400 The details of the input related failure -
0 Error response -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return listTimelinesAsync(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, _callback); + } + + /** + * Execute listTimelines request (asynchronously). Use any specified configuration options to override any other configuration for this request only. + * @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 requested Timelines. -
400 The details of the input related failure -
0 Error response -
+ */ + public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException { + return listTimelinesAsync(asAt, effectiveAt, page, limit, filter, sortBy, propertyKeys, _callback, opts); + } + } + + /** + * [EXPERIMENTAL] ListTimelines: List Timelines + * List all the Timelines matching a particular criteria. + * @return APIlistTimelinesRequest + * @http.response.details + + + + + +
Status Code Description Response Headers
200 The requested Timelines. -
400 The details of the input related failure -
0 Error response -
+ */ + public APIlistTimelinesRequest listTimelines() { + return new APIlistTimelinesRequest(); + } private okhttp3.Call updateTimelineCall(String scope, String code, UpdateTimelineRequest updateTimelineRequest, final ApiCallback _callback) throws ApiException { return updateTimelineCall(scope, code, updateTimelineRequest, _callback, new ConfigurationOptions()); } diff --git a/sdk/src/main/java/com/finbourne/lusid/model/PagedResourceListOfTimeline.java b/sdk/src/main/java/com/finbourne/lusid/model/PagedResourceListOfTimeline.java new file mode 100644 index 00000000000..6567e1a5fbb --- /dev/null +++ b/sdk/src/main/java/com/finbourne/lusid/model/PagedResourceListOfTimeline.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.Timeline; +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; + +/** + * PagedResourceListOfTimeline + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PagedResourceListOfTimeline { + 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 PagedResourceListOfTimeline() { + } + + public PagedResourceListOfTimeline 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 PagedResourceListOfTimeline 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 PagedResourceListOfTimeline values(List values) { + + this.values = values; + return this; + } + + public PagedResourceListOfTimeline addValuesItem(Timeline 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 PagedResourceListOfTimeline 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 PagedResourceListOfTimeline links(List links) { + + this.links = links; + return this; + } + + public PagedResourceListOfTimeline 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; + } + PagedResourceListOfTimeline pagedResourceListOfTimeline = (PagedResourceListOfTimeline) o; + return Objects.equals(this.nextPage, pagedResourceListOfTimeline.nextPage) && + Objects.equals(this.previousPage, pagedResourceListOfTimeline.previousPage) && + Objects.equals(this.values, pagedResourceListOfTimeline.values) && + Objects.equals(this.href, pagedResourceListOfTimeline.href) && + Objects.equals(this.links, pagedResourceListOfTimeline.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 PagedResourceListOfTimeline {\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 PagedResourceListOfTimeline + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PagedResourceListOfTimeline.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PagedResourceListOfTimeline is not found in the empty JSON string", PagedResourceListOfTimeline.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PagedResourceListOfTimeline.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++) { + Timeline.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 (!PagedResourceListOfTimeline.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PagedResourceListOfTimeline' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PagedResourceListOfTimeline.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PagedResourceListOfTimeline value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PagedResourceListOfTimeline read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PagedResourceListOfTimeline given an JSON string + * + * @param jsonString JSON string + * @return An instance of PagedResourceListOfTimeline + * @throws IOException if the JSON string is invalid with respect to PagedResourceListOfTimeline + */ + public static PagedResourceListOfTimeline fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PagedResourceListOfTimeline.class); + } + + /** + * Convert an instance of PagedResourceListOfTimeline to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +}