diff --git a/ce/docs/AlarmCondition.md b/ce/docs/AlarmCondition.md deleted file mode 100644 index f6d1bb3f..00000000 --- a/ce/docs/AlarmCondition.md +++ /dev/null @@ -1,23 +0,0 @@ - -# AlarmCondition - -`org.thingsboard.client.model.AlarmCondition` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **condition** | **List\** | | [optional] | -| **spec** | **AlarmConditionSpec** | JSON object representing alarm condition type | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AlarmConditionFilter.md b/ce/docs/AlarmConditionFilter.md deleted file mode 100644 index 246dacbd..00000000 --- a/ce/docs/AlarmConditionFilter.md +++ /dev/null @@ -1,25 +0,0 @@ - -# AlarmConditionFilter - -`org.thingsboard.client.model.AlarmConditionFilter` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **valueType** | **EntityKeyValueType** | String representation of the type of the value | [optional] | -| **key** | **AlarmConditionFilterKey** | JSON object for specifying alarm condition by specific key | [optional] | -| **predicate** | **KeyFilterPredicate** | JSON object representing filter condition | [optional] | -| **value** | **Object** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AlarmConditionFilterKey.md b/ce/docs/AlarmConditionFilterKey.md deleted file mode 100644 index ca41ee3b..00000000 --- a/ce/docs/AlarmConditionFilterKey.md +++ /dev/null @@ -1,23 +0,0 @@ - -# AlarmConditionFilterKey - -`org.thingsboard.client.model.AlarmConditionFilterKey` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **type** | **AlarmConditionKeyType** | The key type | [optional] | -| **key** | **String** | String value representing the key | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AlarmConditionKeyType.md b/ce/docs/AlarmConditionKeyType.md deleted file mode 100644 index 8421ce6c..00000000 --- a/ce/docs/AlarmConditionKeyType.md +++ /dev/null @@ -1,27 +0,0 @@ - -# AlarmConditionKeyType - -`org.thingsboard.client.model.AlarmConditionKeyType` - -## Enum Values - - -* `ATTRIBUTE` (value: `"ATTRIBUTE"`) - -* `TIME_SERIES` (value: `"TIME_SERIES"`) - -* `ENTITY_FIELD` (value: `"ENTITY_FIELD"`) - -* `CONSTANT` (value: `"CONSTANT"`) - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AlarmConditionSpec.md b/ce/docs/AlarmConditionSpec.md deleted file mode 100644 index 8dc468ad..00000000 --- a/ce/docs/AlarmConditionSpec.md +++ /dev/null @@ -1,24 +0,0 @@ - -# AlarmConditionSpec - -`org.thingsboard.client.model.AlarmConditionSpec` - -Specification for alarm conditions - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **type** | **String** | | | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AlarmRule.md b/ce/docs/AlarmRule.md deleted file mode 100644 index 6af568a9..00000000 --- a/ce/docs/AlarmRule.md +++ /dev/null @@ -1,25 +0,0 @@ - -# AlarmRule - -`org.thingsboard.client.model.AlarmRule` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **condition** | **AlarmCondition** | JSON object representing the alarm rule condition | [optional] | -| **alarmDetails** | **String** | String value representing the additional details for an alarm rule | [optional] | -| **dashboardId** | **DashboardId** | JSON object with the dashboard Id representing the reference to alarm details dashboard used by mobile application | [optional] | -| **schedule** | **AlarmSchedule** | JSON object representing time interval during which the rule is active | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AlarmRuleControllerApi.md b/ce/docs/AlarmRuleControllerApi.md new file mode 100644 index 00000000..4faf0d51 --- /dev/null +++ b/ce/docs/AlarmRuleControllerApi.md @@ -0,0 +1,222 @@ +# AlarmRuleControllerApi + +`ThingsboardClient` methods: + +``` +void deleteAlarmRule(@Nonnull String alarmRuleId) // Delete Alarm Rule (deleteAlarmRule) +AlarmRuleDefinition getAlarmRuleById(@Nonnull String alarmRuleId) // Get Alarm Rule (getAlarmRuleById) +PageDataString getAlarmRuleNames(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder) // Get alarm rule names (getAlarmRuleNames) +PageDataAlarmRuleDefinitionInfo getAlarmRules(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable EntityType entityType, @Nullable Set entities, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) // Get alarm rules (getAlarmRules) +PageDataAlarmRuleDefinition getAlarmRulesByEntityId(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) // Get Alarm Rules by Entity Id (getAlarmRulesByEntityId) +com.fasterxml.jackson.databind.JsonNode getLatestAlarmRuleDebugEvent(@Nonnull String alarmRuleId) // Get latest alarm rule debug event (getLatestAlarmRuleDebugEvent) +AlarmRuleDefinition saveAlarmRule(@Nonnull AlarmRuleDefinition alarmRuleDefinition) // Create Or Update Alarm Rule (saveAlarmRule) +com.fasterxml.jackson.databind.JsonNode testAlarmRuleScript(@Nonnull Object body) // Test alarm rule TBEL expression (testAlarmRuleScript) +``` + + +## deleteAlarmRule + +``` +void deleteAlarmRule(@Nonnull String alarmRuleId) +``` + +**DELETE** `/api/alarm/rule/{alarmRuleId}` + +Delete Alarm Rule (deleteAlarmRule) + +Deletes the alarm rule. Referencing non-existing Alarm Rule Id will cause an error. Available for users with 'TENANT_ADMIN' authority. + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **alarmRuleId** | **String** | | | + +### Return type + +null (empty response body) + + +## getAlarmRuleById + +``` +AlarmRuleDefinition getAlarmRuleById(@Nonnull String alarmRuleId) +``` + +**GET** `/api/alarm/rule/{alarmRuleId}` + +Get Alarm Rule (getAlarmRuleById) + +Fetch the Alarm Rule object based on the provided Alarm Rule Id. Available for users with 'TENANT_ADMIN' authority. + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **alarmRuleId** | **String** | | | + +### Return type + +**AlarmRuleDefinition** + + +## getAlarmRuleNames + +``` +PageDataString getAlarmRuleNames(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder) +``` + +**GET** `/api/alarm/rules/names` + +Get alarm rule names (getAlarmRuleNames) + +Fetch the list of alarm rule names. Available for users with 'TENANT_ADMIN' authority. + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pageSize** | **Integer** | Maximum amount of entities in a one page | | +| **page** | **Integer** | Sequence number of page starting from 0 | | +| **textSearch** | **String** | The case insensitive 'substring' filter based on the calculated field name. | [optional] | +| **sortOrder** | **String** | Sort order. ASC (ASCENDING) or DESC (DESCENDING) | [optional] [enum: ASC, DESC] | + +### Return type + +**PageDataString** + + +## getAlarmRules + +``` +PageDataAlarmRuleDefinitionInfo getAlarmRules(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable EntityType entityType, @Nullable Set entities, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) +``` + +**GET** `/api/alarm/rules` + +Get alarm rules (getAlarmRules) + +Fetch tenant alarm rules based on the filter. Available for users with 'TENANT_ADMIN' authority. + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pageSize** | **Integer** | Maximum amount of entities in a one page | | +| **page** | **Integer** | Sequence number of page starting from 0 | | +| **entityType** | **EntityType** | Entity type filter. If not specified, alarm rules for all supported entity types will be returned. | [optional] [enum: TENANT, CUSTOMER, USER, DASHBOARD, ASSET, DEVICE, ALARM, RULE_CHAIN, RULE_NODE, ENTITY_VIEW, WIDGETS_BUNDLE, WIDGET_TYPE, TENANT_PROFILE, DEVICE_PROFILE, ASSET_PROFILE, API_USAGE_STATE, TB_RESOURCE, OTA_PACKAGE, EDGE, RPC, QUEUE, NOTIFICATION_TARGET, NOTIFICATION_TEMPLATE, NOTIFICATION_REQUEST, NOTIFICATION, NOTIFICATION_RULE, QUEUE_STATS, OAUTH2_CLIENT, DOMAIN, MOBILE_APP, MOBILE_APP_BUNDLE, CALCULATED_FIELD, JOB, ADMIN_SETTINGS, AI_MODEL, API_KEY] | +| **entities** | **Set** | Entities filter. If not specified, alarm rules for entity type filter will be returned. | [optional] | +| **textSearch** | **String** | The case insensitive 'substring' filter based on the calculated field name. | [optional] | +| **sortProperty** | **String** | Property of entity to sort by | [optional] [enum: createdTime, name] | +| **sortOrder** | **String** | Sort order. ASC (ASCENDING) or DESC (DESCENDING) | [optional] [enum: ASC, DESC] | + +### Return type + +**PageDataAlarmRuleDefinitionInfo** + + +## getAlarmRulesByEntityId + +``` +PageDataAlarmRuleDefinition getAlarmRulesByEntityId(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) +``` + +**GET** `/api/alarm/rules/{entityType}/{entityId}` + +Get Alarm Rules by Entity Id (getAlarmRulesByEntityId) + +Fetch the Alarm Rules based on the provided Entity Id. Available for users with 'TENANT_ADMIN' authority. + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **entityType** | **String** | A string value representing the entity type. For example, 'DEVICE' | | +| **entityId** | **String** | A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | | +| **pageSize** | **Integer** | Maximum amount of entities in a one page | | +| **page** | **Integer** | Sequence number of page starting from 0 | | +| **textSearch** | **String** | The case insensitive 'substring' filter based on the calculated field name. | [optional] | +| **sortProperty** | **String** | Property of entity to sort by | [optional] [enum: createdTime, name] | +| **sortOrder** | **String** | Sort order. ASC (ASCENDING) or DESC (DESCENDING) | [optional] [enum: ASC, DESC] | + +### Return type + +**PageDataAlarmRuleDefinition** + + +## getLatestAlarmRuleDebugEvent + +``` +com.fasterxml.jackson.databind.JsonNode getLatestAlarmRuleDebugEvent(@Nonnull String alarmRuleId) +``` + +**GET** `/api/alarm/rule/{alarmRuleId}/debug` + +Get latest alarm rule debug event (getLatestAlarmRuleDebugEvent) + +Gets latest alarm rule debug event for specified alarm rule id. Referencing non-existing alarm rule id will cause an error. Available for users with 'TENANT_ADMIN' authority. + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **alarmRuleId** | **String** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## saveAlarmRule + +``` +AlarmRuleDefinition saveAlarmRule(@Nonnull AlarmRuleDefinition alarmRuleDefinition) +``` + +**POST** `/api/alarm/rule` + +Create Or Update Alarm Rule (saveAlarmRule) + +Creates or Updates the Alarm Rule. When creating alarm rule, platform generates Alarm Rule Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Alarm Rule Id will be present in the response. Specify existing Alarm Rule Id to update the alarm rule. Referencing non-existing Alarm Rule Id will cause 'Not Found' error. Remove 'id', 'tenantId' from the request body example (below) to create new Alarm Rule entity. Available for users with 'TENANT_ADMIN' authority. + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **alarmRuleDefinition** | **AlarmRuleDefinition** | A JSON value representing the alarm rule. | | + +### Return type + +**AlarmRuleDefinition** + + +## testAlarmRuleScript + +``` +com.fasterxml.jackson.databind.JsonNode testAlarmRuleScript(@Nonnull Object body) +``` + +**POST** `/api/alarm/rule/testScript` + +Test alarm rule TBEL expression (testAlarmRuleScript) + +Execute the alarm rule TBEL condition expression and return the result. Alarm rule expressions must return a boolean value. The format of request: ```json { \"expression\": \"return temperature > 50;\", \"arguments\": { \"temperature\": { \"type\": \"SINGLE_VALUE\", \"ts\": 1739776478057, \"value\": 55 } } } ``` Expected result JSON contains \"output\" and \"error\". Available for users with 'TENANT_ADMIN' authority. + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Object** | Test alarm rule TBEL condition expression. The expression must return a boolean value. | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + diff --git a/ce/docs/AlarmRuleDefinitionInfo.md b/ce/docs/AlarmRuleDefinitionInfo.md new file mode 100644 index 00000000..f7933c50 --- /dev/null +++ b/ce/docs/AlarmRuleDefinitionInfo.md @@ -0,0 +1,33 @@ + +# AlarmRuleDefinitionInfo + +`org.thingsboard.client.model.AlarmRuleDefinitionInfo` + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **id** | **CalculatedFieldId** | JSON object with the Alarm Rule Id. Referencing non-existing Alarm Rule Id will cause error. | [optional] | +| **createdTime** | **Long** | Timestamp of the alarm rule creation, in milliseconds | [optional] [readonly] | +| **tenantId** | **TenantId** | | [optional] | +| **entityId** | **EntityId** | | [optional] | +| **name** | **String** | User defined name of the alarm rule. | [optional] | +| **debugSettings** | **DebugSettings** | Debug settings object. | [optional] | +| **configurationVersion** | **Integer** | Version of alarm rule configuration. | [optional] | +| **_configuration** | **AlarmCalculatedFieldConfiguration** | | | +| **version** | **Long** | | [optional] | +| **additionalInfo** | **com.fasterxml.jackson.databind.JsonNode** | Additional parameters of the alarm rule. May include: 'description' (string). | [optional] | +| **entityName** | **String** | | [optional] | +| **debugMode** | **Boolean** | | [optional] | + + + +--- + +### Conventions + +- **Package:** `org.thingsboard.client.model` +- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` +- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` +- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions + diff --git a/ce/docs/AlarmSchedule.md b/ce/docs/AlarmSchedule.md deleted file mode 100644 index 7b063a4a..00000000 --- a/ce/docs/AlarmSchedule.md +++ /dev/null @@ -1,25 +0,0 @@ - -# AlarmSchedule - -`org.thingsboard.client.model.AlarmSchedule` - -Configuration for alarm schedule - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **dynamicValue** | **DynamicValueString** | | [optional] | -| **type** | **AlarmScheduleType** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AlarmScheduleType.md b/ce/docs/AlarmScheduleType.md deleted file mode 100644 index 5c79434f..00000000 --- a/ce/docs/AlarmScheduleType.md +++ /dev/null @@ -1,25 +0,0 @@ - -# AlarmScheduleType - -`org.thingsboard.client.model.AlarmScheduleType` - -## Enum Values - - -* `ANY_TIME` (value: `"ANY_TIME"`) - -* `SPECIFIC_TIME` (value: `"SPECIFIC_TIME"`) - -* `CUSTOM` (value: `"CUSTOM"`) - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AnyTimeSchedule.md b/ce/docs/AnyTimeSchedule.md deleted file mode 100644 index 684aad9d..00000000 --- a/ce/docs/AnyTimeSchedule.md +++ /dev/null @@ -1,23 +0,0 @@ - -# AnyTimeSchedule - -`org.thingsboard.client.model.AnyTimeSchedule` - -**Extends:** **AlarmSchedule** - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/AssetProfileInfo.md b/ce/docs/AssetProfileInfo.md index c24acb33..c0d86473 100644 --- a/ce/docs/AssetProfileInfo.md +++ b/ce/docs/AssetProfileInfo.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| **id** | **EntityId** | JSON object with the entity Id. | [optional] | +| **id** | **AssetProfileId** | JSON object with the Asset Profile Id. | [optional] | | **name** | **String** | Entity Name | [optional] | | **image** | **String** | Either URL or Base64 data of the icon. Used in the mobile application to visualize set of asset profiles in the grid view. | [optional] | | **defaultDashboardId** | **DashboardId** | Reference to the dashboard. Used in the mobile application to open the default dashboard when user navigates to asset details. | [optional] | diff --git a/ce/docs/CustomTimeSchedule.md b/ce/docs/CustomTimeSchedule.md deleted file mode 100644 index ead87b19..00000000 --- a/ce/docs/CustomTimeSchedule.md +++ /dev/null @@ -1,25 +0,0 @@ - -# CustomTimeSchedule - -`org.thingsboard.client.model.CustomTimeSchedule` - -**Extends:** **AlarmSchedule** - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **timezone** | **String** | | [optional] | -| **items** | **List\** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/CustomTimeScheduleItem.md b/ce/docs/CustomTimeScheduleItem.md deleted file mode 100644 index fd5eb778..00000000 --- a/ce/docs/CustomTimeScheduleItem.md +++ /dev/null @@ -1,25 +0,0 @@ - -# CustomTimeScheduleItem - -`org.thingsboard.client.model.CustomTimeScheduleItem` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **dayOfWeek** | **Integer** | | [optional] | -| **enabled** | **Boolean** | | [optional] | -| **endsOn** | **Long** | | [optional] | -| **startsOn** | **Long** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/Customer.md b/ce/docs/Customer.md index 4be5ec31..31c78fb3 100644 --- a/ce/docs/Customer.md +++ b/ce/docs/Customer.md @@ -16,7 +16,7 @@ | **address2** | **String** | Address Line 2 | [optional] | | **zip** | **String** | Zip code | [optional] | | **phone** | **String** | Phone number | [optional] | -| **email** | **String** | Email | | +| **email** | **String** | Email | [optional] | | **title** | **String** | Title of the customer | | | **tenantId** | **TenantId** | JSON object with Tenant Id | [optional] | | **version** | **Long** | | [optional] | diff --git a/ce/docs/DashboardControllerApi.md b/ce/docs/DashboardControllerApi.md index 5adb1408..aa570a79 100644 --- a/ce/docs/DashboardControllerApi.md +++ b/ce/docs/DashboardControllerApi.md @@ -9,11 +9,11 @@ Dashboard assignDashboardToEdge(@Nonnull String edgeId, @Nonnull String dashboar Dashboard assignDashboardToPublicCustomer(@Nonnull String dashboardId) // Assign the Dashboard to Public Customer (assignDashboardToPublicCustomer) void deleteDashboard(@Nonnull String dashboardId) // Delete the Dashboard (deleteDashboard) PageDataDashboardInfo getCustomerDashboards(@Nonnull String customerId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable Boolean mobile, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) // Get Customer Dashboards (getCustomerDashboards) -void getDashboardById(@Nonnull String dashboardId, @Nullable Boolean includeResources, @Nullable String acceptEncoding) // Get Dashboard (getDashboardById) +Dashboard getDashboardById(@Nonnull String dashboardId, @Nullable Boolean includeResources, @Nullable String acceptEncoding) // Get Dashboard (getDashboardById) DashboardInfo getDashboardInfoById(@Nonnull String dashboardId) // Get Dashboard Info (getDashboardInfoById) List getDashboardsByIds(@Nonnull List dashboardIds) // Get dashboards by Dashboard Ids (getDashboardsByIds) PageDataDashboardInfo getEdgeDashboards(@Nonnull String edgeId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) // Get Edge Dashboards (getEdgeDashboards) -void getHomeDashboard(@Nullable String acceptEncoding) // Get Home Dashboard (getHomeDashboard) +HomeDashboard getHomeDashboard(@Nullable String acceptEncoding) // Get Home Dashboard (getHomeDashboard) HomeDashboardInfo getHomeDashboardInfo() // Get Home Dashboard Info (getHomeDashboardInfo) Long getMaxDatapointsLimit() // Get max data points limit (getMaxDatapointsLimit) Long getServerTime() // Get server time (getServerTime) @@ -186,7 +186,7 @@ Returns a page of dashboard info objects owned by the specified customer. The Da ## getDashboardById ``` -void getDashboardById(@Nonnull String dashboardId, @Nullable Boolean includeResources, @Nullable String acceptEncoding) +Dashboard getDashboardById(@Nonnull String dashboardId, @Nullable Boolean includeResources, @Nullable String acceptEncoding) ``` **GET** `/api/dashboard/{dashboardId}` @@ -206,7 +206,7 @@ Get the dashboard based on 'dashboardId' parameter. The Dashboard object is a he ### Return type -null (empty response body) +**Dashboard** ## getDashboardInfoById @@ -289,7 +289,7 @@ Returns a page of dashboard info objects assigned to the specified edge. The Das ## getHomeDashboard ``` -void getHomeDashboard(@Nullable String acceptEncoding) +HomeDashboard getHomeDashboard(@Nullable String acceptEncoding) ``` **GET** `/api/dashboard/home` @@ -307,7 +307,7 @@ Returns the home dashboard object that is configured as 'homeDashboardId' parame ### Return type -null (empty response body) +**HomeDashboard** ## getHomeDashboardInfo diff --git a/ce/docs/Device.md b/ce/docs/Device.md index e4dc7441..53771258 100644 --- a/ce/docs/Device.md +++ b/ce/docs/Device.md @@ -14,7 +14,7 @@ | **name** | **String** | Unique Device Name in scope of Tenant | | | **type** | **String** | Device Profile Name | [optional] | | **label** | **String** | Label that may be used in widgets | [optional] | -| **deviceProfileId** | **DeviceProfileId** | JSON object with Device Profile Id. | | +| **deviceProfileId** | **DeviceProfileId** | JSON object with Device Profile Id. If not provided, the type will be used to determine the profile. If neither deviceProfileId nor type is specified, the default device profile will be used. | [optional] | | **firmwareId** | **OtaPackageId** | JSON object with Ota Package Id. | [optional] | | **softwareId** | **OtaPackageId** | JSON object with Ota Package Id. | [optional] | | **version** | **Long** | | [optional] | diff --git a/ce/docs/DeviceInfo.md b/ce/docs/DeviceInfo.md index 4d18b744..702e4133 100644 --- a/ce/docs/DeviceInfo.md +++ b/ce/docs/DeviceInfo.md @@ -14,7 +14,7 @@ | **name** | **String** | Unique Device Name in scope of Tenant | | | **type** | **String** | Device Profile Name | [optional] | | **label** | **String** | Label that may be used in widgets | [optional] | -| **deviceProfileId** | **DeviceProfileId** | JSON object with Device Profile Id. | | +| **deviceProfileId** | **DeviceProfileId** | JSON object with Device Profile Id. If not provided, the type will be used to determine the profile. If neither deviceProfileId nor type is specified, the default device profile will be used. | [optional] | | **firmwareId** | **OtaPackageId** | JSON object with Ota Package Id. | [optional] | | **softwareId** | **OtaPackageId** | JSON object with Ota Package Id. | [optional] | | **version** | **Long** | | [optional] | diff --git a/ce/docs/DeviceProfileAlarm.md b/ce/docs/DeviceProfileAlarm.md deleted file mode 100644 index 9de071b2..00000000 --- a/ce/docs/DeviceProfileAlarm.md +++ /dev/null @@ -1,29 +0,0 @@ - -# DeviceProfileAlarm - -`org.thingsboard.client.model.DeviceProfileAlarm` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **id** | **String** | String value representing the alarm rule id | [optional] | -| **alarmType** | **String** | String value representing type of the alarm | [optional] | -| **createRules** | **Map\** | Complex JSON object representing create alarm rules. The unique create alarm rule can be created for each alarm severity type. There can be 5 create alarm rules configured per a single alarm type. See method implementation notes and AlarmRule model for more details | [optional] | -| **clearRule** | **AlarmRule** | JSON object representing clear alarm rule | [optional] | -| **propagate** | **Boolean** | Propagation flag to specify if alarm should be propagated to parent entities of alarm originator | [optional] | -| **propagateToOwner** | **Boolean** | Propagation flag to specify if alarm should be propagated to the owner (tenant or customer) of alarm originator | [optional] | -| **propagateToTenant** | **Boolean** | Propagation flag to specify if alarm should be propagated to the tenant entity | [optional] | -| **propagateRelationTypes** | **List\** | JSON array of relation types that should be used for propagation. By default, 'propagateRelationTypes' array is empty which means that the alarm will be propagated based on any relation type to parent entities. This parameter should be used only in case when 'propagate' parameter is set to true, otherwise, 'propagateRelationTypes' array will be ignored. | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/DeviceProfileControllerApi.md b/ce/docs/DeviceProfileControllerApi.md index 467014af..08f18de9 100644 --- a/ce/docs/DeviceProfileControllerApi.md +++ b/ce/docs/DeviceProfileControllerApi.md @@ -271,7 +271,7 @@ DeviceProfile saveDeviceProfile(@Nonnull DeviceProfile deviceProfile) Create Or Update Device Profile (saveDeviceProfile) -Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. Device profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant. # Device profile data definition Device profile data object contains alarm rules configuration, device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. ```json { \"alarms\":[ ], \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"DISABLED\", \"provisionDeviceSecret\":null }, \"transportConfiguration\":{ \"type\":\"DEFAULT\" } } ``` ```json { \"alarms\":[ { \"id\":\"2492b935-1226-59e9-8615-17d8978a4f93\", \"alarmType\":\"Temperature Alarm\", \"clearRule\":{ \"schedule\":null, \"condition\":{ \"spec\":{ \"type\":\"SIMPLE\" }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":30.0, \"dynamicValue\":null }, \"operation\":\"LESS\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"propagate\":false, \"createRules\":{ \"MAJOR\":{ \"schedule\":{ \"type\":\"SPECIFIC_TIME\", \"endsOn\":64800000, \"startsOn\":43200000, \"timezone\":\"Europe/Kiev\", \"daysOfWeek\":[ 1, 3, 5 ] }, \"condition\":{ \"spec\":{ \"type\":\"DURATION\", \"unit\":\"MINUTES\", \"predicate\":{ \"userValue\":null, \"defaultValue\":30, \"dynamicValue\":null } }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"COMPLEX\", \"operation\":\"OR\", \"predicates\":[ { \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":50.0, \"dynamicValue\":null }, \"operation\":\"LESS_OR_EQUAL\" }, { \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":30.0, \"dynamicValue\":null }, \"operation\":\"GREATER\" } ] }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"WARNING\":{ \"schedule\":{ \"type\":\"CUSTOM\", \"items\":[ { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":1 }, { \"endsOn\":64800000, \"enabled\":true, \"startsOn\":43200000, \"dayOfWeek\":2 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":3 }, { \"endsOn\":57600000, \"enabled\":true, \"startsOn\":36000000, \"dayOfWeek\":4 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":5 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":6 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":7 } ], \"timezone\":\"Europe/Kiev\" }, \"condition\":{ \"spec\":{ \"type\":\"REPEATING\", \"predicate\":{ \"userValue\":null, \"defaultValue\":5, \"dynamicValue\":null } }, \"condition\":[ { \"key\":{ \"key\":\"tempConstant\", \"type\":\"CONSTANT\" }, \"value\":30, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":0.0, \"dynamicValue\":{ \"inherit\":false, \"sourceType\":\"CURRENT_DEVICE\", \"sourceAttribute\":\"tempThreshold\" } }, \"operation\":\"EQUAL\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"CRITICAL\":{ \"schedule\":null, \"condition\":{ \"spec\":{ \"type\":\"SIMPLE\" }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":50.0, \"dynamicValue\":null }, \"operation\":\"GREATER\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null } }, \"propagateRelationTypes\":null } ], \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"ALLOW_CREATE_NEW_DEVICES\", \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\" }, \"transportConfiguration\":{ \"type\":\"MQTT\", \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\", \"deviceAttributesTopic\":\"v1/devices/me/attributes\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"PROTOBUF\", \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\", \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\", \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\", \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\" } } } ``` Let's review some specific objects examples related to the device profile configuration: # Alarm Schedule Alarm Schedule JSON object represents the time interval during which the alarm rule is active. Note, ```json \"schedule\": null ``` means alarm rule is active all the time. **'daysOfWeek'** field represents Monday as 1, Tuesday as 2 and so on. **'startsOn'** and **'endsOn'** fields represent hours in millis (e.g. 64800000 = 18:00 or 6pm). **'enabled'** flag specifies if item in a custom rule is active for specific day of the week: ## Specific Time Schedule ```json { \"schedule\":{ \"type\":\"SPECIFIC_TIME\", \"endsOn\":64800000, \"startsOn\":43200000, \"timezone\":\"Europe/Kiev\", \"daysOfWeek\":[ 1, 3, 5 ] } } ``` ## Custom Schedule ```json { \"schedule\":{ \"type\":\"CUSTOM\", \"items\":[ { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":1 }, { \"endsOn\":64800000, \"enabled\":true, \"startsOn\":43200000, \"dayOfWeek\":2 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":3 }, { \"endsOn\":57600000, \"enabled\":true, \"startsOn\":36000000, \"dayOfWeek\":4 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":5 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":6 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":7 } ], \"timezone\":\"Europe/Kiev\" } } ``` # Alarm condition type (**'spec'**) Alarm condition type can be either simple, duration, or repeating. For example, 5 times in a row or during 5 minutes. Note, **'userValue'** field is not used and reserved for future usage, **'dynamicValue'** is used for condition appliance by using the value of the **'sourceAttribute'** or else **'defaultValue'** is used (if **'sourceAttribute'** is absent). **'sourceType'** of the **'sourceAttribute'** can be: * 'CURRENT_DEVICE'; * 'CURRENT_CUSTOMER'; * 'CURRENT_TENANT'. **'sourceAttribute'** can be inherited from the owner if **'inherit'** is set to true (for CURRENT_DEVICE and CURRENT_CUSTOMER). ## Repeating alarm condition ```json { \"spec\":{ \"type\":\"REPEATING\", \"predicate\":{ \"userValue\":null, \"defaultValue\":5, \"dynamicValue\":{ \"inherit\":true, \"sourceType\":\"CURRENT_DEVICE\", \"sourceAttribute\":\"tempAttr\" } } } } ``` ## Duration alarm condition ```json { \"spec\":{ \"type\":\"DURATION\", \"unit\":\"MINUTES\", \"predicate\":{ \"userValue\":null, \"defaultValue\":30, \"dynamicValue\":null } } } ``` **'unit'** can be: * 'SECONDS'; * 'MINUTES'; * 'HOURS'; * 'DAYS'. # Key Filters Key filter objects are created under the **'condition'** array. They allow you to define complex logical expressions over entity field, attribute, latest time series value or constant. The filter is defined using 'key', 'valueType', 'value' (refers to the value of the 'CONSTANT' alarm filter key type) and 'predicate' objects. Let's review each object: ## Alarm Filter Key Filter Key defines either entity field, attribute, telemetry or constant. It is a JSON object that consists the key name and type. The following filter key types are supported: * 'ATTRIBUTE' - used for attributes values; * 'TIME_SERIES' - used for time series values; * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type; * 'CONSTANT' - constant value specified. Let's review the example: ```json { \"type\": \"TIME_SERIES\", \"key\": \"temperature\" } ``` ## Value Type and Operations Provides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL; * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; ## Filter Predicate Filter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key. Simple predicate example to check 'value < 100': ```json { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 100, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ``` Complex predicate example, to check 'value < 10 or value > 20': ```json { \"type\": \"COMPLEX\", \"operation\": \"OR\", \"predicates\": [ { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 10, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 20, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ] } ``` More complex predicate example, to check 'value < 10 or (value > 50 && value < 60)': ```json { \"type\": \"COMPLEX\", \"operation\": \"OR\", \"predicates\": [ { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 10, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"type\": \"COMPLEX\", \"operation\": \"AND\", \"predicates\": [ { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 50, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 60, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ] } ] } ``` You may also want to replace hardcoded values (for example, temperature > 20) with the more dynamic expression (for example, temperature > value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or device. See example below: ```json { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 0, \"dynamicValue\": { \"inherit\": false, \"sourceType\": \"CURRENT_TENANT\", \"sourceAttribute\": \"temperatureThreshold\" } }, \"type\": \"NUMERIC\" } ``` Note that you may use 'CURRENT_DEVICE', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source. The 'sourceAttribute' can be inherited from the owner of the specified 'sourceType' if 'inherit' is set to true. # Provision Configuration There are 3 types of device provision configuration for the device profile: * 'DISABLED'; * 'ALLOW_CREATE_NEW_DEVICES'; * 'CHECK_PRE_PROVISIONED_DEVICES'. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details. # Transport Configuration 5 transport configuration types are available: * 'DEFAULT'; * 'MQTT'; * 'LWM2M'; * 'COAP'; * 'SNMP'. Default type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types. See another example of COAP transport configuration below: ```json { \"type\":\"COAP\", \"clientSettings\":{ \"edrxCycle\":null, \"powerMode\":\"DRX\", \"psmActivityTimer\":null, \"pagingTransmissionWindow\":null }, \"coapDeviceTypeConfiguration\":{ \"coapDeviceType\":\"DEFAULT\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"JSON\" } } } ```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. Available for users with 'TENANT_ADMIN' authority. +Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. Device profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant. # Device profile data definition Device profile data object contains device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. ```json { \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"DISABLED\", \"provisionDeviceSecret\":null }, \"transportConfiguration\":{ \"type\":\"DEFAULT\" } } ``` ```json { \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"ALLOW_CREATE_NEW_DEVICES\", \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\" }, \"transportConfiguration\":{ \"type\":\"MQTT\", \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\", \"deviceAttributesTopic\":\"v1/devices/me/attributes\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"PROTOBUF\", \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\", \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\", \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\", \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\" } } } ``` Let's review some specific objects examples related to the device profile configuration:# Provision Configuration There are 3 types of device provision configuration for the device profile: * 'DISABLED'; * 'ALLOW_CREATE_NEW_DEVICES'; * 'CHECK_PRE_PROVISIONED_DEVICES'. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details. # Transport Configuration 5 transport configuration types are available: * 'DEFAULT'; * 'MQTT'; * 'LWM2M'; * 'COAP'; * 'SNMP'. Default type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types. See another example of COAP transport configuration below: ```json { \"type\":\"COAP\", \"clientSettings\":{ \"edrxCycle\":null, \"powerMode\":\"DRX\", \"psmActivityTimer\":null, \"pagingTransmissionWindow\":null }, \"coapDeviceTypeConfiguration\":{ \"coapDeviceType\":\"DEFAULT\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"JSON\" } } } ```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. Available for users with 'TENANT_ADMIN' authority. ### Parameters diff --git a/ce/docs/DeviceProfileData.md b/ce/docs/DeviceProfileData.md index b8c04ef0..20f7c98c 100644 --- a/ce/docs/DeviceProfileData.md +++ b/ce/docs/DeviceProfileData.md @@ -10,7 +10,6 @@ | **_configuration** | **DeviceProfileConfiguration** | JSON object of device profile configuration | [optional] | | **transportConfiguration** | **DeviceProfileTransportConfiguration** | JSON object of device profile transport configuration | [optional] | | **provisionConfiguration** | **DeviceProfileProvisionConfiguration** | JSON object of provisioning strategy type per device profile | [optional] | -| **alarms** | **List\** | | [optional] | diff --git a/ce/docs/DeviceProfileInfo.md b/ce/docs/DeviceProfileInfo.md index b5171a19..85ffc7d3 100644 --- a/ce/docs/DeviceProfileInfo.md +++ b/ce/docs/DeviceProfileInfo.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| **id** | **EntityId** | JSON object with the entity Id. | [optional] | +| **id** | **DeviceProfileId** | JSON object with the Device Profile Id. | [optional] | | **name** | **String** | Entity Name | [optional] | | **image** | **String** | Either URL or Base64 data of the icon. Used in the mobile application to visualize set of device profiles in the grid view. | [optional] | | **defaultDashboardId** | **DashboardId** | Reference to the dashboard. Used in the mobile application to open the default dashboard when user navigates to device details. | [optional] | diff --git a/ce/docs/DurationAlarmConditionSpec.md b/ce/docs/DurationAlarmConditionSpec.md deleted file mode 100644 index 3d76d36e..00000000 --- a/ce/docs/DurationAlarmConditionSpec.md +++ /dev/null @@ -1,27 +0,0 @@ - -# DurationAlarmConditionSpec - -`org.thingsboard.client.model.DurationAlarmConditionSpec` - -Duration Alarm Condition Specification - -**Extends:** **AlarmConditionSpec** - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **unit** | **TimeUnit** | Duration time unit | [optional] | -| **predicate** | **FilterPredicateValueLong** | Duration predicate | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/DynamicValueInteger.md b/ce/docs/DynamicValueInteger.md deleted file mode 100644 index e16dbfbb..00000000 --- a/ce/docs/DynamicValueInteger.md +++ /dev/null @@ -1,25 +0,0 @@ - -# DynamicValueInteger - -`org.thingsboard.client.model.DynamicValueInteger` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **resolvedValue** | **Integer** | | [optional] | -| **sourceType** | **DynamicValueSourceType** | | [optional] | -| **sourceAttribute** | **String** | | [optional] | -| **inherit** | **Boolean** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/DynamicValueLong.md b/ce/docs/DynamicValueLong.md deleted file mode 100644 index 10a84700..00000000 --- a/ce/docs/DynamicValueLong.md +++ /dev/null @@ -1,25 +0,0 @@ - -# DynamicValueLong - -`org.thingsboard.client.model.DynamicValueLong` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **resolvedValue** | **Long** | | [optional] | -| **sourceType** | **DynamicValueSourceType** | | [optional] | -| **sourceAttribute** | **String** | | [optional] | -| **inherit** | **Boolean** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/FilterPredicateValueInteger.md b/ce/docs/FilterPredicateValueInteger.md deleted file mode 100644 index 6b05b0ea..00000000 --- a/ce/docs/FilterPredicateValueInteger.md +++ /dev/null @@ -1,24 +0,0 @@ - -# FilterPredicateValueInteger - -`org.thingsboard.client.model.FilterPredicateValueInteger` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **defaultValue** | **Integer** | | [optional] | -| **userValue** | **Integer** | | [optional] | -| **dynamicValue** | **DynamicValueInteger** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/FilterPredicateValueLong.md b/ce/docs/FilterPredicateValueLong.md deleted file mode 100644 index c18a355d..00000000 --- a/ce/docs/FilterPredicateValueLong.md +++ /dev/null @@ -1,24 +0,0 @@ - -# FilterPredicateValueLong - -`org.thingsboard.client.model.FilterPredicateValueLong` - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **defaultValue** | **Long** | | [optional] | -| **userValue** | **Long** | | [optional] | -| **dynamicValue** | **DynamicValueLong** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/HomeDashboard.md b/ce/docs/HomeDashboard.md new file mode 100644 index 00000000..911eb77f --- /dev/null +++ b/ce/docs/HomeDashboard.md @@ -0,0 +1,34 @@ + +# HomeDashboard + +`org.thingsboard.client.model.HomeDashboard` + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **id** | **DashboardId** | JSON object with the dashboard Id. Specify existing dashboard Id to update the dashboard. Referencing non-existing dashboard id will cause error. Omit this field to create new dashboard. | [optional] | +| **createdTime** | **Long** | Timestamp of the dashboard creation, in milliseconds | [optional] [readonly] | +| **tenantId** | **TenantId** | JSON object with Tenant Id. Tenant Id of the dashboard can't be changed. | [optional] [readonly] | +| **title** | **String** | Title of the dashboard. | | +| **name** | **String** | Same as title of the dashboard. Read-only field. Update the 'title' to change the 'name' of the dashboard. | [optional] [readonly] | +| **image** | **String** | Thumbnail picture for rendering of the dashboards in a grid view on mobile devices. | [optional] [readonly] | +| **mobileHide** | **Boolean** | Hide dashboard from mobile devices. Useful if the dashboard is not designed for small screens. | [optional] [readonly] | +| **mobileOrder** | **Integer** | Order on mobile devices. Useful to adjust sorting of the dashboards for mobile applications | [optional] [readonly] | +| **assignedCustomers** | **Set\** | List of assigned customers with their info. | [optional] | +| **_configuration** | **com.fasterxml.jackson.databind.JsonNode** | JSON object with main configuration of the dashboard: layouts, widgets, aliases, etc. The JSON structure of the dashboard configuration is quite complex. The easiest way to learn it is to export existing dashboard to JSON. | [optional] | +| **resources** | **List\** | | [optional] | +| **version** | **Long** | | [optional] | +| **hideDashboardToolbar** | **Boolean** | Hide dashboard toolbar flag. Useful for rendering dashboards on mobile. | [optional] | + + + +--- + +### Conventions + +- **Package:** `org.thingsboard.client.model` +- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` +- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` +- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions + diff --git a/ce/docs/PageDataAlarmRuleDefinition.md b/ce/docs/PageDataAlarmRuleDefinition.md new file mode 100644 index 00000000..cb674b2a --- /dev/null +++ b/ce/docs/PageDataAlarmRuleDefinition.md @@ -0,0 +1,25 @@ + +# PageDataAlarmRuleDefinition + +`org.thingsboard.client.model.PageDataAlarmRuleDefinition` + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **data** | **List\** | Array of the entities | [optional] | +| **totalPages** | **Integer** | Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria | [optional] [readonly] | +| **totalElements** | **Long** | Total number of elements in all available pages | [optional] [readonly] | +| **hasNext** | **Boolean** | 'false' value indicates the end of the result set | [optional] [readonly] | + + + +--- + +### Conventions + +- **Package:** `org.thingsboard.client.model` +- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` +- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` +- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions + diff --git a/ce/docs/PageDataAlarmRuleDefinitionInfo.md b/ce/docs/PageDataAlarmRuleDefinitionInfo.md new file mode 100644 index 00000000..5484974a --- /dev/null +++ b/ce/docs/PageDataAlarmRuleDefinitionInfo.md @@ -0,0 +1,25 @@ + +# PageDataAlarmRuleDefinitionInfo + +`org.thingsboard.client.model.PageDataAlarmRuleDefinitionInfo` + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **data** | **List\** | Array of the entities | [optional] | +| **totalPages** | **Integer** | Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria | [optional] [readonly] | +| **totalElements** | **Long** | Total number of elements in all available pages | [optional] [readonly] | +| **hasNext** | **Boolean** | 'false' value indicates the end of the result set | [optional] [readonly] | + + + +--- + +### Conventions + +- **Package:** `org.thingsboard.client.model` +- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` +- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` +- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions + diff --git a/ce/docs/RepeatingAlarmConditionSpec.md b/ce/docs/RepeatingAlarmConditionSpec.md deleted file mode 100644 index 90c62399..00000000 --- a/ce/docs/RepeatingAlarmConditionSpec.md +++ /dev/null @@ -1,24 +0,0 @@ - -# RepeatingAlarmConditionSpec - -`org.thingsboard.client.model.RepeatingAlarmConditionSpec` - -**Extends:** **AlarmConditionSpec** - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **predicate** | **FilterPredicateValueInteger** | Repeating predicate | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/RpcV1ControllerApi.md b/ce/docs/RpcV1ControllerApi.md index 1adfae98..8b66ff07 100644 --- a/ce/docs/RpcV1ControllerApi.md +++ b/ce/docs/RpcV1ControllerApi.md @@ -26,7 +26,7 @@ Deprecated. See 'Rpc V 2 Controller' instead. Available for users with 'TENANT_ | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **deviceId** | **String** | A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | | -| **body** | **String** | | | +| **body** | **String** | A JSON object representing the RPC request. | | ### Return type @@ -51,7 +51,7 @@ Deprecated. See 'Rpc V 2 Controller' instead. Available for users with 'TENANT_ | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **deviceId** | **String** | A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | | -| **body** | **String** | | | +| **body** | **String** | A JSON object representing the RPC request. | | ### Return type diff --git a/ce/docs/RpcV2ControllerApi.md b/ce/docs/RpcV2ControllerApi.md index f5ee944b..e09eef8f 100644 --- a/ce/docs/RpcV2ControllerApi.md +++ b/ce/docs/RpcV2ControllerApi.md @@ -107,7 +107,7 @@ Sends the one-way remote-procedure call (RPC) request to device. Sends the one-w | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **deviceId** | **String** | A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | | -| **body** | **String** | | | +| **body** | **String** | A JSON object representing the RPC request. | | ### Return type @@ -132,7 +132,7 @@ Sends the two-way remote-procedure call (RPC) request to device. Sends the one-w | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **deviceId** | **String** | A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | | -| **body** | **String** | | | +| **body** | **String** | A JSON object representing the RPC request. | | ### Return type diff --git a/ce/docs/RuleChainMetaData.md b/ce/docs/RuleChainMetaData.md index 57c05c5d..8d44b2cd 100644 --- a/ce/docs/RuleChainMetaData.md +++ b/ce/docs/RuleChainMetaData.md @@ -15,6 +15,7 @@ A JSON value representing the rule chain metadata. | **nodes** | **List\** | List of rule node JSON objects | | | **connections** | **List\** | List of JSON objects that represent connections between rule nodes | | | **ruleChainConnections** | **List\** | List of JSON objects that represent connections between rule nodes and other rule chains. | | +| **notes** | **List\** | List of sticky notes placed on the rule chain canvas | [optional] | diff --git a/ce/docs/RuleChainNote.md b/ce/docs/RuleChainNote.md new file mode 100644 index 00000000..09b6dacc --- /dev/null +++ b/ce/docs/RuleChainNote.md @@ -0,0 +1,32 @@ + +# RuleChainNote + +`org.thingsboard.client.model.RuleChainNote` + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| **id** | **String** | Unique identifier of the note on the canvas | [optional] | +| **x** | **Integer** | Horizontal position of the note on the canvas, in pixels | [optional] | +| **y** | **Integer** | Vertical position of the note on the canvas, in pixels | [optional] | +| **width** | **Integer** | Width of the note, in pixels | [optional] | +| **height** | **Integer** | Height of the note, in pixels | [optional] | +| **content** | **String** | Markdown or HTML content of the note | [optional] | +| **backgroundColor** | **String** | Background color of the note in CSS hex format, e.g. '#FFF9C4' | [optional] | +| **borderColor** | **String** | Border color of the note in CSS hex format, e.g. '#E6C800' | [optional] | +| **borderWidth** | **Integer** | Border width of the note in pixels | [optional] | +| **applyDefaultMarkdownStyle** | **Boolean** | Whether to apply the default markdown stylesheet to the note content | [optional] | +| **markdownCss** | **String** | Custom CSS styles applied to the note content | [optional] | + + + +--- + +### Conventions + +- **Package:** `org.thingsboard.client.model` +- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` +- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` +- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions + diff --git a/ce/docs/RuleEngineControllerApi.md b/ce/docs/RuleEngineControllerApi.md index a42c667b..3d07cd6b 100644 --- a/ce/docs/RuleEngineControllerApi.md +++ b/ce/docs/RuleEngineControllerApi.md @@ -29,7 +29,7 @@ Creates the Message with type 'REST_API_REQUEST' and payload taken from the requ |------------- | ------------- | ------------- | -------------| | **entityType** | **String** | A string value representing the entity type. For example, 'DEVICE' | | | **entityId** | **String** | A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | | -| **body** | **String** | | | +| **body** | **String** | A JSON object representing the message. | | ### Return type @@ -57,7 +57,7 @@ Creates the Message with type 'REST_API_REQUEST' and payload taken from the requ | **entityId** | **String** | A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | | | **queueName** | **String** | Queue name to process the request in the rule engine | | | **timeout** | **Integer** | Timeout to process the request in milliseconds | | -| **body** | **String** | | | +| **body** | **String** | A JSON object representing the message. | | ### Return type @@ -84,7 +84,7 @@ Creates the Message with type 'REST_API_REQUEST' and payload taken from the requ | **entityType** | **String** | A string value representing the entity type. For example, 'DEVICE' | | | **entityId** | **String** | A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' | | | **timeout** | **Integer** | Timeout to process the request in milliseconds | | -| **body** | **String** | | | +| **body** | **String** | A JSON object representing the message. | | ### Return type @@ -108,7 +108,7 @@ Creates the Message with type 'REST_API_REQUEST' and payload taken from the requ | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | **String** | | | +| **body** | **String** | A JSON object representing the message. | | ### Return type diff --git a/ce/docs/ShortCustomerInfo.md b/ce/docs/ShortCustomerInfo.md index d06b45f3..a15d02ea 100644 --- a/ce/docs/ShortCustomerInfo.md +++ b/ce/docs/ShortCustomerInfo.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| | **customerId** | **CustomerId** | JSON object with the customer Id. | [optional] | | **title** | **String** | Title of the customer. | [optional] | -| **isPublic** | **Boolean** | Indicates special 'Public' customer used to embed dashboards on public websites. | [optional] | +| **_public** | **Boolean** | Indicates special 'Public' customer used to embed dashboards on public websites. | [optional] | diff --git a/ce/docs/SimpleAlarmConditionSpec.md b/ce/docs/SimpleAlarmConditionSpec.md deleted file mode 100644 index 31e293f5..00000000 --- a/ce/docs/SimpleAlarmConditionSpec.md +++ /dev/null @@ -1,23 +0,0 @@ - -# SimpleAlarmConditionSpec - -`org.thingsboard.client.model.SimpleAlarmConditionSpec` - -**Extends:** **AlarmConditionSpec** - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/docs/SpecificTimeSchedule.md b/ce/docs/SpecificTimeSchedule.md deleted file mode 100644 index d5b6e5ff..00000000 --- a/ce/docs/SpecificTimeSchedule.md +++ /dev/null @@ -1,27 +0,0 @@ - -# SpecificTimeSchedule - -`org.thingsboard.client.model.SpecificTimeSchedule` - -**Extends:** **AlarmSchedule** - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -| **daysOfWeek** | **Set\** | | [optional] | -| **endsOn** | **Long** | | [optional] | -| **startsOn** | **Long** | | [optional] | -| **timezone** | **String** | | [optional] | - - - ---- - -### Conventions - -- **Package:** `org.thingsboard.client.model` -- **Getter pattern:** `get()` — e.g., `getId()`, `getName()` -- **Setter pattern:** `set(value)` — e.g., `setId(value)`, `setName(value)` -- **Null fields:** Getters return `null` for unset optional fields; they do not throw exceptions - diff --git a/ce/spec/openapi.json b/ce/spec/openapi.json index ebf24610..548992ee 100644 --- a/ce/spec/openapi.json +++ b/ce/spec/openapi.json @@ -37,6 +37,10 @@ "name": "alarm-controller", "description": "Alarm Controller" }, + { + "name": "alarm-rule-controller", + "description": "Alarm Rule Controller" + }, { "name": "api-key-controller", "description": "Api Key Controller" @@ -7488,19 +7492,20 @@ ] } }, - "/api/apiKey": { + "/api/alarm/rule": { "post": { "tags": [ - "api-key-controller" + "alarm-rule-controller" ], - "summary": "Save API key for user (saveApiKey)", - "description": "Creates an API key for the given user and returns the token ONCE as 'ApiKey {value}'.\n\nAvailable for any authorized user. ", - "operationId": "saveApiKey", + "summary": "Create Or Update Alarm Rule (saveAlarmRule)", + "description": "Creates or Updates the Alarm Rule. When creating alarm rule, platform generates Alarm Rule Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Alarm Rule Id will be present in the response. Specify existing Alarm Rule Id to update the alarm rule. Referencing non-existing Alarm Rule Id will cause 'Not Found' error. Remove 'id', 'tenantId' from the request body example (below) to create new Alarm Rule entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveAlarmRule", "requestBody": { + "description": "A JSON value representing the alarm rule.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiKeyInfo" + "$ref": "#/components/schemas/AlarmRuleDefinition" } } }, @@ -7512,7 +7517,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiKey" + "$ref": "#/components/schemas/AlarmRuleDefinition" } } } @@ -7633,28 +7638,35 @@ ] } }, - "/api/apiKey/{id}": { - "delete": { + "/api/alarm/rule/testScript": { + "post": { "tags": [ - "api-key-controller" + "alarm-rule-controller" ], - "summary": "Delete API key by ID (deleteApiKey)", - "description": "Deletes the API key. Referencing non-existing ApiKey Id will cause an error.\n\nAvailable for any authorized user. ", - "operationId": "deleteApiKey", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" + "summary": "Test alarm rule TBEL expression (testAlarmRuleScript)", + "description": "Execute the alarm rule TBEL condition expression and return the result. Alarm rule expressions must return a boolean value. The format of request: \n\n```json\n{\n \"expression\": \"return temperature > 50;\",\n \"arguments\": {\n \"temperature\": { \"type\": \"SINGLE_VALUE\", \"ts\": 1739776478057, \"value\": 55 }\n }\n}\n```\n\n Expected result JSON contains \"output\" and \"error\".\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "testAlarmRuleScript", + "requestBody": { + "description": "Test alarm rule TBEL condition expression. The expression must return a boolean value.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } } - } - ], + }, + "required": true + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + } }, "400": { "description": "Bad Request", @@ -7668,7 +7680,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -7772,43 +7784,31 @@ ] } }, - "/api/apiKey/{id}/description": { - "put": { + "/api/alarm/rule/{alarmRuleId}": { + "get": { "tags": [ - "api-key-controller" + "alarm-rule-controller" ], - "summary": "Update API key Description", - "description": "Updates the description of the existing API key by apiKeyId. Only the description can be updated. Referencing a non-existing ApiKey Id will cause a 'Not Found' error.\n\nAvailable for any authorized user. ", - "operationId": "updateApiKeyDescription", + "summary": "Get Alarm Rule (getAlarmRuleById)", + "description": "Fetch the Alarm Rule object based on the provided Alarm Rule Id.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAlarmRuleById", "parameters": [ { - "name": "id", + "name": "alarmRuleId", "in": "path", - "description": "A string value representing the api key id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "New description for the API key" - } - } - } - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiKeyInfo" + "$ref": "#/components/schemas/AlarmRuleDefinition" } } } @@ -7927,34 +7927,159 @@ "ApiKeyForm": [] } ] - } - }, - "/api/apiKey/{id}/enabled/{enabledValue}": { - "put": { + }, + "delete": { "tags": [ - "api-key-controller" + "alarm-rule-controller" ], - "summary": "Enable or disable API key (enableApiKey)", - "description": "Updates api key with enabled = true/false. \n\nAvailable for any authorized user. ", - "operationId": "enableApiKey", + "summary": "Delete Alarm Rule (deleteAlarmRule)", + "description": "Deletes the alarm rule. Referencing non-existing Alarm Rule Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteAlarmRule", "parameters": [ { - "name": "id", + "name": "alarmRuleId", "in": "path", - "description": "Unique identifier of the API key to enable/disable", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } + } + ], + "responses": { + "200": { + "description": "OK" }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ { - "name": "enabledValue", + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/alarm/rule/{alarmRuleId}/debug": { + "get": { + "tags": [ + "alarm-rule-controller" + ], + "summary": "Get latest alarm rule debug event (getLatestAlarmRuleDebugEvent)", + "description": "Gets latest alarm rule debug event for specified alarm rule id. Referencing non-existing alarm rule id will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getLatestAlarmRuleDebugEvent", + "parameters": [ + { + "name": "alarmRuleId", "in": "path", - "description": "Enabled or disabled api key", "required": true, "schema": { - "type": "boolean" + "type": "string" } } ], @@ -7964,7 +8089,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiKeyInfo" + "$ref": "#/components/schemas/JsonNode" } } } @@ -8085,24 +8210,15 @@ ] } }, - "/api/apiKeys/{userId}": { + "/api/alarm/rules": { "get": { "tags": [ - "api-key-controller" + "alarm-rule-controller" ], - "summary": "Get User Api Keys (getUserApiKeys)", - "description": "Returns a page of api keys owned by user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for any authorized user. ", - "operationId": "getUserApiKeys", + "summary": "Get alarm rules (getAlarmRules)", + "description": "Fetch tenant alarm rules based on the filter.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAlarmRules", "parameters": [ - { - "name": "userId", - "in": "path", - "description": "A string value representing the user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "pageSize", "in": "query", @@ -8123,10 +8239,33 @@ "format": "int32" } }, + { + "name": "entityType", + "in": "query", + "description": "Entity type filter. If not specified, alarm rules for all supported entity types will be returned.", + "required": false, + "schema": { + "$ref": "#/components/schemas/EntityType" + } + }, + { + "name": "entities", + "in": "query", + "description": "Entities filter. If not specified, alarm rules for entity type filter will be returned.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "uniqueItems": true + } + }, { "name": "textSearch", "in": "query", - "description": "The case insensitive 'substring' filter based on the description.", + "description": "The case insensitive 'substring' filter based on the calculated field name.", "required": false, "schema": { "type": "string" @@ -8141,9 +8280,7 @@ "type": "string", "enum": [ "createdTime", - "expirationTime", - "description", - "enabled" + "name" ] } }, @@ -8167,7 +8304,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataApiKeyInfo" + "$ref": "#/components/schemas/PageDataAlarmRuleDefinitionInfo" } } } @@ -8288,64 +8425,65 @@ ] } }, - "/api/asset": { - "post": { + "/api/alarm/rules/names": { + "get": { "tags": [ - "asset-controller" + "alarm-rule-controller" ], - "summary": "Create Or Update Asset (saveAsset)", - "description": "Creates or Updates the Asset. When creating asset, platform generates Asset Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Asset id will be present in the response. Specify existing Asset id to update the asset. Referencing non-existing Asset Id will cause 'Not Found' error. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Asset entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "saveAsset", + "summary": "Get alarm rule names (getAlarmRuleNames)", + "description": "Fetch the list of alarm rule names.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAlarmRuleNames", "parameters": [ { - "name": "nameConflictPolicy", + "name": "pageSize", "in": "query", - "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", - "required": false, + "description": "Maximum amount of entities in a one page", + "required": true, "schema": { - "$ref": "#/components/schemas/NameConflictPolicy", - "default": "FAIL" + "type": "integer", + "format": "int32" } }, { - "name": "uniquifySeparator", + "name": "page", "in": "query", - "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the calculated field name.", "required": false, "schema": { - "type": "string", - "default": "_" + "type": "string" } }, { - "name": "uniquifyStrategy", + "name": "sortOrder", "in": "query", - "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", "required": false, "schema": { - "$ref": "#/components/schemas/UniquifyStrategy", - "default": "RANDOM" + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], - "requestBody": { - "description": "A JSON value representing the asset.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Asset" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Asset" + "$ref": "#/components/schemas/PageDataString" } } } @@ -8362,7 +8500,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -8466,31 +8604,96 @@ ] } }, - "/api/asset/bulk_import": { - "post": { + "/api/alarm/rules/{entityType}/{entityId}": { + "get": { "tags": [ - "asset-controller" + "alarm-rule-controller" ], - "summary": "Import the bulk of assets (processAssetsBulkImport)", - "description": "There's an ability to import the bulk of assets using the only .csv file.", - "operationId": "processAssetsBulkImport", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BulkImportRequest" - } + "summary": "Get Alarm Rules by Entity Id (getAlarmRulesByEntityId)", + "description": "Fetch the Alarm Rules based on the provided Entity Id.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAlarmRulesByEntityId", + "parameters": [ + { + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the calculated field name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BulkImportResultAsset" + "$ref": "#/components/schemas/PageDataAlarmRuleDefinition" } } } @@ -8507,7 +8710,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -8611,32 +8814,31 @@ ] } }, - "/api/asset/info/{assetId}": { - "get": { + "/api/apiKey": { + "post": { "tags": [ - "asset-controller" + "api-key-controller" ], - "summary": "Get Asset Info (getAssetInfoById)", - "description": "Fetch the Asset Info object based on the provided Asset Id. If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer. Asset Info is an extension of the default Asset object that contains information about the assigned customer name. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getAssetInfoById", - "parameters": [ - { - "name": "assetId", - "in": "path", - "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Save API key for user (saveApiKey)", + "description": "Creates an API key for the given user and returns the token ONCE as 'ApiKey {value}'.\n\nAvailable for any authorized user. ", + "operationId": "saveApiKey", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiKeyInfo" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssetInfo" + "$ref": "#/components/schemas/ApiKey" } } } @@ -8653,7 +8855,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -8757,27 +8959,28 @@ ] } }, - "/api/asset/types": { - "get": { + "/api/apiKey/{id}": { + "delete": { "tags": [ - "asset-controller" + "api-key-controller" + ], + "summary": "Delete API key by ID (deleteApiKey)", + "description": "Deletes the API key. Referencing non-existing ApiKey Id will cause an error.\n\nAvailable for any authorized user. ", + "operationId": "deleteApiKey", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } ], - "summary": "Get Asset Types (getAssetTypes)", - "description": "Deprecated. See 'getAssetProfileNames' API from Asset Profile Controller instead.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getAssetTypes", "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntitySubtype" - } - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -8885,7 +9088,6 @@ } } }, - "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -8896,32 +9098,43 @@ ] } }, - "/api/asset/{assetId}": { - "get": { + "/api/apiKey/{id}/description": { + "put": { "tags": [ - "asset-controller" + "api-key-controller" ], - "summary": "Get Asset (getAssetById)", - "description": "Fetch the Asset object based on the provided Asset Id. If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getAssetById", + "summary": "Update API key Description", + "description": "Updates the description of the existing API key by apiKeyId. Only the description can be updated. Referencing a non-existing ApiKey Id will cause a 'Not Found' error.\n\nAvailable for any authorized user. ", + "operationId": "updateApiKeyDescription", "parameters": [ { - "name": "assetId", + "name": "id", "in": "path", - "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the api key id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "New description for the API key" + } + } + } + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Asset" + "$ref": "#/components/schemas/ApiKeyInfo" } } } @@ -9040,28 +9253,47 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/apiKey/{id}/enabled/{enabledValue}": { + "put": { "tags": [ - "asset-controller" + "api-key-controller" ], - "summary": "Delete asset (deleteAsset)", - "description": "Deletes the asset and all the relations (from and to the asset). Referencing non-existing asset Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "deleteAsset", + "summary": "Enable or disable API key (enableApiKey)", + "description": "Updates api key with enabled = true/false. \n\nAvailable for any authorized user. ", + "operationId": "enableApiKey", "parameters": [ { - "name": "assetId", + "name": "id", "in": "path", - "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Unique identifier of the API key to enable/disable", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" + } + }, + { + "name": "enabledValue", + "in": "path", + "description": "Enabled or disabled api key", + "required": true, + "schema": { + "type": "boolean" } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiKeyInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -9179,25 +9411,79 @@ ] } }, - "/api/assets": { + "/api/apiKeys/{userId}": { "get": { "tags": [ - "asset-controller" + "api-key-controller" ], - "summary": "Get Assets By Ids (getAssetsByIds)", - "description": "Requested assets must be owned by tenant or assigned to customer which user is performing the request. ", - "operationId": "getAssetsByIds", + "summary": "Get User Api Keys (getUserApiKeys)", + "description": "Returns a page of api keys owned by user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for any authorized user. ", + "operationId": "getUserApiKeys", "parameters": [ { - "name": "assetIds", + "name": "userId", + "in": "path", + "description": "A string value representing the user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", "in": "query", - "description": "A list of assets ids, separated by comma ','", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the description.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "expirationTime", + "description", + "enabled" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -9207,10 +9493,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Asset" - } + "$ref": "#/components/schemas/PageDataApiKeyInfo" } } } @@ -9329,19 +9612,54 @@ "ApiKeyForm": [] } ] - }, + } + }, + "/api/asset": { "post": { "tags": [ "asset-controller" ], - "summary": "Find related assets (findAssetsByQuery)", - "description": "Returns all assets that are related to the specific entity. The entity id, relation type, asset types, depth of the search, and other query parameters defined using complex 'AssetSearchQuery' object. See 'Model' tab of the Parameters for more info.", - "operationId": "findAssetsByQuery", + "summary": "Create Or Update Asset (saveAsset)", + "description": "Creates or Updates the Asset. When creating asset, platform generates Asset Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Asset id will be present in the response. Specify existing Asset id to update the asset. Referencing non-existing Asset Id will cause 'Not Found' error. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Asset entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "saveAsset", + "parameters": [ + { + "name": "nameConflictPolicy", + "in": "query", + "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", + "required": false, + "schema": { + "$ref": "#/components/schemas/NameConflictPolicy", + "default": "FAIL" + } + }, + { + "name": "uniquifySeparator", + "in": "query", + "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", + "required": false, + "schema": { + "type": "string", + "default": "_" + } + }, + { + "name": "uniquifyStrategy", + "in": "query", + "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", + "required": false, + "schema": { + "$ref": "#/components/schemas/UniquifyStrategy", + "default": "RANDOM" + } + } + ], "requestBody": { + "description": "A JSON value representing the asset.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssetSearchQuery" + "$ref": "#/components/schemas/Asset" } } }, @@ -9353,10 +9671,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Asset" - } + "$ref": "#/components/schemas/Asset" } } } @@ -9477,32 +9792,31 @@ ] } }, - "/api/customer/asset/{assetId}": { - "delete": { + "/api/asset/bulk_import": { + "post": { "tags": [ "asset-controller" ], - "summary": "Unassign asset from customer (unassignAssetFromCustomer)", - "description": "Clears assignment of the asset to customer. Customer will not be able to query asset afterwards.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "unassignAssetFromCustomer", - "parameters": [ - { - "name": "assetId", - "in": "path", - "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Import the bulk of assets (processAssetsBulkImport)", + "description": "There's an ability to import the bulk of assets using the only .csv file.", + "operationId": "processAssetsBulkImport", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkImportRequest" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Asset" + "$ref": "#/components/schemas/BulkImportResultAsset" } } } @@ -9519,7 +9833,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -9623,14 +9937,14 @@ ] } }, - "/api/customer/public/asset/{assetId}": { - "post": { + "/api/asset/info/{assetId}": { + "get": { "tags": [ "asset-controller" ], - "summary": "Make asset publicly available (assignAssetToPublicCustomer)", - "description": "Asset will be available for non-authorized (not logged-in) users. This is useful to create dashboards that you plan to share/embed on a publicly available website. However, users that are logged-in and belong to different tenant will not be able to access the asset.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "assignAssetToPublicCustomer", + "summary": "Get Asset Info (getAssetInfoById)", + "description": "Fetch the Asset Info object based on the provided Asset Id. If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer. Asset Info is an extension of the default Asset object that contains information about the assigned customer name. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getAssetInfoById", "parameters": [ { "name": "assetId", @@ -9648,7 +9962,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Asset" + "$ref": "#/components/schemas/AssetInfo" } } } @@ -9665,7 +9979,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -9769,41 +10083,24 @@ ] } }, - "/api/customer/{customerId}/asset/{assetId}": { - "post": { + "/api/asset/types": { + "get": { "tags": [ "asset-controller" ], - "summary": "Assign asset to customer (assignAssetToCustomer)", - "description": "Creates assignment of the asset to customer. Customer will be able to query asset afterwards.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "assignAssetToCustomer", - "parameters": [ - { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "assetId", - "in": "path", - "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } - ], + "summary": "Get Asset Types (getAssetTypes)", + "description": "Deprecated. See 'getAssetProfileNames' API from Asset Profile Controller instead.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getAssetTypes", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Asset" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntitySubtype" + } } } } @@ -9820,7 +10117,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -9914,6 +10211,7 @@ } } }, + "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -9924,99 +10222,23 @@ ] } }, - "/api/customer/{customerId}/assetInfos": { + "/api/asset/{assetId}": { "get": { "tags": [ "asset-controller" ], - "summary": "Get Customer Asset Infos (getCustomerAssetInfos)", - "description": "Returns a page of assets info objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Asset Info is an extension of the default Asset object that contains information about the assigned customer name. ", - "operationId": "getCustomerAssetInfos", + "summary": "Get Asset (getAssetById)", + "description": "Fetch the Asset object based on the provided Asset Id. If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getAssetById", "parameters": [ { - "name": "customerId", + "name": "assetId", "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "Asset type", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "assetProfileId", - "in": "query", - "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the asset name.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -10025,7 +10247,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataAssetInfo" + "$ref": "#/components/schemas/Asset" } } } @@ -10144,91 +10366,164 @@ "ApiKeyForm": [] } ] - } - }, - "/api/customer/{customerId}/assets": { - "get": { + }, + "delete": { "tags": [ "asset-controller" ], - "summary": "Get Customer Assets (getCustomerAssets)", - "description": "Returns a page of assets objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. ", - "operationId": "getCustomerAssets", + "summary": "Delete asset (deleteAsset)", + "description": "Deletes the asset and all the relations (from and to the asset). Referencing non-existing asset Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "deleteAsset", "parameters": [ { - "name": "customerId", + "name": "assetId", "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "OK" }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "type", - "in": "query", - "description": "Asset type", - "required": false, - "schema": { - "type": "string" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the asset name.", - "required": false, - "schema": { - "type": "string" + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" - ] + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } } + } + }, + "security": [ + { + "HttpLoginForm": [] }, { - "name": "sortOrder", + "ApiKeyForm": [] + } + ] + } + }, + "/api/assets": { + "get": { + "tags": [ + "asset-controller" + ], + "summary": "Get Assets By Ids (getAssetsByIds)", + "description": "Requested assets must be owned by tenant or assigned to customer which user is performing the request. ", + "operationId": "getAssetsByIds", + "parameters": [ + { + "name": "assetIds", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, + "description": "A list of assets ids, separated by comma ','", + "required": true, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "array", + "items": { + "type": "string" + } } } ], @@ -10238,7 +10533,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataAsset" + "type": "array", + "items": { + "$ref": "#/components/schemas/Asset" + } } } } @@ -10357,43 +10655,34 @@ "ApiKeyForm": [] } ] - } - }, - "/api/edge/{edgeId}/asset/{assetId}": { + }, "post": { "tags": [ "asset-controller" ], - "summary": "Assign asset to edge (assignAssetToEdge)", - "description": "Creates assignment of an existing asset to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment asset (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once asset will be delivered to edge service, it's going to be available for usage on remote edge instance.", - "operationId": "assignAssetToEdge", - "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Find related assets (findAssetsByQuery)", + "description": "Returns all assets that are related to the specific entity. The entity id, relation type, asset types, depth of the search, and other query parameters defined using complex 'AssetSearchQuery' object. See 'Model' tab of the Parameters for more info.", + "operationId": "findAssetsByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetSearchQuery" + } } }, - { - "name": "assetId", - "in": "path", - "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Asset" + "type": "array", + "items": { + "$ref": "#/components/schemas/Asset" + } } } } @@ -10512,24 +10801,17 @@ "ApiKeyForm": [] } ] - }, + } + }, + "/api/customer/asset/{assetId}": { "delete": { "tags": [ "asset-controller" ], - "summary": "Unassign asset from edge (unassignAssetFromEdge)", - "description": "Clears assignment of the asset to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove asset (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove asset locally.", - "operationId": "unassignAssetFromEdge", + "summary": "Unassign asset from customer (unassignAssetFromCustomer)", + "description": "Clears assignment of the asset to customer. Customer will not be able to query asset afterwards.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "unassignAssetFromCustomer", "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "assetId", "in": "path", @@ -10667,110 +10949,23 @@ ] } }, - "/api/edge/{edgeId}/assets": { - "get": { + "/api/customer/public/asset/{assetId}": { + "post": { "tags": [ "asset-controller" ], - "summary": "Get assets assigned to edge (getEdgeAssets)", - "description": "Returns a page of assets assigned to edge. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. ", - "operationId": "getEdgeAssets", + "summary": "Make asset publicly available (assignAssetToPublicCustomer)", + "description": "Asset will be available for non-authorized (not logged-in) users. This is useful to create dashboards that you plan to share/embed on a publicly available website. However, users that are logged-in and belong to different tenant will not be able to access the asset.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "assignAssetToPublicCustomer", "parameters": [ { - "name": "edgeId", + "name": "assetId", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "Asset type", - "required": false, "schema": { "type": "string" } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the asset name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - }, - { - "name": "startTime", - "in": "query", - "description": "Timestamp. Assets with creation time before it won't be queried", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTime", - "in": "query", - "description": "Timestamp. Assets with creation time after it won't be queried", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } } ], "responses": { @@ -10779,7 +10974,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataAsset" + "$ref": "#/components/schemas/Asset" } } } @@ -10796,7 +10991,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -10900,19 +11095,28 @@ ] } }, - "/api/tenant/asset": { - "get": { + "/api/customer/{customerId}/asset/{assetId}": { + "post": { "tags": [ "asset-controller" ], - "summary": "Get Tenant Asset (getTenantAssetByName)", - "description": "Requested asset must be owned by tenant that the user belongs to. Asset name is an unique property of asset. So it can be used to identify the asset.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantAssetByName", + "summary": "Assign asset to customer (assignAssetToCustomer)", + "description": "Creates assignment of the asset to customer. Customer will be able to query asset afterwards.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "assignAssetToCustomer", "parameters": [ { - "name": "assetName", - "in": "query", - "description": "A string value representing the Asset name.", + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "assetId", + "in": "path", + "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -10942,7 +11146,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -11046,15 +11250,24 @@ ] } }, - "/api/tenant/assetInfos": { + "/api/customer/{customerId}/assetInfos": { "get": { "tags": [ "asset-controller" ], - "summary": "Get Tenant Asset Infos (getTenantAssetInfos)", - "description": "Returns a page of assets info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Asset Info is an extension of the default Asset object that contains information about the assigned customer name. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantAssetInfos", + "summary": "Get Customer Asset Infos (getCustomerAssetInfos)", + "description": "Returns a page of assets info objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Asset Info is an extension of the default Asset object that contains information about the assigned customer name. ", + "operationId": "getCustomerAssetInfos", "parameters": [ + { + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "pageSize", "in": "query", @@ -11259,15 +11472,24 @@ ] } }, - "/api/tenant/assets": { + "/api/customer/{customerId}/assets": { "get": { "tags": [ "asset-controller" ], - "summary": "Get Tenant Assets (getTenantAssets)", - "description": "Returns a page of assets owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantAssets", + "summary": "Get Customer Assets (getCustomerAssets)", + "description": "Returns a page of assets objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. ", + "operationId": "getCustomerAssets", "parameters": [ + { + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "pageSize", "in": "query", @@ -11463,31 +11685,41 @@ ] } }, - "/api/assetProfile": { + "/api/edge/{edgeId}/asset/{assetId}": { "post": { "tags": [ - "asset-profile-controller" + "asset-controller" ], - "summary": "Create Or Update Asset Profile (saveAssetProfile)", - "description": "Create or update the Asset Profile. When creating asset profile, platform generates asset profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created asset profile id will be present in the response. Specify existing asset profile id to update the asset profile. Referencing non-existing asset profile Id will cause 'Not Found' error. \n\nAsset profile name is unique in the scope of tenant. Only one 'default' asset profile may exist in scope of tenant. Remove 'id', 'tenantId' from the request body example (below) to create new Asset Profile entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveAssetProfile", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AssetProfile" - } + "summary": "Assign asset to edge (assignAssetToEdge)", + "description": "Creates assignment of an existing asset to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment asset (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once asset will be delivered to edge service, it's going to be available for usage on remote edge instance.", + "operationId": "assignAssetToEdge", + "parameters": [ + { + "name": "edgeId", + "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "assetId", + "in": "path", + "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssetProfile" + "$ref": "#/components/schemas/Asset" } } } @@ -11606,25 +11838,31 @@ "ApiKeyForm": [] } ] - } - }, - "/api/assetProfile/names": { - "get": { + }, + "delete": { "tags": [ - "asset-profile-controller" + "asset-controller" ], - "summary": "Get Asset Profile names (getAssetProfileNames)", - "description": "Returns a set of unique asset profile names owned by the tenant.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getAssetProfileNames", + "summary": "Unassign asset from edge (unassignAssetFromEdge)", + "description": "Clears assignment of the asset to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove asset (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove asset locally.", + "operationId": "unassignAssetFromEdge", "parameters": [ { - "name": "activeOnly", - "in": "query", - "description": "Flag indicating whether to retrieve exclusively the names of asset profiles that are referenced by tenant's assets.", - "required": false, + "name": "edgeId", + "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { - "type": "boolean", - "default": false + "type": "string" + } + }, + { + "name": "assetId", + "in": "path", + "description": "A string value representing the asset id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } } ], @@ -11634,10 +11872,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityInfo" - } + "$ref": "#/components/schemas/Asset" } } } @@ -11758,31 +11993,109 @@ ] } }, - "/api/assetProfile/{assetProfileId}": { + "/api/edge/{edgeId}/assets": { "get": { "tags": [ - "asset-profile-controller" + "asset-controller" ], - "summary": "Get Asset Profile (getAssetProfileById)", - "description": "Fetch the Asset Profile object based on the provided Asset Profile Id. The server checks that the asset profile is owned by the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getAssetProfileById", + "summary": "Get assets assigned to edge (getEdgeAssets)", + "description": "Returns a page of assets assigned to edge. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. ", + "operationId": "getEdgeAssets", "parameters": [ { - "name": "assetProfileId", + "name": "edgeId", "in": "path", - "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "inlineImages", + "name": "pageSize", "in": "query", - "description": "Inline images as a data URL (Base64)", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "Asset type", "required": false, "schema": { - "type": "boolean" + "type": "string" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the asset name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + }, + { + "name": "startTime", + "in": "query", + "description": "Timestamp. Assets with creation time before it won't be queried", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Timestamp. Assets with creation time after it won't be queried", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } } ], @@ -11792,7 +12105,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssetProfile" + "$ref": "#/components/schemas/PageDataAsset" } } } @@ -11911,19 +12224,21 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/tenant/asset": { + "get": { "tags": [ - "asset-profile-controller" + "asset-controller" ], - "summary": "Delete asset profile (deleteAssetProfile)", - "description": "Deletes the asset profile. Referencing non-existing asset profile Id will cause an error. Can't delete the asset profile if it is referenced by existing assets.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteAssetProfile", + "summary": "Get Tenant Asset (getTenantAssetByName)", + "description": "Requested asset must be owned by tenant that the user belongs to. Asset name is an unique property of asset. So it can be used to identify the asset.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantAssetByName", "parameters": [ { - "name": "assetProfileId", - "in": "path", - "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "assetName", + "in": "query", + "description": "A string value representing the Asset name.", "required": true, "schema": { "type": "string" @@ -11932,7 +12247,14 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Asset" + } + } + } }, "400": { "description": "Bad Request", @@ -12050,23 +12372,90 @@ ] } }, - "/api/assetProfile/{assetProfileId}/default": { - "post": { + "/api/tenant/assetInfos": { + "get": { "tags": [ - "asset-profile-controller" + "asset-controller" ], - "summary": "Make Asset Profile Default (setDefaultAssetProfile)", - "description": "Marks asset profile as default within a tenant scope.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "setDefaultAssetProfile", + "summary": "Get Tenant Asset Infos (getTenantAssetInfos)", + "description": "Returns a page of assets info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Asset Info is an extension of the default Asset object that contains information about the assigned customer name. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantAssetInfos", "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "Asset type", + "required": false, + "schema": { + "type": "string" + } + }, { "name": "assetProfileId", - "in": "path", + "in": "query", "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "required": false, "schema": { "type": "string" } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the asset name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -12075,7 +12464,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssetProfile" + "$ref": "#/components/schemas/PageDataAssetInfo" } } } @@ -12092,7 +12481,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -12196,21 +12585,90 @@ ] } }, - "/api/assetProfileInfo/default": { + "/api/tenant/assets": { "get": { "tags": [ - "asset-profile-controller" + "asset-controller" + ], + "summary": "Get Tenant Assets (getTenantAssets)", + "description": "Returns a page of assets owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantAssets", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "Asset type", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the asset name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } ], - "summary": "Get Default Asset Profile (getDefaultAssetProfileInfo)", - "description": "Fetch the Default Asset Profile Info object. Asset Profile Info is a lightweight object that includes main information about Asset Profile. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDefaultAssetProfileInfo", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssetProfileInfo" + "$ref": "#/components/schemas/PageDataAsset" } } } @@ -12331,32 +12789,31 @@ ] } }, - "/api/assetProfileInfo/{assetProfileId}": { - "get": { + "/api/assetProfile": { + "post": { "tags": [ "asset-profile-controller" ], - "summary": "Get Asset Profile Info (getAssetProfileInfoById)", - "description": "Fetch the Asset Profile Info object based on the provided Asset Profile Id. Asset Profile Info is a lightweight object that includes main information about Asset Profile. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getAssetProfileInfoById", - "parameters": [ - { - "name": "assetProfileId", - "in": "path", - "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Create Or Update Asset Profile (saveAssetProfile)", + "description": "Create or update the Asset Profile. When creating asset profile, platform generates asset profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created asset profile id will be present in the response. Specify existing asset profile id to update the asset profile. Referencing non-existing asset profile Id will cause 'Not Found' error. \n\nAsset profile name is unique in the scope of tenant. Only one 'default' asset profile may exist in scope of tenant. Remove 'id', 'tenantId' from the request body example (below) to create new Asset Profile entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveAssetProfile", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetProfile" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AssetProfileInfo" + "$ref": "#/components/schemas/AssetProfile" } } } @@ -12373,7 +12830,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -12477,70 +12934,23 @@ ] } }, - "/api/assetProfileInfos": { + "/api/assetProfile/names": { "get": { "tags": [ "asset-profile-controller" ], - "summary": "Get Asset Profile infos (getAssetProfileInfos)", - "description": "Returns a page of asset profile info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Asset Profile Info is a lightweight object that includes main information about Asset Profile. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getAssetProfileInfos", + "summary": "Get Asset Profile names (getAssetProfileNames)", + "description": "Returns a set of unique asset profile names owned by the tenant.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getAssetProfileNames", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the asset profile name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "description", - "isDefault" - ] - } - }, - { - "name": "sortOrder", + "name": "activeOnly", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "description": "Flag indicating whether to retrieve exclusively the names of asset profiles that are referenced by tenant's assets.", "required": false, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "boolean", + "default": false } } ], @@ -12550,7 +12960,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataAssetProfileInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityInfo" + } } } } @@ -12671,25 +13084,31 @@ ] } }, - "/api/assetProfileInfos/list": { + "/api/assetProfile/{assetProfileId}": { "get": { "tags": [ "asset-profile-controller" ], - "summary": "Get Asset Profiles By Ids (getAssetProfilesByIds)", - "description": "Requested asset profiles must be owned by tenant which is performing the request. \n\n", - "operationId": "getAssetProfilesByIds", + "summary": "Get Asset Profile (getAssetProfileById)", + "description": "Fetch the Asset Profile object based on the provided Asset Profile Id. The server checks that the asset profile is owned by the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAssetProfileById", "parameters": [ { - "name": "assetProfileIds", - "in": "query", - "description": "A list of asset profile ids, separated by comma ','", + "name": "assetProfileId", + "in": "path", + "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" + } + }, + { + "name": "inlineImages", + "in": "query", + "description": "Inline images as a data URL (Base64)", + "required": false, + "schema": { + "type": "boolean" } } ], @@ -12699,10 +13118,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AssetProfileInfo" - } + "$ref": "#/components/schemas/AssetProfile" } } } @@ -12821,72 +13237,442 @@ "ApiKeyForm": [] } ] - } - }, - "/api/assetProfiles": { - "get": { + }, + "delete": { "tags": [ "asset-profile-controller" ], - "summary": "Get Asset Profiles (getAssetProfiles)", - "description": "Returns a page of asset profile objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getAssetProfiles", + "summary": "Delete asset profile (deleteAssetProfile)", + "description": "Deletes the asset profile. Referencing non-existing asset profile Id will cause an error. Can't delete the asset profile if it is referenced by existing assets.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteAssetProfile", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", + "name": "assetProfileId", + "in": "path", + "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string" } + } + ], + "responses": { + "200": { + "description": "OK" }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } } }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the asset profile name.", - "required": false, + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/assetProfile/{assetProfileId}/default": { + "post": { + "tags": [ + "asset-profile-controller" + ], + "summary": "Make Asset Profile Default (setDefaultAssetProfile)", + "description": "Marks asset profile as default within a tenant scope.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "setDefaultAssetProfile", + "parameters": [ + { + "name": "assetProfileId", + "in": "path", + "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetProfile" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid request body", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } + } }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "description", - "isDefault" - ] + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/assetProfileInfo/default": { + "get": { + "tags": [ + "asset-profile-controller" + ], + "summary": "Get Default Asset Profile (getDefaultAssetProfileInfo)", + "description": "Fetch the Default Asset Profile Info object. Asset Profile Info is a lightweight object that includes main information about Asset Profile. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDefaultAssetProfileInfo", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetProfileInfo" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } } }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/assetProfileInfo/{assetProfileId}": { + "get": { + "tags": [ + "asset-profile-controller" + ], + "summary": "Get Asset Profile Info (getAssetProfileInfoById)", + "description": "Fetch the Asset Profile Info object based on the provided Asset Profile Id. Asset Profile Info is a lightweight object that includes main information about Asset Profile. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getAssetProfileInfoById", + "parameters": [ + { + "name": "assetProfileId", + "in": "path", + "description": "A string value representing the asset profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "string" } } ], @@ -12896,7 +13682,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataAssetProfile" + "$ref": "#/components/schemas/AssetProfileInfo" } } } @@ -13017,14 +13803,14 @@ ] } }, - "/api/audit/logs": { + "/api/assetProfileInfos": { "get": { "tags": [ - "audit-log-controller" + "asset-profile-controller" ], - "summary": "Get all audit logs (getAuditLogs)", - "description": "Returns a page of audit logs related to all entities in the scope of the current user's Tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getAuditLogs", + "summary": "Get Asset Profile infos (getAssetProfileInfos)", + "description": "Returns a page of asset profile info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Asset Profile Info is a lightweight object that includes main information about Asset Profile. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getAssetProfileInfos", "parameters": [ { "name": "pageSize", @@ -13049,7 +13835,7 @@ { "name": "textSearch", "in": "query", - "description": "The case insensitive 'substring' filter based on one of the next properties: entityType, entityName, userName, actionType, actionStatus.", + "description": "The case insensitive 'substring' filter based on the asset profile name.", "required": false, "schema": { "type": "string" @@ -13058,17 +13844,15 @@ { "name": "sortProperty", "in": "query", - "description": "Property of audit log to sort by. See the 'Model' tab of the Response Class for more details. Note: entityType sort property is not defined in the AuditLog class, however, it can be used to sort audit logs by types of entities that were logged.", + "description": "Property of entity to sort by", "required": false, "schema": { "type": "string", "enum": [ "createdTime", - "entityType", - "entityName", - "userName", - "actionType", - "actionStatus" + "name", + "description", + "isDefault" ] } }, @@ -13084,34 +13868,154 @@ "DESC" ] } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataAssetProfileInfo" + } + } + } }, - { - "name": "startTime", - "in": "query", - "description": "The start timestamp in milliseconds of the search time range over the AuditLog class field: 'createdTime'.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "endTime", - "in": "query", - "description": "The end timestamp in milliseconds of the search time range over the AuditLog class field: 'createdTime'.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } } }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ { - "name": "actionTypes", + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/assetProfileInfos/list": { + "get": { + "tags": [ + "asset-profile-controller" + ], + "summary": "Get Asset Profiles By Ids (getAssetProfilesByIds)", + "description": "Requested asset profiles must be owned by tenant which is performing the request. \n\n", + "operationId": "getAssetProfilesByIds", + "parameters": [ + { + "name": "assetProfileIds", "in": "query", - "description": "A String value representing comma-separated list of action types. This parameter is optional, but it can be used to filter results to fetch only audit logs of specific action types. For example, 'LOGIN', 'LOGOUT'. See the 'Model' tab of the Response Class for more details.", - "required": false, + "description": "A list of asset profile ids, separated by comma ','", + "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -13121,7 +14025,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataAuditLog" + "type": "array", + "items": { + "$ref": "#/components/schemas/AssetProfileInfo" + } } } } @@ -13242,24 +14149,209 @@ ] } }, - "/api/audit/logs/customer/{customerId}": { + "/api/assetProfiles": { "get": { "tags": [ - "audit-log-controller" + "asset-profile-controller" ], - "summary": "Get audit logs by customer id (getAuditLogsByCustomerId)", - "description": "Returns a page of audit logs related to the targeted customer entities (devices, assets, etc.), and users actions (login, logout, etc.) that belong to this customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getAuditLogsByCustomerId", + "summary": "Get Asset Profiles (getAssetProfiles)", + "description": "Returns a page of asset profile objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAssetProfiles", "parameters": [ { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the asset profile name.", + "required": false, "schema": { "type": "string" } }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "description", + "isDefault" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataAssetProfile" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/audit/logs": { + "get": { + "tags": [ + "audit-log-controller" + ], + "summary": "Get all audit logs (getAuditLogs)", + "description": "Returns a page of audit logs related to all entities in the scope of the current user's Tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getAuditLogs", + "parameters": [ { "name": "pageSize", "in": "query", @@ -13476,28 +14568,19 @@ ] } }, - "/api/audit/logs/entity/{entityType}/{entityId}": { + "/api/audit/logs/customer/{customerId}": { "get": { "tags": [ "audit-log-controller" ], - "summary": "Get audit logs by entity id (getAuditLogsByEntityId)", - "description": "Returns a page of audit logs related to the actions on the targeted entity. Basically, this API call is used to get the full lifecycle of some specific entity. For example to see when a device was created, updated, assigned to some customer, or even deleted from the system. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getAuditLogsByEntityId", + "summary": "Get audit logs by customer id (getAuditLogsByCustomerId)", + "description": "Returns a page of audit logs related to the targeted customer entities (devices, assets, etc.), and users actions (login, logout, etc.) that belong to this customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAuditLogsByCustomerId", "parameters": [ { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityId", + "name": "customerId", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -13719,19 +14802,28 @@ ] } }, - "/api/audit/logs/user/{userId}": { + "/api/audit/logs/entity/{entityType}/{entityId}": { "get": { "tags": [ "audit-log-controller" ], - "summary": "Get audit logs by user id (getAuditLogsByUserId)", - "description": "Returns a page of audit logs related to the actions of targeted user. For example, RPC call to a particular device, or alarm acknowledgment for a specific device, etc. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getAuditLogsByUserId", + "summary": "Get audit logs by entity id (getAuditLogsByEntityId)", + "description": "Returns a page of audit logs related to the actions on the targeted entity. Basically, this API call is used to get the full lifecycle of some specific entity. For example to see when a device was created, updated, assigned to some customer, or even deleted from the system. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getAuditLogsByEntityId", "parameters": [ { - "name": "userId", + "name": "entityType", "in": "path", - "description": "A string value representing the user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -13953,31 +15045,120 @@ ] } }, - "/api/auth/changePassword": { - "post": { + "/api/audit/logs/user/{userId}": { + "get": { "tags": [ - "auth-controller" + "audit-log-controller" ], - "summary": "Change password for current User (changePassword)", - "description": "Change the password for the User which credentials are used to perform this REST API call. Be aware that previously generated [JWT](https://jwt.io/) tokens will be still valid until they expire.", - "operationId": "changePassword", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChangePasswordRequest" - } + "summary": "Get audit logs by user id (getAuditLogsByUserId)", + "description": "Returns a page of audit logs related to the actions of targeted user. For example, RPC call to a particular device, or alarm acknowledgment for a specific device, etc. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAuditLogsByUserId", + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "A string value representing the user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on one of the next properties: entityType, entityName, userName, actionType, actionStatus.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of audit log to sort by. See the 'Model' tab of the Response Class for more details. Note: entityType sort property is not defined in the AuditLog class, however, it can be used to sort audit logs by types of entities that were logged.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "entityType", + "entityName", + "userName", + "actionType", + "actionStatus" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + }, + { + "name": "startTime", + "in": "query", + "description": "The start timestamp in milliseconds of the search time range over the AuditLog class field: 'createdTime'.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "The end timestamp in milliseconds of the search time range over the AuditLog class field: 'createdTime'.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "actionTypes", + "in": "query", + "description": "A String value representing comma-separated list of action types. This parameter is optional, but it can be used to filter results to fetch only audit logs of specific action types. For example, 'LOGIN', 'LOGOUT'. See the 'Model' tab of the Response Class for more details.", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JwtPair" + "$ref": "#/components/schemas/PageDataAuditLog" } } } @@ -13994,7 +15175,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -14098,17 +15279,34 @@ ] } }, - "/api/auth/logout": { + "/api/auth/changePassword": { "post": { "tags": [ "auth-controller" ], - "summary": "Logout (logout)", - "description": "Special API call to record the 'logout' of the user to the Audit Logs. Since platform uses [JWT](https://jwt.io/), the actual logout is the procedure of clearing the [JWT](https://jwt.io/) token on the client side. ", - "operationId": "logout", + "summary": "Change password for current User (changePassword)", + "description": "Change the password for the User which credentials are used to perform this REST API call. Be aware that previously generated [JWT](https://jwt.io/) tokens will be still valid until they expire.", + "operationId": "changePassword", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangePasswordRequest" + } + } + }, + "required": true + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JwtPair" + } + } + } }, "400": { "description": "Bad Request", @@ -14226,24 +15424,17 @@ ] } }, - "/api/auth/user": { - "get": { + "/api/auth/logout": { + "post": { "tags": [ "auth-controller" ], - "summary": "Get current User (getUser)", - "description": "Get the information about the User which credentials are used to perform this REST API call.", - "operationId": "getUser", + "summary": "Logout (logout)", + "description": "Special API call to record the 'logout' of the user to the Audit Logs. Since platform uses [JWT](https://jwt.io/), the actual logout is the procedure of clearing the [JWT](https://jwt.io/) token on the client side. ", + "operationId": "logout", "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -14257,7 +15448,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -14361,32 +15552,21 @@ ] } }, - "/api/noauth/activate": { + "/api/auth/user": { "get": { "tags": [ "auth-controller" ], - "summary": "Check Activate User Token (checkActivateToken)", - "description": "Checks the activation token and forwards user to 'Create Password' page. If token is valid, returns '303 See Other' (redirect) response code with the correct address of 'Create Password' page and same 'activateToken' specified in the URL parameters. If token is not valid, returns '409 Conflict'. If token is expired, redirects to error page.", - "operationId": "checkActivateToken", - "parameters": [ - { - "name": "activateToken", - "in": "query", - "description": "The activate token string.", - "required": true, - "schema": { - "type": "string" - } - } - ], + "summary": "Get current User (getUser)", + "description": "Get the information about the User which credentials are used to perform this REST API call.", + "operationId": "getUser", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/User" } } } @@ -14496,43 +15676,43 @@ } } } - } - }, - "post": { + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/noauth/activate": { + "get": { "tags": [ "auth-controller" ], - "summary": "Activate User", - "description": "Checks the activation token and updates corresponding user password in the database. Now the user may start using his password to login. The response already contains the [JWT](https://jwt.io) activation and refresh tokens, to simplify the user activation flow and avoid asking user to input password again after activation. If token is valid, returns the object that contains [JWT](https://jwt.io/) access and refresh tokens. If token is not valid, returns '400 Bad Request'.", - "operationId": "activateUser", + "summary": "Check Activate User Token (checkActivateToken)", + "description": "Checks the activation token and forwards user to 'Create Password' page. If token is valid, returns '303 See Other' (redirect) response code with the correct address of 'Create Password' page and same 'activateToken' specified in the URL parameters. If token is not valid, returns '409 Conflict'. If token is expired, redirects to error page.", + "operationId": "checkActivateToken", "parameters": [ { - "name": "sendActivationMail", + "name": "activateToken", "in": "query", - "required": false, + "description": "The activate token string.", + "required": true, "schema": { - "type": "boolean", - "default": true + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ActivateUserRequest" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JwtPair" + "type": "object" } } } @@ -14549,7 +15729,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -14643,34 +15823,42 @@ } } } - } - }, - "/api/noauth/resetPassword": { - "get": { + }, + "post": { "tags": [ "auth-controller" ], - "summary": "Check password reset token (checkResetToken)", - "description": "Checks the password reset token and forwards user to 'Reset Password' page. If token is valid, returns '303 See Other' (redirect) response code with the correct address of 'Reset Password' page and same 'resetToken' specified in the URL parameters. If token is not valid, returns '409 Conflict'. If token is expired, redirects to error page.", - "operationId": "checkResetToken", + "summary": "Activate User", + "description": "Checks the activation token and updates corresponding user password in the database. Now the user may start using his password to login. The response already contains the [JWT](https://jwt.io) activation and refresh tokens, to simplify the user activation flow and avoid asking user to input password again after activation. If token is valid, returns the object that contains [JWT](https://jwt.io/) access and refresh tokens. If token is not valid, returns '400 Bad Request'.", + "operationId": "activateUser", "parameters": [ { - "name": "resetToken", + "name": "sendActivationMail", "in": "query", - "description": "The reset token string.", - "required": true, + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": true } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivateUserRequest" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/JwtPair" } } } @@ -14687,7 +15875,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -14781,27 +15969,37 @@ } } } - }, - "post": { + } + }, + "/api/noauth/resetPassword": { + "get": { "tags": [ "auth-controller" ], - "summary": "Reset password (resetPassword)", - "description": "Checks the password reset token and updates the password. If token is not valid, returns '400 Bad Request'.", - "operationId": "resetPassword", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResetPasswordRequest" - } + "summary": "Check password reset token (checkResetToken)", + "description": "Checks the password reset token and forwards user to 'Reset Password' page. If token is valid, returns '303 See Other' (redirect) response code with the correct address of 'Reset Password' page and same 'resetToken' specified in the URL parameters. If token is not valid, returns '409 Conflict'. If token is expired, redirects to error page.", + "operationId": "checkResetToken", + "parameters": [ + { + "name": "resetToken", + "in": "query", + "description": "The reset token string.", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } }, "400": { "description": "Bad Request", @@ -14815,7 +16013,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -14909,21 +16107,19 @@ } } } - } - }, - "/api/noauth/resetPasswordByEmail": { + }, "post": { "tags": [ "auth-controller" ], - "summary": "Request reset password email (requestResetPasswordByEmail)", - "description": "Request to send the reset password email if the user with specified email address is present in the database. Always return '200 OK' status for security purposes.", - "operationId": "requestResetPasswordByEmail", + "summary": "Reset password (resetPassword)", + "description": "Checks the password reset token and updates the password. If token is not valid, returns '400 Bad Request'.", + "operationId": "resetPassword", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResetPasswordEmailRequest" + "$ref": "#/components/schemas/ResetPasswordRequest" } } }, @@ -15041,25 +16237,28 @@ } } }, - "/api/noauth/userPasswordPolicy": { - "get": { + "/api/noauth/resetPasswordByEmail": { + "post": { "tags": [ "auth-controller" ], - "summary": "Get the current User password policy (getUserPasswordPolicy)", - "description": "API call to get the password policy for the password validation form(s).", - "operationId": "getUserPasswordPolicy", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserPasswordPolicy" - } + "summary": "Request reset password email (requestResetPasswordByEmail)", + "description": "Request to send the reset password email if the user with specified email address is present in the database. Always return '200 OK' status for security purposes.", + "operationId": "requestResetPasswordByEmail", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResetPasswordEmailRequest" } } }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + }, "400": { "description": "Bad Request", "content": { @@ -15072,7 +16271,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -15168,32 +16367,21 @@ } } }, - "/api/calculatedField": { - "post": { + "/api/noauth/userPasswordPolicy": { + "get": { "tags": [ - "calculated-field-controller" + "auth-controller" ], - "summary": "Create Or Update Calculated Field (saveCalculatedField)", - "description": "Creates or Updates the Calculated Field. When creating calculated field, platform generates Calculated Field Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Calculated Field Id will be present in the response. Specify existing Calculated Field Id to update the calculated field. Referencing non-existing Calculated Field Id will cause 'Not Found' error. Remove 'id', 'tenantId' from the request body example (below) to create new Calculated Field entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "saveCalculatedField", - "requestBody": { - "description": "A JSON value representing the calculated field.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CalculatedField" - } - } - }, - "required": true - }, + "summary": "Get the current User password policy (getUserPasswordPolicy)", + "description": "API call to get the password policy for the password validation form(s).", + "operationId": "getUserPasswordPolicy", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalculatedField" + "$ref": "#/components/schemas/UserPasswordPolicy" } } } @@ -15210,7 +16398,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -15303,31 +16491,23 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/calculatedField/testScript": { + "/api/calculatedField": { "post": { "tags": [ "calculated-field-controller" ], - "summary": "Test Script expression", - "description": "Execute the Script expression and return the result. The format of request: \n\n```json\n{\n \"expression\": \"var temp = 0; foreach(element: temperature.values) {temp += element.value;} var avgTemperature = temp / temperature.values.size(); var adjustedTemperature = avgTemperature + 0.1 * humidity.value; return {\\\"adjustedTemperature\\\": adjustedTemperature};\",\n \"arguments\": {\n \"temperature\": {\n \"type\": \"TS_ROLLING\",\n \"timeWindow\": {\n \"startTs\": 1739775630002,\n \"endTs\": 65432211,\n \"limit\": 5\n },\n \"values\": [\n { \"ts\": 1739775639851, \"value\": 23 },\n { \"ts\": 1739775664561, \"value\": 43 },\n { \"ts\": 1739775713079, \"value\": 15 },\n { \"ts\": 1739775999522, \"value\": 34 },\n { \"ts\": 1739776228452, \"value\": 22 }\n ]\n },\n \"humidity\": { \"type\": \"SINGLE_VALUE\", \"ts\": 1739776478057, \"value\": 23 }\n }\n}\n```\n\n Expected result JSON contains \"output\" and \"error\".\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "testCalculatedFieldScript", + "summary": "Create Or Update Calculated Field (saveCalculatedField)", + "description": "Creates or Updates the Calculated Field. When creating calculated field, platform generates Calculated Field Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Calculated Field Id will be present in the response. Specify existing Calculated Field Id to update the calculated field. Referencing non-existing Calculated Field Id will cause 'Not Found' error. Remove 'id', 'tenantId' from the request body example (below) to create new Calculated Field entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "saveCalculatedField", "requestBody": { - "description": "Test calculated field TBEL expression.", + "description": "A JSON value representing the calculated field.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JsonNode" + "$ref": "#/components/schemas/CalculatedField" } } }, @@ -15339,7 +16519,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JsonNode" + "$ref": "#/components/schemas/CalculatedField" } } } @@ -15460,31 +16640,32 @@ ] } }, - "/api/calculatedField/{calculatedFieldId}": { - "get": { + "/api/calculatedField/testScript": { + "post": { "tags": [ "calculated-field-controller" ], - "summary": "Get Calculated Field (getCalculatedFieldById)", - "description": "Fetch the Calculated Field object based on the provided Calculated Field Id.", - "operationId": "getCalculatedFieldById", - "parameters": [ - { - "name": "calculatedFieldId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "summary": "Test Script expression", + "description": "Execute the Script expression and return the result. The format of request: \n\n```json\n{\n \"expression\": \"var temp = 0; foreach(element: temperature.values) {temp += element.value;} var avgTemperature = temp / temperature.values.size(); var adjustedTemperature = avgTemperature + 0.1 * humidity.value; return {\\\"adjustedTemperature\\\": adjustedTemperature};\",\n \"arguments\": {\n \"temperature\": {\n \"type\": \"TS_ROLLING\",\n \"timeWindow\": {\n \"startTs\": 1739775630002,\n \"endTs\": 65432211,\n \"limit\": 5\n },\n \"values\": [\n { \"ts\": 1739775639851, \"value\": 23 },\n { \"ts\": 1739775664561, \"value\": 43 },\n { \"ts\": 1739775713079, \"value\": 15 },\n { \"ts\": 1739775999522, \"value\": 34 },\n { \"ts\": 1739776228452, \"value\": 22 }\n ]\n },\n \"humidity\": { \"type\": \"SINGLE_VALUE\", \"ts\": 1739776478057, \"value\": 23 }\n }\n}\n```\n\n Expected result JSON contains \"output\" and \"error\".\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "testCalculatedFieldScript", + "requestBody": { + "description": "Test calculated field TBEL expression.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CalculatedField" + "$ref": "#/components/schemas/JsonNode" } } } @@ -15501,7 +16682,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -15603,14 +16784,16 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/calculatedField/{calculatedFieldId}": { + "get": { "tags": [ "calculated-field-controller" ], - "summary": "Delete Calculated Field (deleteCalculatedField)", - "description": "Deletes the calculated field. Referencing non-existing Calculated Field Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "deleteCalculatedField", + "summary": "Get Calculated Field (getCalculatedFieldById)", + "description": "Fetch the Calculated Field object based on the provided Calculated Field Id.", + "operationId": "getCalculatedFieldById", "parameters": [ { "name": "calculatedFieldId", @@ -15623,7 +16806,14 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculatedField" + } + } + } }, "400": { "description": "Bad Request", @@ -15739,16 +16929,14 @@ "ApiKeyForm": [] } ] - } - }, - "/api/calculatedField/{calculatedFieldId}/debug": { - "get": { + }, + "delete": { "tags": [ "calculated-field-controller" ], - "summary": "Get latest calculated field debug event (getLatestCalculatedFieldDebugEvent)", - "description": "Gets latest calculated field debug event for specified calculated field id. Referencing non-existing calculated field id will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getLatestCalculatedFieldDebugEvent", + "summary": "Delete Calculated Field (deleteCalculatedField)", + "description": "Deletes the calculated field. Referencing non-existing Calculated Field Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "deleteCalculatedField", "parameters": [ { "name": "calculatedFieldId", @@ -15761,14 +16949,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JsonNode" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -15886,96 +17067,22 @@ ] } }, - "/api/calculatedField/{entityType}/{entityId}": { + "/api/calculatedField/{calculatedFieldId}/debug": { "get": { "tags": [ "calculated-field-controller" ], - "summary": "Get Calculated Fields by Entity Id (getCalculatedFieldsByEntityId)", - "description": "Fetch the Calculated Fields based on the provided Entity Id.", - "operationId": "getCalculatedFieldsByEntityId", + "summary": "Get latest calculated field debug event (getLatestCalculatedFieldDebugEvent)", + "description": "Gets latest calculated field debug event for specified calculated field id. Referencing non-existing calculated field id will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getLatestCalculatedFieldDebugEvent", "parameters": [ { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityId", + "name": "calculatedFieldId", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "Calculated field type. If not specified, all types will be returned.", - "required": false, - "schema": { - "$ref": "#/components/schemas/CalculatedFieldType" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the calculated field name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -15984,7 +17091,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataCalculatedField" + "$ref": "#/components/schemas/JsonNode" } } } @@ -16105,69 +17212,60 @@ ] } }, - "/api/calculatedFields": { + "/api/calculatedField/{entityType}/{entityId}": { "get": { "tags": [ "calculated-field-controller" ], - "summary": "Get calculated fields (getCalculatedFields)", - "description": "Fetch tenant calculated fields based on the filter.", - "operationId": "getCalculatedFields", + "summary": "Get Calculated Fields by Entity Id (getCalculatedFieldsByEntityId)", + "description": "Fetch the Calculated Fields based on the provided Entity Id.", + "operationId": "getCalculatedFieldsByEntityId", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string" } }, { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string" } }, { - "name": "types", + "name": "pageSize", "in": "query", - "description": "Calculated field types filter.", - "required": false, + "description": "Maximum amount of entities in a one page", + "required": true, "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CalculatedFieldType" - }, - "uniqueItems": true + "type": "integer", + "format": "int32" } }, { - "name": "entityType", + "name": "page", "in": "query", - "description": "Entity type filter. If not specified, calculated fields for all supported entity types will be returned.", - "required": false, + "description": "Sequence number of page starting from 0", + "required": true, "schema": { - "$ref": "#/components/schemas/EntityType" + "type": "integer", + "format": "int32" } }, { - "name": "entities", + "name": "type", "in": "query", - "description": "Entities filter. If not specified, calculated fields for entity type filter will be returned.", + "description": "Calculated field type. If not specified, all types will be returned.", "required": false, "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "uniqueItems": true + "$ref": "#/components/schemas/CalculatedFieldType" } }, { @@ -16204,17 +17302,6 @@ "DESC" ] } - }, - { - "name": "name", - "in": "query", - "description": "Repeatable name query parameter", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } } ], "responses": { @@ -16223,7 +17310,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataCalculatedFieldInfo" + "$ref": "#/components/schemas/PageDataCalculatedField" } } } @@ -16344,24 +17431,15 @@ ] } }, - "/api/calculatedFields/names": { + "/api/calculatedFields": { "get": { "tags": [ "calculated-field-controller" ], - "summary": "Get calculated field names (getCalculatedFieldNames)", - "description": "Fetch the list of calculated field names for specified type.", - "operationId": "getCalculatedFieldNames", + "summary": "Get calculated fields (getCalculatedFields)", + "description": "Fetch tenant calculated fields based on the filter.", + "operationId": "getCalculatedFields", "parameters": [ - { - "name": "type", - "in": "query", - "description": "Calculated field type filter.", - "required": true, - "schema": { - "$ref": "#/components/schemas/CalculatedFieldType" - } - }, { "name": "pageSize", "in": "query", @@ -16382,6 +17460,42 @@ "format": "int32" } }, + { + "name": "types", + "in": "query", + "description": "Calculated field types filter.", + "required": false, + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CalculatedFieldType" + }, + "uniqueItems": true + } + }, + { + "name": "entityType", + "in": "query", + "description": "Entity type filter. If not specified, calculated fields for all supported entity types will be returned.", + "required": false, + "schema": { + "$ref": "#/components/schemas/EntityType" + } + }, + { + "name": "entities", + "in": "query", + "description": "Entities filter. If not specified, calculated fields for entity type filter will be returned.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "uniqueItems": true + } + }, { "name": "textSearch", "in": "query", @@ -16391,6 +17505,19 @@ "type": "string" } }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name" + ] + } + }, { "name": "sortOrder", "in": "query", @@ -16403,6 +17530,17 @@ "DESC" ] } + }, + { + "name": "name", + "in": "query", + "description": "Repeatable name query parameter", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } } ], "responses": { @@ -16411,7 +17549,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataString" + "$ref": "#/components/schemas/PageDataCalculatedFieldInfo" } } } @@ -16532,23 +17670,65 @@ ] } }, - "/api/component/{componentDescriptorClazz}": { + "/api/calculatedFields/names": { "get": { "tags": [ - "component-descriptor-controller" + "calculated-field-controller" ], - "summary": "Get Component Descriptor (getComponentDescriptorByClazz)", - "description": "Gets the Component Descriptor object using class name from the path parameters. Each Component Descriptor represents configuration of specific rule node (e.g. 'Save Timeseries' or 'Send Email'.). The Component Descriptors are used by the rule chain Web UI to build the configuration forms for the rule nodes. The Component Descriptors are discovered at runtime by scanning the class path and searching for @RuleNode annotation. Once discovered, the up to date list of descriptors is persisted to the database.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getComponentDescriptorByClazz", + "summary": "Get calculated field names (getCalculatedFieldNames)", + "description": "Fetch the list of calculated field names for specified type.", + "operationId": "getCalculatedFieldNames", "parameters": [ { - "name": "componentDescriptorClazz", - "in": "path", - "description": "Component Descriptor class name", + "name": "type", + "in": "query", + "description": "Calculated field type filter.", "required": true, + "schema": { + "$ref": "#/components/schemas/CalculatedFieldType" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the calculated field name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -16557,7 +17737,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ComponentDescriptor" + "$ref": "#/components/schemas/PageDataString" } } } @@ -16678,38 +17858,22 @@ ] } }, - "/api/components": { + "/api/component/{componentDescriptorClazz}": { "get": { "tags": [ "component-descriptor-controller" ], - "summary": "Get Component Descriptors (getComponentDescriptorsByTypes)", - "description": "Gets the Component Descriptors using coma separated list of rule node types and optional rule chain type request parameters. Each Component Descriptor represents configuration of specific rule node (e.g. 'Save Timeseries' or 'Send Email'.). The Component Descriptors are used by the rule chain Web UI to build the configuration forms for the rule nodes. The Component Descriptors are discovered at runtime by scanning the class path and searching for @RuleNode annotation. Once discovered, the up to date list of descriptors is persisted to the database.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getComponentDescriptorsByTypes", + "summary": "Get Component Descriptor (getComponentDescriptorByClazz)", + "description": "Gets the Component Descriptor object using class name from the path parameters. Each Component Descriptor represents configuration of specific rule node (e.g. 'Save Timeseries' or 'Send Email'.). The Component Descriptors are used by the rule chain Web UI to build the configuration forms for the rule nodes. The Component Descriptors are discovered at runtime by scanning the class path and searching for @RuleNode annotation. Once discovered, the up to date list of descriptors is persisted to the database.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getComponentDescriptorByClazz", "parameters": [ { - "name": "componentTypes", - "in": "query", - "description": "List of types of the Rule Nodes, (ENRICHMENT, FILTER, TRANSFORMATION, ACTION or EXTERNAL)", + "name": "componentDescriptorClazz", + "in": "path", + "description": "Component Descriptor class name", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "ruleChainType", - "in": "query", - "description": "Type of the Rule Chain", - "required": false, - "schema": { - "type": "string", - "enum": [ - "CORE", - "EDGE" - ] + "type": "string" } } ], @@ -16719,10 +17883,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ComponentDescriptor" - } + "$ref": "#/components/schemas/ComponentDescriptor" } } } @@ -16843,29 +18004,25 @@ ] } }, - "/api/components/{componentType}": { + "/api/components": { "get": { "tags": [ "component-descriptor-controller" ], - "summary": "Get Component Descriptors (getComponentDescriptorsByType)", - "description": "Gets the Component Descriptors using rule node type and optional rule chain type request parameters. Each Component Descriptor represents configuration of specific rule node (e.g. 'Save Timeseries' or 'Send Email'.). The Component Descriptors are used by the rule chain Web UI to build the configuration forms for the rule nodes. The Component Descriptors are discovered at runtime by scanning the class path and searching for @RuleNode annotation. Once discovered, the up to date list of descriptors is persisted to the database.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getComponentDescriptorsByType", + "summary": "Get Component Descriptors (getComponentDescriptorsByTypes)", + "description": "Gets the Component Descriptors using coma separated list of rule node types and optional rule chain type request parameters. Each Component Descriptor represents configuration of specific rule node (e.g. 'Save Timeseries' or 'Send Email'.). The Component Descriptors are used by the rule chain Web UI to build the configuration forms for the rule nodes. The Component Descriptors are discovered at runtime by scanning the class path and searching for @RuleNode annotation. Once discovered, the up to date list of descriptors is persisted to the database.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getComponentDescriptorsByTypes", "parameters": [ { - "name": "componentType", - "in": "path", - "description": "Type of the Rule Node", + "name": "componentTypes", + "in": "query", + "description": "List of types of the Rule Nodes, (ENRICHMENT, FILTER, TRANSFORMATION, ACTION or EXTERNAL)", "required": true, "schema": { - "type": "string", - "enum": [ - "ENRICHMENT", - "FILTER", - "TRANSFORMATION", - "ACTION", - "EXTERNAL" - ] + "type": "array", + "items": { + "type": "string" + } } }, { @@ -17012,64 +18169,55 @@ ] } }, - "/api/customer": { - "post": { + "/api/components/{componentType}": { + "get": { "tags": [ - "customer-controller" + "component-descriptor-controller" ], - "summary": "Create or update Customer (saveCustomer)", - "description": "Creates or Updates the Customer. When creating customer, platform generates Customer Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Customer Id will be present in the response. Specify existing Customer Id to update the Customer. Referencing non-existing Customer Id will cause 'Not Found' error.Remove 'id', 'tenantId' from the request body example (below) to create new Customer entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveCustomer", + "summary": "Get Component Descriptors (getComponentDescriptorsByType)", + "description": "Gets the Component Descriptors using rule node type and optional rule chain type request parameters. Each Component Descriptor represents configuration of specific rule node (e.g. 'Save Timeseries' or 'Send Email'.). The Component Descriptors are used by the rule chain Web UI to build the configuration forms for the rule nodes. The Component Descriptors are discovered at runtime by scanning the class path and searching for @RuleNode annotation. Once discovered, the up to date list of descriptors is persisted to the database.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getComponentDescriptorsByType", "parameters": [ { - "name": "nameConflictPolicy", - "in": "query", - "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", - "required": false, - "schema": { - "$ref": "#/components/schemas/NameConflictPolicy", - "default": "FAIL" - } - }, - { - "name": "uniquifySeparator", - "in": "query", - "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", - "required": false, + "name": "componentType", + "in": "path", + "description": "Type of the Rule Node", + "required": true, "schema": { "type": "string", - "default": "_" + "enum": [ + "ENRICHMENT", + "FILTER", + "TRANSFORMATION", + "ACTION", + "EXTERNAL" + ] } }, { - "name": "uniquifyStrategy", + "name": "ruleChainType", "in": "query", - "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", + "description": "Type of the Rule Chain", "required": false, "schema": { - "$ref": "#/components/schemas/UniquifyStrategy", - "default": "RANDOM" + "type": "string", + "enum": [ + "CORE", + "EDGE" + ] } } ], - "requestBody": { - "description": "A JSON value representing the customer.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Customer" + "type": "array", + "items": { + "$ref": "#/components/schemas/ComponentDescriptor" + } } } } @@ -17086,7 +18234,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -17190,25 +18338,57 @@ ] } }, - "/api/customer/{customerId}": { - "get": { + "/api/customer": { + "post": { "tags": [ "customer-controller" ], - "summary": "Get Customer (getCustomerById)", - "description": "Get the Customer object based on the provided Customer Id. If the user has the authority of 'Tenant Administrator', the server checks that the customer is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the user belongs to the customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getCustomerById", + "summary": "Create or update Customer (saveCustomer)", + "description": "Creates or Updates the Customer. When creating customer, platform generates Customer Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Customer Id will be present in the response. Specify existing Customer Id to update the Customer. Referencing non-existing Customer Id will cause 'Not Found' error.Remove 'id', 'tenantId' from the request body example (below) to create new Customer entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveCustomer", "parameters": [ { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "nameConflictPolicy", + "in": "query", + "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", + "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/NameConflictPolicy", + "default": "FAIL" + } + }, + { + "name": "uniquifySeparator", + "in": "query", + "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", + "required": false, + "schema": { + "type": "string", + "default": "_" + } + }, + { + "name": "uniquifyStrategy", + "in": "query", + "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", + "required": false, + "schema": { + "$ref": "#/components/schemas/UniquifyStrategy", + "default": "RANDOM" } } ], + "requestBody": { + "description": "A JSON value representing the customer.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", @@ -17232,7 +18412,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -17334,14 +18514,16 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/customer/{customerId}": { + "get": { "tags": [ "customer-controller" ], - "summary": "Delete Customer (deleteCustomer)", - "description": "Deletes the Customer and all customer Users. All assigned Dashboards, Assets, Devices, etc. will be unassigned but not deleted. Referencing non-existing Customer Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteCustomer", + "summary": "Get Customer (getCustomerById)", + "description": "Get the Customer object based on the provided Customer Id. If the user has the authority of 'Tenant Administrator', the server checks that the customer is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the user belongs to the customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getCustomerById", "parameters": [ { "name": "customerId", @@ -17355,7 +18537,14 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + } }, "400": { "description": "Bad Request", @@ -17471,16 +18660,14 @@ "ApiKeyForm": [] } ] - } - }, - "/api/customer/{customerId}/shortInfo": { - "get": { + }, + "delete": { "tags": [ "customer-controller" ], - "summary": "Get short Customer info (getShortCustomerInfoById)", - "description": "Get the short customer object that contains only the title and 'isPublic' flag. If the user has the authority of 'Tenant Administrator', the server checks that the customer is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the user belongs to the customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getShortCustomerInfoById", + "summary": "Delete Customer (deleteCustomer)", + "description": "Deletes the Customer and all customer Users. All assigned Dashboards, Assets, Devices, etc. will be unassigned but not deleted. Referencing non-existing Customer Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteCustomer", "parameters": [ { "name": "customerId", @@ -17494,14 +18681,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JsonNode" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -17619,14 +18799,14 @@ ] } }, - "/api/customer/{customerId}/title": { + "/api/customer/{customerId}/shortInfo": { "get": { "tags": [ "customer-controller" ], - "summary": "Get Customer Title (getCustomerTitleById)", - "description": "Get the title of the customer. If the user has the authority of 'Tenant Administrator', the server checks that the customer is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the user belongs to the customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getCustomerTitleById", + "summary": "Get short Customer info (getShortCustomerInfoById)", + "description": "Get the short customer object that contains only the title and 'isPublic' flag. If the user has the authority of 'Tenant Administrator', the server checks that the customer is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the user belongs to the customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getShortCustomerInfoById", "parameters": [ { "name": "customerId", @@ -17642,9 +18822,9 @@ "200": { "description": "OK", "content": { - "application/text": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/JsonNode" } } } @@ -17765,81 +18945,32 @@ ] } }, - "/api/customers": { + "/api/customer/{customerId}/title": { "get": { "tags": [ "customer-controller" ], - "summary": "Get Tenant Customers (getCustomers)", - "description": "Returns a page of customers owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getCustomers", + "summary": "Get Customer Title (getCustomerTitleById)", + "description": "Get the title of the customer. If the user has the authority of 'Tenant Administrator', the server checks that the customer is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the user belongs to the customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getCustomerTitleById", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the customer title.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "title", - "email", - "country", - "city" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { "200": { "description": "OK", "content": { - "application/json": { + "application/text": { "schema": { - "$ref": "#/components/schemas/PageDataCustomer" + "type": "string" } } } @@ -17960,25 +19091,71 @@ ] } }, - "/api/customers/list": { + "/api/customers": { "get": { "tags": [ "customer-controller" ], - "summary": "Get customers by Customer Ids (getCustomersByIds)", - "description": "Returns a list of Customer objects based on the provided ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getCustomersByIds", + "summary": "Get Tenant Customers (getCustomers)", + "description": "Returns a page of customers owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getCustomers", "parameters": [ { - "name": "customerIds", + "name": "pageSize", "in": "query", - "description": "A list of customer ids, separated by comma ','", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the customer title.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "title", + "email", + "country", + "city" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -17988,10 +19165,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Customer" - } + "$ref": "#/components/schemas/PageDataCustomer" } } } @@ -18112,22 +19286,25 @@ ] } }, - "/api/tenant/customers": { + "/api/customers/list": { "get": { "tags": [ "customer-controller" ], - "summary": "Get Tenant Customer by Customer title (getTenantCustomer)", - "description": "Get the Customer using Customer Title. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantCustomer", + "summary": "Get customers by Customer Ids (getCustomersByIds)", + "description": "Returns a list of Customer objects based on the provided ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getCustomersByIds", "parameters": [ { - "name": "customerTitle", + "name": "customerIds", "in": "query", - "description": "A string value representing the Customer title.", + "description": "A list of customer ids, separated by comma ','", "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -18137,7 +19314,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Customer" + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + } } } } @@ -18258,163 +19438,19 @@ ] } }, - "/api/customer/public/dashboard/{dashboardId}": { - "post": { - "tags": [ - "dashboard-controller" - ], - "summary": "Assign the Dashboard to Public Customer (assignDashboardToPublicCustomer)", - "description": "Assigns the dashboard to a special, auto-generated 'Public' Customer. Once assigned, unauthenticated users may browse the dashboard. This method is useful if you like to embed the dashboard on public web pages to be available for users that are not logged in. Be aware that making the dashboard public does not mean that it automatically makes all devices and assets you use in the dashboard to be public.Use [assign Asset to Public Customer](#!/asset-controller/assignAssetToPublicCustomerUsingPOST) and [assign Device to Public Customer](#!/device-controller/assignDeviceToPublicCustomerUsingPOST) for this purpose. Returns the Dashboard object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "assignDashboardToPublicCustomer", - "parameters": [ - { - "name": "dashboardId", - "in": "path", - "description": "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dashboard" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "status": 400, - "message": "Invalid request body", - "errorCode": 31, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "status": 401, - "message": "Authentication failed", - "errorCode": 10, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "status": 403, - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "status": 404, - "message": "Requested item wasn't found!", - "errorCode": 32, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "status": 429, - "message": "Too many requests for current tenant!", - "errorCode": 33, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - }, - "delete": { + "/api/tenant/customers": { + "get": { "tags": [ - "dashboard-controller" + "customer-controller" ], - "summary": "Unassign the Dashboard from Public Customer (unassignDashboardFromPublicCustomer)", - "description": "Unassigns the dashboard from a special, auto-generated 'Public' Customer. Once unassigned, unauthenticated users may no longer browse the dashboard. Returns the Dashboard object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "unassignDashboardFromPublicCustomer", + "summary": "Get Tenant Customer by Customer title (getTenantCustomer)", + "description": "Get the Customer using Customer Title. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantCustomer", "parameters": [ { - "name": "dashboardId", - "in": "path", - "description": "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "customerTitle", + "in": "query", + "description": "A string value representing the Customer title.", "required": true, "schema": { "type": "string" @@ -18427,7 +19463,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Dashboard" + "$ref": "#/components/schemas/Customer" } } } @@ -18548,24 +19584,15 @@ ] } }, - "/api/customer/{customerId}/dashboard/{dashboardId}": { + "/api/customer/public/dashboard/{dashboardId}": { "post": { "tags": [ "dashboard-controller" ], - "summary": "Assign the Dashboard (assignDashboardToCustomer)", - "description": "Assign the Dashboard to specified Customer or do nothing if the Dashboard is already assigned to that Customer. Returns the Dashboard object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "assignDashboardToCustomer", + "summary": "Assign the Dashboard to Public Customer (assignDashboardToPublicCustomer)", + "description": "Assigns the dashboard to a special, auto-generated 'Public' Customer. Once assigned, unauthenticated users may browse the dashboard. This method is useful if you like to embed the dashboard on public web pages to be available for users that are not logged in. Be aware that making the dashboard public does not mean that it automatically makes all devices and assets you use in the dashboard to be public.Use [assign Asset to Public Customer](#!/asset-controller/assignAssetToPublicCustomerUsingPOST) and [assign Device to Public Customer](#!/device-controller/assignDeviceToPublicCustomerUsingPOST) for this purpose. Returns the Dashboard object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "assignDashboardToPublicCustomer", "parameters": [ - { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "dashboardId", "in": "path", @@ -18706,19 +19733,10 @@ "tags": [ "dashboard-controller" ], - "summary": "Unassign the Dashboard (unassignDashboardFromCustomer)", - "description": "Unassign the Dashboard from specified Customer or do nothing if the Dashboard is already assigned to that Customer. Returns the Dashboard object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "unassignDashboardFromCustomer", + "summary": "Unassign the Dashboard from Public Customer (unassignDashboardFromPublicCustomer)", + "description": "Unassigns the dashboard from a special, auto-generated 'Public' Customer. Once unassigned, unauthenticated users may no longer browse the dashboard. Returns the Dashboard object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "unassignDashboardFromPublicCustomer", "parameters": [ - { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "dashboardId", "in": "path", @@ -18856,14 +19874,14 @@ ] } }, - "/api/customer/{customerId}/dashboards": { - "get": { + "/api/customer/{customerId}/dashboard/{dashboardId}": { + "post": { "tags": [ "dashboard-controller" ], - "summary": "Get Customer Dashboards (getCustomerDashboards)", - "description": "Returns a page of dashboard info objects owned by the specified customer. The Dashboard Info object contains lightweight information about the dashboard (e.g. title, image, assigned customers) but does not contain the heavyweight configuration JSON. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getCustomerDashboards", + "summary": "Assign the Dashboard (assignDashboardToCustomer)", + "description": "Assign the Dashboard to specified Customer or do nothing if the Dashboard is already assigned to that Customer. Returns the Dashboard object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "assignDashboardToCustomer", "parameters": [ { "name": "customerId", @@ -18875,68 +19893,13 @@ } }, { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "dashboardId", + "in": "path", + "description": "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "mobile", - "in": "query", - "description": "Exclude dashboards that are hidden for mobile", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the dashboard title.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "title" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -18945,7 +19908,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDashboardInfo" + "$ref": "#/components/schemas/Dashboard" } } } @@ -18962,7 +19925,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -19064,37 +20027,34 @@ "ApiKeyForm": [] } ] - } - }, - "/api/dashboard": { - "post": { + }, + "delete": { "tags": [ "dashboard-controller" ], - "summary": "Create Or Update Dashboard (saveDashboard)", - "description": "Create or update the Dashboard. When creating dashboard, platform generates Dashboard Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Dashboard id will be present in the response. Specify existing Dashboard id to update the dashboard. Referencing non-existing dashboard Id will cause 'Not Found' error. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Dashboard entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveDashboard", + "summary": "Unassign the Dashboard (unassignDashboardFromCustomer)", + "description": "Unassign the Dashboard from specified Customer or do nothing if the Dashboard is already assigned to that Customer. Returns the Dashboard object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "unassignDashboardFromCustomer", "parameters": [ { - "name": "Accept-Encoding", - "in": "header", - "required": false, + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "dashboardId", + "in": "path", + "description": "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "description": "A JSON value representing the dashboard.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dashboard" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", @@ -19118,7 +20078,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "timestamp": 1609459200000 } @@ -19222,27 +20182,99 @@ ] } }, - "/api/dashboard/home": { + "/api/customer/{customerId}/dashboards": { "get": { "tags": [ "dashboard-controller" ], - "summary": "Get Home Dashboard (getHomeDashboard)", - "description": "Returns the home dashboard object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. The Dashboard object is a heavyweight object that contains information about the dashboard (e.g. title, image, assigned customers) and also configuration JSON (e.g. layouts, widgets, entity aliases).\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getHomeDashboard", + "summary": "Get Customer Dashboards (getCustomerDashboards)", + "description": "Returns a page of dashboard info objects owned by the specified customer. The Dashboard Info object contains lightweight information about the dashboard (e.g. title, image, assigned customers) but does not contain the heavyweight configuration JSON. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getCustomerDashboards", "parameters": [ { - "name": "Accept-Encoding", - "in": "header", + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "mobile", + "in": "query", + "description": "Exclude dashboards that are hidden for mobile", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the dashboard title.", "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "title" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataDashboardInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -19360,21 +20392,42 @@ ] } }, - "/api/dashboard/home/info": { - "get": { + "/api/dashboard": { + "post": { "tags": [ "dashboard-controller" ], - "summary": "Get Home Dashboard Info (getHomeDashboardInfo)", - "description": "Returns the home dashboard info object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getHomeDashboardInfo", + "summary": "Create Or Update Dashboard (saveDashboard)", + "description": "Create or update the Dashboard. When creating dashboard, platform generates Dashboard Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Dashboard id will be present in the response. Specify existing Dashboard id to update the dashboard. Referencing non-existing dashboard Id will cause 'Not Found' error. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Dashboard entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveDashboard", + "parameters": [ + { + "name": "Accept-Encoding", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "A JSON value representing the dashboard.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dashboard" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HomeDashboardInfo" + "$ref": "#/components/schemas/Dashboard" } } } @@ -19391,7 +20444,7 @@ "summary": "Bad Request", "value": { "status": 400, - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "timestamp": 1609459200000 } @@ -19495,20 +20548,19 @@ ] } }, - "/api/dashboard/info/{dashboardId}": { + "/api/dashboard/home": { "get": { "tags": [ "dashboard-controller" ], - "summary": "Get Dashboard Info (getDashboardInfoById)", - "description": "Get the information about the dashboard based on 'dashboardId' parameter. The Dashboard Info object contains lightweight information about the dashboard (e.g. title, image, assigned customers) but does not contain the heavyweight configuration JSON.", - "operationId": "getDashboardInfoById", + "summary": "Get Home Dashboard (getHomeDashboard)", + "description": "Returns the home dashboard object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. The Dashboard object is a heavyweight object that contains information about the dashboard (e.g. title, image, assigned customers) and also configuration JSON (e.g. layouts, widgets, entity aliases).\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getHomeDashboard", "parameters": [ { - "name": "dashboardId", - "in": "path", - "description": "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "Accept-Encoding", + "in": "header", + "required": false, "schema": { "type": "string" } @@ -19520,7 +20572,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DashboardInfo" + "$ref": "#/components/schemas/HomeDashboard" } } } @@ -19641,23 +20693,21 @@ ] } }, - "/api/dashboard/maxDatapointsLimit": { + "/api/dashboard/home/info": { "get": { "tags": [ "dashboard-controller" ], - "summary": "Get max data points limit (getMaxDatapointsLimit)", - "description": "Get the maximum number of data points that dashboard may request from the server per in a single subscription command. This value impacts the time window behavior. It impacts 'Max values' parameter in case user selects 'None' as 'Data aggregation function'. It also impacts the 'Grouping interval' in case of any other 'Data aggregation function' is selected. The actual value of the limit is configurable in the system configuration file.", - "operationId": "getMaxDatapointsLimit", + "summary": "Get Home Dashboard Info (getHomeDashboardInfo)", + "description": "Returns the home dashboard info object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getHomeDashboardInfo", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "integer", - "format": "int64", - "example": 5000 + "$ref": "#/components/schemas/HomeDashboardInfo" } } } @@ -19778,23 +20828,32 @@ ] } }, - "/api/dashboard/serverTime": { + "/api/dashboard/info/{dashboardId}": { "get": { "tags": [ "dashboard-controller" ], - "summary": "Get server time (getServerTime)", - "description": "Get the server time (milliseconds since January 1, 1970 UTC). Used to adjust view of the dashboards according to the difference between browser and server time.", - "operationId": "getServerTime", + "summary": "Get Dashboard Info (getDashboardInfoById)", + "description": "Get the information about the dashboard based on 'dashboardId' parameter. The Dashboard Info object contains lightweight information about the dashboard (e.g. title, image, assigned customers) but does not contain the heavyweight configuration JSON.", + "operationId": "getDashboardInfoById", + "parameters": [ + { + "name": "dashboardId", + "in": "path", + "description": "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "integer", - "format": "int64", - "example": 1636023857137 + "$ref": "#/components/schemas/DashboardInfo" } } } @@ -19915,45 +20974,326 @@ ] } }, - "/api/dashboard/{dashboardId}": { + "/api/dashboard/maxDatapointsLimit": { "get": { "tags": [ "dashboard-controller" ], - "summary": "Get Dashboard (getDashboardById)", - "description": "Get the dashboard based on 'dashboardId' parameter. The Dashboard object is a heavyweight object that contains information about the dashboard (e.g. title, image, assigned customers) and also configuration JSON (e.g. layouts, widgets, entity aliases).\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDashboardById", - "parameters": [ - { - "name": "dashboardId", - "in": "path", - "description": "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "includeResources", - "in": "query", - "description": "Export used resources and replace resource links with resource metadata", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "Accept-Encoding", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - } - ], + "summary": "Get max data points limit (getMaxDatapointsLimit)", + "description": "Get the maximum number of data points that dashboard may request from the server per in a single subscription command. This value impacts the time window behavior. It impacts 'Max values' parameter in case user selects 'None' as 'Data aggregation function'. It also impacts the 'Grouping interval' in case of any other 'Data aggregation function' is selected. The actual value of the limit is configurable in the system configuration file.", + "operationId": "getMaxDatapointsLimit", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int64", + "example": 5000 + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/dashboard/serverTime": { + "get": { + "tags": [ + "dashboard-controller" + ], + "summary": "Get server time (getServerTime)", + "description": "Get the server time (milliseconds since January 1, 1970 UTC). Used to adjust view of the dashboards according to the difference between browser and server time.", + "operationId": "getServerTime", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int64", + "example": 1636023857137 + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "status": 400, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "status": 401, + "message": "Authentication failed", + "errorCode": 10, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "status": 403, + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "status": 404, + "message": "Requested item wasn't found!", + "errorCode": 32, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "status": 429, + "message": "Too many requests for current tenant!", + "errorCode": 33, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/dashboard/{dashboardId}": { + "get": { + "tags": [ + "dashboard-controller" + ], + "summary": "Get Dashboard (getDashboardById)", + "description": "Get the dashboard based on 'dashboardId' parameter. The Dashboard object is a heavyweight object that contains information about the dashboard (e.g. title, image, assigned customers) and also configuration JSON (e.g. layouts, widgets, entity aliases).\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDashboardById", + "parameters": [ + { + "name": "dashboardId", + "in": "path", + "description": "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "includeResources", + "in": "query", + "description": "Export used resources and replace resource links with resource metadata", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "Accept-Encoding", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dashboard" + } + } + } }, "400": { "description": "Bad Request", @@ -26779,7 +28119,7 @@ "device-profile-controller" ], "summary": "Create Or Update Device Profile (saveDeviceProfile)", - "description": "Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. \n\nDevice profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant.\n\n# Device profile data definition\n\nDevice profile data object contains alarm rules configuration, device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. \n\n```json\n{\n \"alarms\":[\n ],\n \"configuration\":{\n \"type\":\"DEFAULT\"\n },\n \"provisionConfiguration\":{\n \"type\":\"DISABLED\",\n \"provisionDeviceSecret\":null\n },\n \"transportConfiguration\":{\n \"type\":\"DEFAULT\"\n }\n}\n```\n\n```json\n{\n \"alarms\":[\n {\n \"id\":\"2492b935-1226-59e9-8615-17d8978a4f93\",\n \"alarmType\":\"Temperature Alarm\",\n \"clearRule\":{\n \"schedule\":null,\n \"condition\":{\n \"spec\":{\n \"type\":\"SIMPLE\"\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":30.0,\n \"dynamicValue\":null\n },\n \"operation\":\"LESS\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"propagate\":false,\n \"createRules\":{\n \"MAJOR\":{\n \"schedule\":{\n \"type\":\"SPECIFIC_TIME\",\n \"endsOn\":64800000,\n \"startsOn\":43200000,\n \"timezone\":\"Europe/Kiev\",\n \"daysOfWeek\":[\n 1,\n 3,\n 5\n ]\n },\n \"condition\":{\n \"spec\":{\n \"type\":\"DURATION\",\n \"unit\":\"MINUTES\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":30,\n \"dynamicValue\":null\n }\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"COMPLEX\",\n \"operation\":\"OR\",\n \"predicates\":[\n {\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":50.0,\n \"dynamicValue\":null\n },\n \"operation\":\"LESS_OR_EQUAL\"\n },\n {\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":30.0,\n \"dynamicValue\":null\n },\n \"operation\":\"GREATER\"\n }\n ]\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"WARNING\":{\n \"schedule\":{\n \"type\":\"CUSTOM\",\n \"items\":[\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":1\n },\n {\n \"endsOn\":64800000,\n \"enabled\":true,\n \"startsOn\":43200000,\n \"dayOfWeek\":2\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":3\n },\n {\n \"endsOn\":57600000,\n \"enabled\":true,\n \"startsOn\":36000000,\n \"dayOfWeek\":4\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":5\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":6\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":7\n }\n ],\n \"timezone\":\"Europe/Kiev\"\n },\n \"condition\":{\n \"spec\":{\n \"type\":\"REPEATING\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":5,\n \"dynamicValue\":null\n }\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"tempConstant\",\n \"type\":\"CONSTANT\"\n },\n \"value\":30,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":0.0,\n \"dynamicValue\":{\n \"inherit\":false,\n \"sourceType\":\"CURRENT_DEVICE\",\n \"sourceAttribute\":\"tempThreshold\"\n }\n },\n \"operation\":\"EQUAL\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"CRITICAL\":{\n \"schedule\":null,\n \"condition\":{\n \"spec\":{\n \"type\":\"SIMPLE\"\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":50.0,\n \"dynamicValue\":null\n },\n \"operation\":\"GREATER\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n }\n },\n \"propagateRelationTypes\":null\n }\n ],\n \"configuration\":{\n \"type\":\"DEFAULT\"\n },\n \"provisionConfiguration\":{\n \"type\":\"ALLOW_CREATE_NEW_DEVICES\",\n \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\"\n },\n \"transportConfiguration\":{\n \"type\":\"MQTT\",\n \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\",\n \"deviceAttributesTopic\":\"v1/devices/me/attributes\",\n \"transportPayloadTypeConfiguration\":{\n \"transportPayloadType\":\"PROTOBUF\",\n \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\",\n \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\",\n \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\",\n \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\"\n }\n }\n}\n```\n\nLet's review some specific objects examples related to the device profile configuration:\n\n# Alarm Schedule\n\nAlarm Schedule JSON object represents the time interval during which the alarm rule is active. Note, \n\n```json\n\"schedule\": null\n```\n\nmeans alarm rule is active all the time. **'daysOfWeek'** field represents Monday as 1, Tuesday as 2 and so on. **'startsOn'** and **'endsOn'** fields represent hours in millis (e.g. 64800000 = 18:00 or 6pm). **'enabled'** flag specifies if item in a custom rule is active for specific day of the week:\n\n## Specific Time Schedule\n\n```json\n{\n \"schedule\":{\n \"type\":\"SPECIFIC_TIME\",\n \"endsOn\":64800000,\n \"startsOn\":43200000,\n \"timezone\":\"Europe/Kiev\",\n \"daysOfWeek\":[\n 1,\n 3,\n 5\n ]\n }\n}\n```\n\n## Custom Schedule\n\n```json\n{\n \"schedule\":{\n \"type\":\"CUSTOM\",\n \"items\":[\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":1\n },\n {\n \"endsOn\":64800000,\n \"enabled\":true,\n \"startsOn\":43200000,\n \"dayOfWeek\":2\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":3\n },\n {\n \"endsOn\":57600000,\n \"enabled\":true,\n \"startsOn\":36000000,\n \"dayOfWeek\":4\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":5\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":6\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":7\n }\n ],\n \"timezone\":\"Europe/Kiev\"\n }\n}\n```\n\n# Alarm condition type (**'spec'**)\n\nAlarm condition type can be either simple, duration, or repeating. For example, 5 times in a row or during 5 minutes.\n\nNote, **'userValue'** field is not used and reserved for future usage, **'dynamicValue'** is used for condition appliance by using the value of the **'sourceAttribute'** or else **'defaultValue'** is used (if **'sourceAttribute'** is absent).\n\n**'sourceType'** of the **'sourceAttribute'** can be: \n * 'CURRENT_DEVICE';\n * 'CURRENT_CUSTOMER';\n * 'CURRENT_TENANT'.\n\n**'sourceAttribute'** can be inherited from the owner if **'inherit'** is set to true (for CURRENT_DEVICE and CURRENT_CUSTOMER).\n\n## Repeating alarm condition\n\n```json\n{\n \"spec\":{\n \"type\":\"REPEATING\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":5,\n \"dynamicValue\":{\n \"inherit\":true,\n \"sourceType\":\"CURRENT_DEVICE\",\n \"sourceAttribute\":\"tempAttr\"\n }\n }\n }\n}\n```\n\n## Duration alarm condition\n\n```json\n{\n \"spec\":{\n \"type\":\"DURATION\",\n \"unit\":\"MINUTES\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":30,\n \"dynamicValue\":null\n }\n }\n}\n```\n\n**'unit'** can be: \n * 'SECONDS';\n * 'MINUTES';\n * 'HOURS';\n * 'DAYS'.\n\n# Key Filters\n\nKey filter objects are created under the **'condition'** array. They allow you to define complex logical expressions over entity field, attribute, latest time series value or constant. The filter is defined using 'key', 'valueType', 'value' (refers to the value of the 'CONSTANT' alarm filter key type) and 'predicate' objects. Let's review each object:\n\n## Alarm Filter Key\n\nFilter Key defines either entity field, attribute, telemetry or constant. It is a JSON object that consists the key name and type. The following filter key types are supported:\n * 'ATTRIBUTE' - used for attributes values;\n * 'TIME_SERIES' - used for time series values;\n * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type;\n * 'CONSTANT' - constant value specified.\n\nLet's review the example:\n\n```json\n{\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n}\n```\n\n## Value Type and Operations\n\nProvides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: \n\n * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; \n * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL;\n * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n\n\n\n\n## Filter Predicate\n\nFilter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key.\n\nSimple predicate example to check 'value < 100': \n\n```json\n{\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 100,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nComplex predicate example, to check 'value < 10 or value > 20': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n}\n```\n\nMore complex predicate example, to check 'value < 10 or (value > 50 && value < 60)': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"type\": \"COMPLEX\",\n \"operation\": \"AND\",\n \"predicates\": [\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 50,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 60,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n }\n ]\n}\n```\n\nYou may also want to replace hardcoded values (for example, temperature > 20) with the more dynamic expression (for example, temperature > value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or device. See example below:\n\n```json\n{\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"inherit\": false,\n \"sourceType\": \"CURRENT_TENANT\",\n \"sourceAttribute\": \"temperatureThreshold\"\n }\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nNote that you may use 'CURRENT_DEVICE', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source. The 'sourceAttribute' can be inherited from the owner of the specified 'sourceType' if 'inherit' is set to true.\n\n# Provision Configuration\n\nThere are 3 types of device provision configuration for the device profile: \n * 'DISABLED';\n * 'ALLOW_CREATE_NEW_DEVICES';\n * 'CHECK_PRE_PROVISIONED_DEVICES'.\n\nPlease refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details.\n\n# Transport Configuration\n\n5 transport configuration types are available:\n * 'DEFAULT';\n * 'MQTT';\n * 'LWM2M';\n * 'COAP';\n * 'SNMP'.\n\nDefault type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types.\n\nSee another example of COAP transport configuration below:\n\n```json\n{\n \"type\":\"COAP\",\n \"clientSettings\":{\n \"edrxCycle\":null,\n \"powerMode\":\"DRX\",\n \"psmActivityTimer\":null,\n \"pagingTransmissionWindow\":null\n },\n \"coapDeviceTypeConfiguration\":{\n \"coapDeviceType\":\"DEFAULT\",\n \"transportPayloadTypeConfiguration\":{\n \"transportPayloadType\":\"JSON\"\n }\n }\n}\n```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "description": "Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. \n\nDevice profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant.\n\n# Device profile data definition\n\nDevice profile data object contains device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. \n\n```json\n{\n \"configuration\":{\n \"type\":\"DEFAULT\"\n },\n \"provisionConfiguration\":{\n \"type\":\"DISABLED\",\n \"provisionDeviceSecret\":null\n },\n \"transportConfiguration\":{\n \"type\":\"DEFAULT\"\n }\n}\n```\n\n```json\n{\n \"configuration\":{\n \"type\":\"DEFAULT\"\n },\n \"provisionConfiguration\":{\n \"type\":\"ALLOW_CREATE_NEW_DEVICES\",\n \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\"\n },\n \"transportConfiguration\":{\n \"type\":\"MQTT\",\n \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\",\n \"deviceAttributesTopic\":\"v1/devices/me/attributes\",\n \"transportPayloadTypeConfiguration\":{\n \"transportPayloadType\":\"PROTOBUF\",\n \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\",\n \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\",\n \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\",\n \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\"\n }\n }\n}\n```\n\nLet's review some specific objects examples related to the device profile configuration:# Provision Configuration\n\nThere are 3 types of device provision configuration for the device profile: \n * 'DISABLED';\n * 'ALLOW_CREATE_NEW_DEVICES';\n * 'CHECK_PRE_PROVISIONED_DEVICES'.\n\nPlease refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details.\n\n# Transport Configuration\n\n5 transport configuration types are available:\n * 'DEFAULT';\n * 'MQTT';\n * 'LWM2M';\n * 'COAP';\n * 'SNMP'.\n\nDefault type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types.\n\nSee another example of COAP transport configuration below:\n\n```json\n{\n \"type\":\"COAP\",\n \"clientSettings\":{\n \"edrxCycle\":null,\n \"powerMode\":\"DRX\",\n \"psmActivityTimer\":null,\n \"pagingTransmissionWindow\":null\n },\n \"coapDeviceTypeConfiguration\":{\n \"coapDeviceType\":\"DEFAULT\",\n \"transportPayloadTypeConfiguration\":{\n \"transportPayloadType\":\"JSON\"\n }\n }\n}\n```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", "operationId": "saveDeviceProfile", "requestBody": { "content": { @@ -57268,11 +58608,11 @@ } ], "requestBody": { + "description": "A JSON object representing the RPC request.", "content": { - "application/json": { + "text/plain": { "schema": { - "type": "string", - "description": "A JSON value representing the RPC request." + "type": "string" } } }, @@ -57425,11 +58765,11 @@ } ], "requestBody": { + "description": "A JSON object representing the RPC request.", "content": { - "application/json": { + "text/plain": { "schema": { - "type": "string", - "description": "A JSON value representing the RPC request." + "type": "string" } } }, @@ -57582,11 +58922,11 @@ } ], "requestBody": { + "description": "A JSON object representing the RPC request.", "content": { - "application/json": { + "text/plain": { "schema": { - "type": "string", - "description": "A JSON value representing the RPC request." + "type": "string" } } }, @@ -58241,11 +59581,11 @@ } ], "requestBody": { + "description": "A JSON object representing the RPC request.", "content": { - "application/json": { + "text/plain": { "schema": { - "type": "string", - "description": "A JSON value representing the RPC request." + "type": "string" } } }, @@ -61889,11 +63229,11 @@ "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses current User Id ( the one which credentials is used to perform the request) as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", "operationId": "handleRuleEngineRequestForUser", "requestBody": { + "description": "A JSON object representing the message.", "content": { - "application/json": { + "text/plain": { "schema": { - "type": "string", - "description": "A JSON value representing the message." + "type": "string" } } }, @@ -62055,11 +63395,11 @@ } ], "requestBody": { + "description": "A JSON object representing the message.", "content": { - "application/json": { + "text/plain": { "schema": { - "type": "string", - "description": "A JSON value representing the message." + "type": "string" } } }, @@ -62240,11 +63580,11 @@ } ], "requestBody": { + "description": "A JSON object representing the message.", "content": { - "application/json": { + "text/plain": { "schema": { - "type": "string", - "description": "A JSON value representing the message." + "type": "string" } } }, @@ -62416,11 +63756,11 @@ } ], "requestBody": { + "description": "A JSON object representing the message.", "content": { - "application/json": { + "text/plain": { "schema": { - "type": "string", - "description": "A JSON value representing the message." + "type": "string" } } }, @@ -65735,7 +67075,7 @@ "requestBody": { "description": "A string value representing the json object. For example, '{\"key\":\"value\"}'. See API call description for more details.", "content": { - "application/json": { + "text/plain": { "schema": { "type": "string" } @@ -66068,7 +67408,7 @@ "requestBody": { "description": "A string value representing the json object. For example, '{\"key\":\"value\"}'. See API call description for more details.", "content": { - "application/json": { + "text/plain": { "schema": { "type": "string" } @@ -66935,7 +68275,7 @@ "requestBody": { "description": "A JSON with the telemetry values. See API call description for more details.", "content": { - "application/json": { + "text/plain": { "schema": { "type": "string" } @@ -67111,7 +68451,7 @@ "requestBody": { "description": "A JSON with the telemetry values. See API call description for more details.", "content": { - "application/json": { + "text/plain": { "schema": { "type": "string" } @@ -68125,7 +69465,7 @@ "requestBody": { "description": "A string value representing the json object. For example, '{\"key\":\"value\"}'. See API call description for more details.", "content": { - "application/json": { + "text/plain": { "schema": { "type": "string" } @@ -81239,21 +82579,6 @@ "OTHER" ] }, - "AlarmCondition": { - "type": "object", - "properties": { - "condition": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AlarmConditionFilter" - } - }, - "spec": { - "$ref": "#/components/schemas/AlarmConditionSpec", - "description": "JSON object representing alarm condition type" - } - } - }, "AlarmConditionExpression": { "discriminator": { "propertyName": "type", @@ -81271,70 +82596,6 @@ "type" ] }, - "AlarmConditionFilter": { - "type": "object", - "properties": { - "valueType": { - "$ref": "#/components/schemas/EntityKeyValueType", - "description": "String representation of the type of the value", - "example": "NUMERIC" - }, - "key": { - "$ref": "#/components/schemas/AlarmConditionFilterKey", - "description": "JSON object for specifying alarm condition by specific key" - }, - "predicate": { - "$ref": "#/components/schemas/KeyFilterPredicate", - "description": "JSON object representing filter condition" - }, - "value": { - "description": "Value used in Constant comparison. For other types, such as TIME_SERIES or ATTRIBUTE, the predicate condition is used" - } - } - }, - "AlarmConditionFilterKey": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/AlarmConditionKeyType", - "description": "The key type", - "example": "TIME_SERIES" - }, - "key": { - "type": "string", - "description": "String value representing the key", - "example": "temp" - } - } - }, - "AlarmConditionKeyType": { - "type": "string", - "enum": [ - "ATTRIBUTE", - "TIME_SERIES", - "ENTITY_FIELD", - "CONSTANT" - ] - }, - "AlarmConditionSpec": { - "description": "Specification for alarm conditions", - "discriminator": { - "propertyName": "type", - "mapping": { - "SIMPLE": "#/components/schemas/SimpleAlarmConditionSpec", - "DURATION": "#/components/schemas/DurationAlarmConditionSpec", - "REPEATING": "#/components/schemas/RepeatingAlarmConditionSpec" - } - }, - "properties": { - "type": { - "type": "string" - } - }, - "required": [ - "type" - ] - }, "AlarmConditionValueAlarmRuleSchedule": { "type": "object", "properties": { @@ -81912,27 +83173,6 @@ "notifyOn" ] }, - "AlarmRule": { - "type": "object", - "properties": { - "condition": { - "$ref": "#/components/schemas/AlarmCondition", - "description": "JSON object representing the alarm rule condition" - }, - "alarmDetails": { - "type": "string", - "description": "String value representing the additional details for an alarm rule" - }, - "dashboardId": { - "$ref": "#/components/schemas/DashboardId", - "description": "JSON object with the dashboard Id representing the reference to alarm details dashboard used by mobile application" - }, - "schedule": { - "$ref": "#/components/schemas/AlarmSchedule", - "description": "JSON object representing time interval during which the rule is active" - } - } - }, "AlarmRuleAnyTimeSchedule": { "allOf": [ { @@ -82094,6 +83334,67 @@ "condition" ] }, + "AlarmRuleDefinitionInfo": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/CalculatedFieldId", + "description": "JSON object with the Alarm Rule Id. Referencing non-existing Alarm Rule Id will cause error." + }, + "createdTime": { + "type": "integer", + "format": "int64", + "description": "Timestamp of the alarm rule creation, in milliseconds", + "example": 1609459200000, + "readOnly": true + }, + "tenantId": { + "$ref": "#/components/schemas/TenantId" + }, + "entityId": { + "$ref": "#/components/schemas/EntityId" + }, + "name": { + "type": "string", + "description": "User defined name of the alarm rule." + }, + "debugSettings": { + "$ref": "#/components/schemas/DebugSettings", + "description": "Debug settings object." + }, + "configurationVersion": { + "type": "integer", + "format": "int32", + "description": "Version of alarm rule configuration.", + "example": 0 + }, + "configuration": { + "$ref": "#/components/schemas/AlarmCalculatedFieldConfiguration" + }, + "version": { + "type": "integer", + "format": "int64" + }, + "additionalInfo": { + "$ref": "#/components/schemas/JsonNode", + "description": "Additional parameters of the alarm rule. May include: 'description' (string).", + "example": { + "description": "High temperature alarm rule" + } + }, + "entityName": { + "type": "string" + }, + "debugMode": { + "type": "boolean", + "deprecated": true, + "writeOnly": true + } + }, + "required": [ + "configuration" + ] + }, "AlarmRuleDurationCondition": { "allOf": [ { @@ -82280,34 +83581,6 @@ "value" ] }, - "AlarmSchedule": { - "type": "object", - "description": "Configuration for alarm schedule", - "discriminator": { - "propertyName": "type", - "mapping": { - "ANY_TIME": "#/components/schemas/AnyTimeSchedule", - "SPECIFIC_TIME": "#/components/schemas/SpecificTimeSchedule", - "CUSTOM": "#/components/schemas/CustomTimeSchedule" - } - }, - "properties": { - "dynamicValue": { - "$ref": "#/components/schemas/DynamicValueString" - }, - "type": { - "$ref": "#/components/schemas/AlarmScheduleType" - } - } - }, - "AlarmScheduleType": { - "type": "string", - "enum": [ - "ANY_TIME", - "SPECIFIC_TIME", - "CUSTOM" - ] - }, "AlarmSearchStatus": { "type": "string", "enum": [ @@ -82580,13 +83853,6 @@ "apiKey" ] }, - "AnyTimeSchedule": { - "allOf": [ - { - "$ref": "#/components/schemas/AlarmSchedule" - } - ] - }, "ApiFeature": { "type": "string", "enum": [ @@ -83065,8 +84331,8 @@ "type": "object", "properties": { "id": { - "$ref": "#/components/schemas/EntityId", - "description": "JSON object with the entity Id. " + "$ref": "#/components/schemas/AssetProfileId", + "description": "JSON object with the Asset Profile Id." }, "name": { "type": "string", @@ -84604,47 +85870,6 @@ } ] }, - "CustomTimeSchedule": { - "allOf": [ - { - "$ref": "#/components/schemas/AlarmSchedule" - }, - { - "type": "object", - "properties": { - "timezone": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomTimeScheduleItem" - } - } - } - } - ] - }, - "CustomTimeScheduleItem": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "dayOfWeek": { - "type": "integer", - "format": "int32" - }, - "startsOn": { - "type": "integer", - "format": "int64" - }, - "endsOn": { - "type": "integer", - "format": "int64" - } - } - }, "Customer": { "type": "object", "properties": { @@ -84729,7 +85954,6 @@ } }, "required": [ - "email", "title" ] }, @@ -85507,7 +86731,7 @@ }, "deviceProfileId": { "$ref": "#/components/schemas/DeviceProfileId", - "description": "JSON object with Device Profile Id." + "description": "JSON object with Device Profile Id. If not provided, the type will be used to determine the profile. If neither deviceProfileId nor type is specified, the default device profile will be used." }, "firmwareId": { "$ref": "#/components/schemas/OtaPackageId", @@ -85536,7 +86760,6 @@ } }, "required": [ - "deviceProfileId", "name" ] }, @@ -85782,7 +87005,7 @@ }, "deviceProfileId": { "$ref": "#/components/schemas/DeviceProfileId", - "description": "JSON object with Device Profile Id." + "description": "JSON object with Device Profile Id. If not provided, the type will be used to determine the profile. If neither deviceProfileId nor type is specified, the default device profile will be used." }, "firmwareId": { "$ref": "#/components/schemas/OtaPackageId", @@ -85831,7 +87054,6 @@ } }, "required": [ - "deviceProfileId", "name" ] }, @@ -85922,54 +87144,6 @@ } } }, - "DeviceProfileAlarm": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "String value representing the alarm rule id", - "example": "highTemperatureAlarmID" - }, - "alarmType": { - "type": "string", - "description": "String value representing type of the alarm", - "example": "High Temperature Alarm" - }, - "createRules": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/AlarmRule" - }, - "description": "Complex JSON object representing create alarm rules. The unique create alarm rule can be created for each alarm severity type. There can be 5 create alarm rules configured per a single alarm type. See method implementation notes and AlarmRule model for more details" - }, - "clearRule": { - "$ref": "#/components/schemas/AlarmRule", - "description": "JSON object representing clear alarm rule" - }, - "propagate": { - "type": "boolean", - "description": "Propagation flag to specify if alarm should be propagated to parent entities of alarm originator", - "example": true - }, - "propagateToOwner": { - "type": "boolean", - "description": "Propagation flag to specify if alarm should be propagated to the owner (tenant or customer) of alarm originator", - "example": true - }, - "propagateToTenant": { - "type": "boolean", - "description": "Propagation flag to specify if alarm should be propagated to the tenant entity", - "example": true - }, - "propagateRelationTypes": { - "type": "array", - "description": "JSON array of relation types that should be used for propagation. By default, 'propagateRelationTypes' array is empty which means that the alarm will be propagated based on any relation type to parent entities. This parameter should be used only in case when 'propagate' parameter is set to true, otherwise, 'propagateRelationTypes' array will be ignored.", - "items": { - "type": "string" - } - } - } - }, "DeviceProfileConfiguration": { "description": "Device profile configuration", "discriminator": { @@ -86001,12 +87175,6 @@ "provisionConfiguration": { "$ref": "#/components/schemas/DeviceProfileProvisionConfiguration", "description": "JSON object of provisioning strategy type per device profile" - }, - "alarms": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DeviceProfileAlarm" - } } } }, @@ -86032,8 +87200,8 @@ "type": "object", "properties": { "id": { - "$ref": "#/components/schemas/EntityId", - "description": "JSON object with the entity Id. " + "$ref": "#/components/schemas/DeviceProfileId", + "description": "JSON object with the Device Profile Id." }, "name": { "type": "string", @@ -86431,27 +87599,6 @@ } ] }, - "DurationAlarmConditionSpec": { - "allOf": [ - { - "$ref": "#/components/schemas/AlarmConditionSpec" - }, - { - "type": "object", - "properties": { - "unit": { - "$ref": "#/components/schemas/TimeUnit", - "description": "Duration time unit" - }, - "predicate": { - "$ref": "#/components/schemas/FilterPredicateValueLong", - "description": "Duration predicate" - } - } - } - ], - "description": "Duration Alarm Condition Specification" - }, "DynamicValueBoolean": { "type": "object", "properties": { @@ -86487,42 +87634,6 @@ } } }, - "DynamicValueInteger": { - "type": "object", - "properties": { - "resolvedValue": { - "type": "integer", - "format": "int32" - }, - "sourceType": { - "$ref": "#/components/schemas/DynamicValueSourceType" - }, - "sourceAttribute": { - "type": "string" - }, - "inherit": { - "type": "boolean" - } - } - }, - "DynamicValueLong": { - "type": "object", - "properties": { - "resolvedValue": { - "type": "integer", - "format": "int64" - }, - "sourceType": { - "$ref": "#/components/schemas/DynamicValueSourceType" - }, - "sourceAttribute": { - "type": "string" - }, - "inherit": { - "type": "boolean" - } - } - }, "DynamicValueSourceType": { "type": "string", "enum": [ @@ -88452,38 +89563,6 @@ } } }, - "FilterPredicateValueInteger": { - "type": "object", - "properties": { - "defaultValue": { - "type": "integer", - "format": "int32" - }, - "userValue": { - "type": "integer", - "format": "int32" - }, - "dynamicValue": { - "$ref": "#/components/schemas/DynamicValueInteger" - } - } - }, - "FilterPredicateValueLong": { - "type": "object", - "properties": { - "defaultValue": { - "type": "integer", - "format": "int64" - }, - "userValue": { - "type": "integer", - "format": "int64" - }, - "dynamicValue": { - "$ref": "#/components/schemas/DynamicValueLong" - } - } - }, "FilterPredicateValueString": { "type": "object", "properties": { @@ -88895,6 +89974,82 @@ "id": {} } }, + "HomeDashboard": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/DashboardId", + "description": "JSON object with the dashboard Id. Specify existing dashboard Id to update the dashboard. Referencing non-existing dashboard id will cause error. Omit this field to create new dashboard." + }, + "createdTime": { + "type": "integer", + "format": "int64", + "description": "Timestamp of the dashboard creation, in milliseconds", + "example": 1609459200000, + "readOnly": true + }, + "tenantId": { + "$ref": "#/components/schemas/TenantId", + "description": "JSON object with Tenant Id. Tenant Id of the dashboard can't be changed.", + "readOnly": true + }, + "title": { + "type": "string", + "description": "Title of the dashboard." + }, + "name": { + "type": "string", + "description": "Same as title of the dashboard. Read-only field. Update the 'title' to change the 'name' of the dashboard.", + "readOnly": true + }, + "image": { + "type": "string", + "description": "Thumbnail picture for rendering of the dashboards in a grid view on mobile devices.", + "readOnly": true + }, + "mobileHide": { + "type": "boolean", + "description": "Hide dashboard from mobile devices. Useful if the dashboard is not designed for small screens.", + "readOnly": true + }, + "mobileOrder": { + "type": "integer", + "format": "int32", + "description": "Order on mobile devices. Useful to adjust sorting of the dashboards for mobile applications", + "readOnly": true + }, + "assignedCustomers": { + "type": "array", + "description": "List of assigned customers with their info.", + "items": { + "$ref": "#/components/schemas/ShortCustomerInfo" + }, + "readOnly": true, + "uniqueItems": true + }, + "configuration": { + "$ref": "#/components/schemas/JsonNode", + "description": "JSON object with main configuration of the dashboard: layouts, widgets, aliases, etc. The JSON structure of the dashboard configuration is quite complex. The easiest way to learn it is to export existing dashboard to JSON." + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ResourceExportData" + } + }, + "version": { + "type": "integer", + "format": "int64" + }, + "hideDashboardToolbar": { + "type": "boolean", + "description": "Hide dashboard toolbar flag. Useful for rendering dashboards on mobile." + } + }, + "required": [ + "title" + ] + }, "HomeDashboardInfo": { "type": "object", "description": "A JSON object that represents home dashboard id and other parameters", @@ -92351,6 +93506,66 @@ } } }, + "PageDataAlarmRuleDefinition": { + "type": "object", + "properties": { + "data": { + "type": "array", + "description": "Array of the entities", + "items": { + "$ref": "#/components/schemas/AlarmRuleDefinition" + }, + "readOnly": true + }, + "totalPages": { + "type": "integer", + "format": "int32", + "description": "Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria", + "readOnly": true + }, + "totalElements": { + "type": "integer", + "format": "int64", + "description": "Total number of elements in all available pages", + "readOnly": true + }, + "hasNext": { + "type": "boolean", + "description": "'false' value indicates the end of the result set", + "readOnly": true + } + } + }, + "PageDataAlarmRuleDefinitionInfo": { + "type": "object", + "properties": { + "data": { + "type": "array", + "description": "Array of the entities", + "items": { + "$ref": "#/components/schemas/AlarmRuleDefinitionInfo" + }, + "readOnly": true + }, + "totalPages": { + "type": "integer", + "format": "int32", + "description": "Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria", + "readOnly": true + }, + "totalElements": { + "type": "integer", + "format": "int64", + "description": "Total number of elements in all available pages", + "readOnly": true + }, + "hasNext": { + "type": "boolean", + "description": "'false' value indicates the end of the result set", + "readOnly": true + } + } + }, "PageDataApiKeyInfo": { "type": "object", "properties": { @@ -94521,22 +95736,6 @@ } } }, - "RepeatingAlarmConditionSpec": { - "allOf": [ - { - "$ref": "#/components/schemas/AlarmConditionSpec" - }, - { - "type": "object", - "properties": { - "predicate": { - "$ref": "#/components/schemas/FilterPredicateValueInteger", - "description": "Repeating predicate" - } - } - } - ] - }, "RepositoryAuthMethod": { "type": "string", "enum": [ @@ -95035,6 +96234,13 @@ "items": { "$ref": "#/components/schemas/RuleChainConnectionInfo" } + }, + "notes": { + "type": "array", + "description": "List of sticky notes placed on the rule chain canvas", + "items": { + "$ref": "#/components/schemas/RuleChainNote" + } } }, "required": [ @@ -95045,6 +96251,60 @@ "ruleChainId" ] }, + "RuleChainNote": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of the note on the canvas" + }, + "x": { + "type": "integer", + "format": "int32", + "description": "Horizontal position of the note on the canvas, in pixels" + }, + "y": { + "type": "integer", + "format": "int32", + "description": "Vertical position of the note on the canvas, in pixels" + }, + "width": { + "type": "integer", + "format": "int32", + "description": "Width of the note, in pixels" + }, + "height": { + "type": "integer", + "format": "int32", + "description": "Height of the note, in pixels" + }, + "content": { + "type": "string", + "description": "Markdown or HTML content of the note" + }, + "backgroundColor": { + "type": "string", + "description": "Background color of the note in CSS hex format, e.g. '#FFF9C4'" + }, + "borderColor": { + "type": "string", + "description": "Border color of the note in CSS hex format, e.g. '#E6C800'" + }, + "borderWidth": { + "type": "integer", + "format": "int32", + "description": "Border width of the note in pixels" + }, + "applyDefaultMarkdownStyle": { + "type": "boolean", + "description": "Whether to apply the default markdown stylesheet to the note content" + }, + "markdownCss": { + "type": "string", + "description": "Custom CSS styles applied to the note content" + } + } + }, "RuleChainOutputLabelsUsage": { "type": "object", "properties": { @@ -95542,7 +96802,7 @@ "type": "string", "description": "Title of the customer." }, - "isPublic": { + "public": { "type": "boolean", "description": "Indicates special 'Public' customer used to embed dashboards on public websites." } @@ -95573,13 +96833,6 @@ "filters" ] }, - "SimpleAlarmConditionSpec": { - "allOf": [ - { - "$ref": "#/components/schemas/AlarmConditionSpec" - } - ] - }, "SimpleCalculatedFieldConfiguration": { "allOf": [ { @@ -96043,37 +97296,6 @@ "V3" ] }, - "SpecificTimeSchedule": { - "allOf": [ - { - "$ref": "#/components/schemas/AlarmSchedule" - }, - { - "type": "object", - "properties": { - "timezone": { - "type": "string" - }, - "daysOfWeek": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "uniqueItems": true - }, - "startsOn": { - "type": "integer", - "format": "int64" - }, - "endsOn": { - "type": "integer", - "format": "int64" - } - } - } - ] - }, "StarredDashboardInfo": { "type": "object", "properties": { diff --git a/ce/src/main/java/org/thingsboard/client/api/ThingsboardApi.java b/ce/src/main/java/org/thingsboard/client/api/ThingsboardApi.java index df99fccc..90d16a35 100644 --- a/ce/src/main/java/org/thingsboard/client/api/ThingsboardApi.java +++ b/ce/src/main/java/org/thingsboard/client/api/ThingsboardApi.java @@ -31,6 +31,7 @@ import org.thingsboard.client.model.AlarmCountQuery; import org.thingsboard.client.model.AlarmDataQuery; import org.thingsboard.client.model.AlarmInfo; +import org.thingsboard.client.model.AlarmRuleDefinition; import org.thingsboard.client.model.AlarmSeverity; import org.thingsboard.client.model.ApiKey; import org.thingsboard.client.model.ApiKeyInfo; @@ -86,6 +87,7 @@ import org.thingsboard.client.model.EventFilter; import org.thingsboard.client.model.FeaturesInfo; import java.io.File; +import org.thingsboard.client.model.HomeDashboard; import org.thingsboard.client.model.HomeDashboardInfo; import org.thingsboard.client.model.Job; import org.thingsboard.client.model.JobStatus; @@ -123,6 +125,8 @@ import org.thingsboard.client.model.PageDataAlarmCommentInfo; import org.thingsboard.client.model.PageDataAlarmData; import org.thingsboard.client.model.PageDataAlarmInfo; +import org.thingsboard.client.model.PageDataAlarmRuleDefinition; +import org.thingsboard.client.model.PageDataAlarmRuleDefinitionInfo; import org.thingsboard.client.model.PageDataApiKeyInfo; import org.thingsboard.client.model.PageDataAsset; import org.thingsboard.client.model.PageDataAssetInfo; @@ -3697,6 +3701,79 @@ private HttpRequest.Builder deleteAlarmCommentRequestBuilder(@Nonnull String ala return localVarRequestBuilder; } + /** + * Delete Alarm Rule (deleteAlarmRule) + * Deletes the alarm rule. Referencing non-existing Alarm Rule Id will cause an error. Available for users with 'TENANT_ADMIN' authority. + * @param alarmRuleId (required) + * @throws ApiException if fails to make API call + */ + public void deleteAlarmRule(@Nonnull String alarmRuleId) throws ApiException { + deleteAlarmRuleWithHttpInfo(alarmRuleId, null); + } + + /** + * Delete Alarm Rule (deleteAlarmRule) + * Deletes the alarm rule. Referencing non-existing Alarm Rule Id will cause an error. Available for users with 'TENANT_ADMIN' authority. + * @param alarmRuleId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteAlarmRuleWithHttpInfo(@Nonnull String alarmRuleId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteAlarmRuleRequestBuilder(alarmRuleId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteAlarmRule", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteAlarmRuleRequestBuilder(@Nonnull String alarmRuleId, Map headers) throws ApiException { + // verify the required parameter 'alarmRuleId' is set + if (alarmRuleId == null) { + throw new ApiException(400, "Missing the required parameter 'alarmRuleId' when calling deleteAlarmRule"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/alarm/rule/{alarmRuleId}" + .replace("{alarmRuleId}", ApiClient.urlEncode(alarmRuleId.toString())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** * Delete API key by ID (deleteApiKey) * Deletes the API key. Referencing non-existing ApiKey Id will cause an error. Available for any authorized user. @@ -11005,33 +11082,110 @@ private HttpRequest.Builder getAlarmInfoByIdRequestBuilder(@Nonnull String alarm } /** - * Get Alarm Types (getAlarmTypes) - * Returns a set of unique alarm types based on alarms that are either owned by the tenant or assigned to the customer which user is performing the request. + * Get Alarm Rule (getAlarmRuleById) + * Fetch the Alarm Rule object based on the provided Alarm Rule Id. Available for users with 'TENANT_ADMIN' authority. + * @param alarmRuleId (required) + * @return AlarmRuleDefinition + * @throws ApiException if fails to make API call + */ + public AlarmRuleDefinition getAlarmRuleById(@Nonnull String alarmRuleId) throws ApiException { + ApiResponse localVarResponse = getAlarmRuleByIdWithHttpInfo(alarmRuleId, null); + return localVarResponse.getData(); + } + + /** + * Get Alarm Rule (getAlarmRuleById) + * Fetch the Alarm Rule object based on the provided Alarm Rule Id. Available for users with 'TENANT_ADMIN' authority. + * @param alarmRuleId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<AlarmRuleDefinition> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAlarmRuleByIdWithHttpInfo(@Nonnull String alarmRuleId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAlarmRuleByIdRequestBuilder(alarmRuleId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getAlarmRuleById", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + String responseBody = new String(localVarResponseBody.readAllBytes()); + AlarmRuleDefinition responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAlarmRuleByIdRequestBuilder(@Nonnull String alarmRuleId, Map headers) throws ApiException { + // verify the required parameter 'alarmRuleId' is set + if (alarmRuleId == null) { + throw new ApiException(400, "Missing the required parameter 'alarmRuleId' when calling getAlarmRuleById"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/alarm/rule/{alarmRuleId}" + .replace("{alarmRuleId}", ApiClient.urlEncode(alarmRuleId.toString())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get alarm rule names (getAlarmRuleNames) + * Fetch the list of alarm rule names. Available for users with 'TENANT_ADMIN' authority. * @param pageSize Maximum amount of entities in a one page (required) * @param page Sequence number of page starting from 0 (required) - * @param textSearch The case insensitive 'substring' filter based on of next alarm fields: type, severity or status (optional) + * @param textSearch The case insensitive 'substring' filter based on the calculated field name. (optional) * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) - * @return PageDataEntitySubtype + * @return PageDataString * @throws ApiException if fails to make API call */ - public PageDataEntitySubtype getAlarmTypes(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder) throws ApiException { - ApiResponse localVarResponse = getAlarmTypesWithHttpInfo(pageSize, page, textSearch, sortOrder, null); + public PageDataString getAlarmRuleNames(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder) throws ApiException { + ApiResponse localVarResponse = getAlarmRuleNamesWithHttpInfo(pageSize, page, textSearch, sortOrder, null); return localVarResponse.getData(); } /** - * Get Alarm Types (getAlarmTypes) - * Returns a set of unique alarm types based on alarms that are either owned by the tenant or assigned to the customer which user is performing the request. + * Get alarm rule names (getAlarmRuleNames) + * Fetch the list of alarm rule names. Available for users with 'TENANT_ADMIN' authority. * @param pageSize Maximum amount of entities in a one page (required) * @param page Sequence number of page starting from 0 (required) - * @param textSearch The case insensitive 'substring' filter based on of next alarm fields: type, severity or status (optional) + * @param textSearch The case insensitive 'substring' filter based on the calculated field name. (optional) * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) * @param headers Optional headers to include in the request - * @return ApiResponse<PageDataEntitySubtype> + * @return ApiResponse<PageDataString> * @throws ApiException if fails to make API call */ - public ApiResponse getAlarmTypesWithHttpInfo(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getAlarmTypesRequestBuilder(pageSize, page, textSearch, sortOrder, headers); + public ApiResponse getAlarmRuleNamesWithHttpInfo(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAlarmRuleNamesRequestBuilder(pageSize, page, textSearch, sortOrder, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -11042,15 +11196,15 @@ public ApiResponse getAlarmTypesWithHttpInfo(@Nonnull Int InputStream localVarResponseBody = null; try { if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getAlarmTypes", localVarResponse); + throw getApiException("getAlarmRuleNames", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); if (localVarResponseBody == null) { - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } String responseBody = new String(localVarResponseBody.readAllBytes()); - PageDataEntitySubtype responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + PageDataString responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); } finally { if (localVarResponseBody != null) { localVarResponseBody.close(); @@ -11065,17 +11219,17 @@ public ApiResponse getAlarmTypesWithHttpInfo(@Nonnull Int } } - private HttpRequest.Builder getAlarmTypesRequestBuilder(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder, Map headers) throws ApiException { + private HttpRequest.Builder getAlarmRuleNamesRequestBuilder(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder, Map headers) throws ApiException { // verify the required parameter 'pageSize' is set if (pageSize == null) { - throw new ApiException(400, "Missing the required parameter 'pageSize' when calling getAlarmTypes"); + throw new ApiException(400, "Missing the required parameter 'pageSize' when calling getAlarmRuleNames"); } // verify the required parameter 'page' is set if (page == null) { - throw new ApiException(400, "Missing the required parameter 'page' when calling getAlarmTypes"); + throw new ApiException(400, "Missing the required parameter 'page' when calling getAlarmRuleNames"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/api/alarm/types"; + String localVarPath = "/api/alarm/rules/names"; List localVarQueryParams = new ArrayList<>(); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; @@ -11111,51 +11265,157 @@ private HttpRequest.Builder getAlarmTypesRequestBuilder(@Nonnull Integer pageSiz } /** - * Get Alarms (getAlarmsByEntity) - * Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * Get alarm rules (getAlarmRules) + * Fetch tenant alarm rules based on the filter. Available for users with 'TENANT_ADMIN' authority. + * @param pageSize Maximum amount of entities in a one page (required) + * @param page Sequence number of page starting from 0 (required) + * @param entityType Entity type filter. If not specified, alarm rules for all supported entity types will be returned. (optional) + * @param entities Entities filter. If not specified, alarm rules for entity type filter will be returned. (optional) + * @param textSearch The case insensitive 'substring' filter based on the calculated field name. (optional) + * @param sortProperty Property of entity to sort by (optional) + * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) + * @return PageDataAlarmRuleDefinitionInfo + * @throws ApiException if fails to make API call + */ + public PageDataAlarmRuleDefinitionInfo getAlarmRules(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable EntityType entityType, @Nullable Set entities, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) throws ApiException { + ApiResponse localVarResponse = getAlarmRulesWithHttpInfo(pageSize, page, entityType, entities, textSearch, sortProperty, sortOrder, null); + return localVarResponse.getData(); + } + + /** + * Get alarm rules (getAlarmRules) + * Fetch tenant alarm rules based on the filter. Available for users with 'TENANT_ADMIN' authority. + * @param pageSize Maximum amount of entities in a one page (required) + * @param page Sequence number of page starting from 0 (required) + * @param entityType Entity type filter. If not specified, alarm rules for all supported entity types will be returned. (optional) + * @param entities Entities filter. If not specified, alarm rules for entity type filter will be returned. (optional) + * @param textSearch The case insensitive 'substring' filter based on the calculated field name. (optional) + * @param sortProperty Property of entity to sort by (optional) + * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PageDataAlarmRuleDefinitionInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAlarmRulesWithHttpInfo(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable EntityType entityType, @Nullable Set entities, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAlarmRulesRequestBuilder(pageSize, page, entityType, entities, textSearch, sortProperty, sortOrder, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getAlarmRules", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + String responseBody = new String(localVarResponseBody.readAllBytes()); + PageDataAlarmRuleDefinitionInfo responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAlarmRulesRequestBuilder(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable EntityType entityType, @Nullable Set entities, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, Map headers) throws ApiException { + // verify the required parameter 'pageSize' is set + if (pageSize == null) { + throw new ApiException(400, "Missing the required parameter 'pageSize' when calling getAlarmRules"); + } + // verify the required parameter 'page' is set + if (page == null) { + throw new ApiException(400, "Missing the required parameter 'page' when calling getAlarmRules"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/alarm/rules"; + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pageSize"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageSize", pageSize)); + localVarQueryParameterBaseName = "page"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParameterBaseName = "entityType"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("entityType", entityType)); + localVarQueryParameterBaseName = "entities"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "entities", entities)); + localVarQueryParameterBaseName = "textSearch"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("textSearch", textSearch)); + localVarQueryParameterBaseName = "sortProperty"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortProperty", sortProperty)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortOrder", sortOrder)); + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get Alarm Rules by Entity Id (getAlarmRulesByEntityId) + * Fetch the Alarm Rules based on the provided Entity Id. Available for users with 'TENANT_ADMIN' authority. * @param entityType A string value representing the entity type. For example, 'DEVICE' (required) * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) * @param pageSize Maximum amount of entities in a one page (required) * @param page Sequence number of page starting from 0 (required) - * @param searchStatus A string value representing one of the AlarmSearchStatus enumeration value (optional) - * @param status A string value representing one of the AlarmStatus enumeration value (optional) - * @param assigneeId A string value representing the assignee user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (optional) - * @param textSearch The case insensitive 'substring' filter based on of next alarm fields: type, severity or status (optional) + * @param textSearch The case insensitive 'substring' filter based on the calculated field name. (optional) * @param sortProperty Property of entity to sort by (optional) * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) - * @param startTime The start timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'. (optional) - * @param endTime The end timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'. (optional) - * @param fetchOriginator A boolean value to specify if the alarm originator name will be filled in the AlarmInfo object field: 'originatorName' or will returns as null. (optional) - * @return PageDataAlarmInfo + * @return PageDataAlarmRuleDefinition * @throws ApiException if fails to make API call */ - public PageDataAlarmInfo getAlarmsByEntity(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String searchStatus, @Nullable String status, @Nullable String assigneeId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, @Nullable Long startTime, @Nullable Long endTime, @Nullable Boolean fetchOriginator) throws ApiException { - ApiResponse localVarResponse = getAlarmsByEntityWithHttpInfo(entityType, entityId, pageSize, page, searchStatus, status, assigneeId, textSearch, sortProperty, sortOrder, startTime, endTime, fetchOriginator, null); + public PageDataAlarmRuleDefinition getAlarmRulesByEntityId(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder) throws ApiException { + ApiResponse localVarResponse = getAlarmRulesByEntityIdWithHttpInfo(entityType, entityId, pageSize, page, textSearch, sortProperty, sortOrder, null); return localVarResponse.getData(); } /** - * Get Alarms (getAlarmsByEntity) - * Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * Get Alarm Rules by Entity Id (getAlarmRulesByEntityId) + * Fetch the Alarm Rules based on the provided Entity Id. Available for users with 'TENANT_ADMIN' authority. * @param entityType A string value representing the entity type. For example, 'DEVICE' (required) * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) * @param pageSize Maximum amount of entities in a one page (required) * @param page Sequence number of page starting from 0 (required) - * @param searchStatus A string value representing one of the AlarmSearchStatus enumeration value (optional) - * @param status A string value representing one of the AlarmStatus enumeration value (optional) - * @param assigneeId A string value representing the assignee user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (optional) - * @param textSearch The case insensitive 'substring' filter based on of next alarm fields: type, severity or status (optional) + * @param textSearch The case insensitive 'substring' filter based on the calculated field name. (optional) * @param sortProperty Property of entity to sort by (optional) * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) - * @param startTime The start timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'. (optional) - * @param endTime The end timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'. (optional) - * @param fetchOriginator A boolean value to specify if the alarm originator name will be filled in the AlarmInfo object field: 'originatorName' or will returns as null. (optional) * @param headers Optional headers to include in the request - * @return ApiResponse<PageDataAlarmInfo> + * @return ApiResponse<PageDataAlarmRuleDefinition> * @throws ApiException if fails to make API call */ - public ApiResponse getAlarmsByEntityWithHttpInfo(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String searchStatus, @Nullable String status, @Nullable String assigneeId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, @Nullable Long startTime, @Nullable Long endTime, @Nullable Boolean fetchOriginator, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getAlarmsByEntityRequestBuilder(entityType, entityId, pageSize, page, searchStatus, status, assigneeId, textSearch, sortProperty, sortOrder, startTime, endTime, fetchOriginator, headers); + public ApiResponse getAlarmRulesByEntityIdWithHttpInfo(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAlarmRulesByEntityIdRequestBuilder(entityType, entityId, pageSize, page, textSearch, sortProperty, sortOrder, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -11166,15 +11426,15 @@ public ApiResponse getAlarmsByEntityWithHttpInfo(@Nonnull Str InputStream localVarResponseBody = null; try { if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getAlarmsByEntity", localVarResponse); + throw getApiException("getAlarmRulesByEntityId", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); if (localVarResponseBody == null) { - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } String responseBody = new String(localVarResponseBody.readAllBytes()); - PageDataAlarmInfo responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + PageDataAlarmRuleDefinition responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); } finally { if (localVarResponseBody != null) { localVarResponseBody.close(); @@ -11189,36 +11449,30 @@ public ApiResponse getAlarmsByEntityWithHttpInfo(@Nonnull Str } } - private HttpRequest.Builder getAlarmsByEntityRequestBuilder(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String searchStatus, @Nullable String status, @Nullable String assigneeId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, @Nullable Long startTime, @Nullable Long endTime, @Nullable Boolean fetchOriginator, Map headers) throws ApiException { + private HttpRequest.Builder getAlarmRulesByEntityIdRequestBuilder(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, Map headers) throws ApiException { // verify the required parameter 'entityType' is set if (entityType == null) { - throw new ApiException(400, "Missing the required parameter 'entityType' when calling getAlarmsByEntity"); + throw new ApiException(400, "Missing the required parameter 'entityType' when calling getAlarmRulesByEntityId"); } // verify the required parameter 'entityId' is set if (entityId == null) { - throw new ApiException(400, "Missing the required parameter 'entityId' when calling getAlarmsByEntity"); + throw new ApiException(400, "Missing the required parameter 'entityId' when calling getAlarmRulesByEntityId"); } // verify the required parameter 'pageSize' is set if (pageSize == null) { - throw new ApiException(400, "Missing the required parameter 'pageSize' when calling getAlarmsByEntity"); + throw new ApiException(400, "Missing the required parameter 'pageSize' when calling getAlarmRulesByEntityId"); } // verify the required parameter 'page' is set if (page == null) { - throw new ApiException(400, "Missing the required parameter 'page' when calling getAlarmsByEntity"); + throw new ApiException(400, "Missing the required parameter 'page' when calling getAlarmRulesByEntityId"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/api/alarm/{entityType}/{entityId}" + String localVarPath = "/api/alarm/rules/{entityType}/{entityId}" .replace("{entityType}", ApiClient.urlEncode(entityType.toString())) .replace("{entityId}", ApiClient.urlEncode(entityId.toString())); List localVarQueryParams = new ArrayList<>(); StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "searchStatus"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("searchStatus", searchStatus)); - localVarQueryParameterBaseName = "status"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("status", status)); - localVarQueryParameterBaseName = "assigneeId"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("assigneeId", assigneeId)); localVarQueryParameterBaseName = "pageSize"; localVarQueryParams.addAll(ApiClient.parameterToPairs("pageSize", pageSize)); localVarQueryParameterBaseName = "page"; @@ -11229,12 +11483,260 @@ private HttpRequest.Builder getAlarmsByEntityRequestBuilder(@Nonnull String enti localVarQueryParams.addAll(ApiClient.parameterToPairs("sortProperty", sortProperty)); localVarQueryParameterBaseName = "sortOrder"; localVarQueryParams.addAll(ApiClient.parameterToPairs("sortOrder", sortOrder)); - localVarQueryParameterBaseName = "startTime"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("startTime", startTime)); - localVarQueryParameterBaseName = "endTime"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("endTime", endTime)); - localVarQueryParameterBaseName = "fetchOriginator"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("fetchOriginator", fetchOriginator)); + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get Alarm Types (getAlarmTypes) + * Returns a set of unique alarm types based on alarms that are either owned by the tenant or assigned to the customer which user is performing the request. + * @param pageSize Maximum amount of entities in a one page (required) + * @param page Sequence number of page starting from 0 (required) + * @param textSearch The case insensitive 'substring' filter based on of next alarm fields: type, severity or status (optional) + * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) + * @return PageDataEntitySubtype + * @throws ApiException if fails to make API call + */ + public PageDataEntitySubtype getAlarmTypes(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder) throws ApiException { + ApiResponse localVarResponse = getAlarmTypesWithHttpInfo(pageSize, page, textSearch, sortOrder, null); + return localVarResponse.getData(); + } + + /** + * Get Alarm Types (getAlarmTypes) + * Returns a set of unique alarm types based on alarms that are either owned by the tenant or assigned to the customer which user is performing the request. + * @param pageSize Maximum amount of entities in a one page (required) + * @param page Sequence number of page starting from 0 (required) + * @param textSearch The case insensitive 'substring' filter based on of next alarm fields: type, severity or status (optional) + * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PageDataEntitySubtype> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAlarmTypesWithHttpInfo(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAlarmTypesRequestBuilder(pageSize, page, textSearch, sortOrder, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getAlarmTypes", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + String responseBody = new String(localVarResponseBody.readAllBytes()); + PageDataEntitySubtype responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAlarmTypesRequestBuilder(@Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String textSearch, @Nullable String sortOrder, Map headers) throws ApiException { + // verify the required parameter 'pageSize' is set + if (pageSize == null) { + throw new ApiException(400, "Missing the required parameter 'pageSize' when calling getAlarmTypes"); + } + // verify the required parameter 'page' is set + if (page == null) { + throw new ApiException(400, "Missing the required parameter 'page' when calling getAlarmTypes"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/alarm/types"; + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pageSize"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageSize", pageSize)); + localVarQueryParameterBaseName = "page"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParameterBaseName = "textSearch"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("textSearch", textSearch)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortOrder", sortOrder)); + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get Alarms (getAlarmsByEntity) + * Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * @param entityType A string value representing the entity type. For example, 'DEVICE' (required) + * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) + * @param pageSize Maximum amount of entities in a one page (required) + * @param page Sequence number of page starting from 0 (required) + * @param searchStatus A string value representing one of the AlarmSearchStatus enumeration value (optional) + * @param status A string value representing one of the AlarmStatus enumeration value (optional) + * @param assigneeId A string value representing the assignee user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (optional) + * @param textSearch The case insensitive 'substring' filter based on of next alarm fields: type, severity or status (optional) + * @param sortProperty Property of entity to sort by (optional) + * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) + * @param startTime The start timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'. (optional) + * @param endTime The end timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'. (optional) + * @param fetchOriginator A boolean value to specify if the alarm originator name will be filled in the AlarmInfo object field: 'originatorName' or will returns as null. (optional) + * @return PageDataAlarmInfo + * @throws ApiException if fails to make API call + */ + public PageDataAlarmInfo getAlarmsByEntity(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String searchStatus, @Nullable String status, @Nullable String assigneeId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, @Nullable Long startTime, @Nullable Long endTime, @Nullable Boolean fetchOriginator) throws ApiException { + ApiResponse localVarResponse = getAlarmsByEntityWithHttpInfo(entityType, entityId, pageSize, page, searchStatus, status, assigneeId, textSearch, sortProperty, sortOrder, startTime, endTime, fetchOriginator, null); + return localVarResponse.getData(); + } + + /** + * Get Alarms (getAlarmsByEntity) + * Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * @param entityType A string value representing the entity type. For example, 'DEVICE' (required) + * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) + * @param pageSize Maximum amount of entities in a one page (required) + * @param page Sequence number of page starting from 0 (required) + * @param searchStatus A string value representing one of the AlarmSearchStatus enumeration value (optional) + * @param status A string value representing one of the AlarmStatus enumeration value (optional) + * @param assigneeId A string value representing the assignee user id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (optional) + * @param textSearch The case insensitive 'substring' filter based on of next alarm fields: type, severity or status (optional) + * @param sortProperty Property of entity to sort by (optional) + * @param sortOrder Sort order. ASC (ASCENDING) or DESC (DESCENDING) (optional) + * @param startTime The start timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'. (optional) + * @param endTime The end timestamp in milliseconds of the search time range over the Alarm class field: 'createdTime'. (optional) + * @param fetchOriginator A boolean value to specify if the alarm originator name will be filled in the AlarmInfo object field: 'originatorName' or will returns as null. (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<PageDataAlarmInfo> + * @throws ApiException if fails to make API call + */ + public ApiResponse getAlarmsByEntityWithHttpInfo(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String searchStatus, @Nullable String status, @Nullable String assigneeId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, @Nullable Long startTime, @Nullable Long endTime, @Nullable Boolean fetchOriginator, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getAlarmsByEntityRequestBuilder(entityType, entityId, pageSize, page, searchStatus, status, assigneeId, textSearch, sortProperty, sortOrder, startTime, endTime, fetchOriginator, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getAlarmsByEntity", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + String responseBody = new String(localVarResponseBody.readAllBytes()); + PageDataAlarmInfo responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getAlarmsByEntityRequestBuilder(@Nonnull String entityType, @Nonnull String entityId, @Nonnull Integer pageSize, @Nonnull Integer page, @Nullable String searchStatus, @Nullable String status, @Nullable String assigneeId, @Nullable String textSearch, @Nullable String sortProperty, @Nullable String sortOrder, @Nullable Long startTime, @Nullable Long endTime, @Nullable Boolean fetchOriginator, Map headers) throws ApiException { + // verify the required parameter 'entityType' is set + if (entityType == null) { + throw new ApiException(400, "Missing the required parameter 'entityType' when calling getAlarmsByEntity"); + } + // verify the required parameter 'entityId' is set + if (entityId == null) { + throw new ApiException(400, "Missing the required parameter 'entityId' when calling getAlarmsByEntity"); + } + // verify the required parameter 'pageSize' is set + if (pageSize == null) { + throw new ApiException(400, "Missing the required parameter 'pageSize' when calling getAlarmsByEntity"); + } + // verify the required parameter 'page' is set + if (page == null) { + throw new ApiException(400, "Missing the required parameter 'page' when calling getAlarmsByEntity"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/alarm/{entityType}/{entityId}" + .replace("{entityType}", ApiClient.urlEncode(entityType.toString())) + .replace("{entityId}", ApiClient.urlEncode(entityId.toString())); + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "searchStatus"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("searchStatus", searchStatus)); + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("status", status)); + localVarQueryParameterBaseName = "assigneeId"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("assigneeId", assigneeId)); + localVarQueryParameterBaseName = "pageSize"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("pageSize", pageSize)); + localVarQueryParameterBaseName = "page"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParameterBaseName = "textSearch"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("textSearch", textSearch)); + localVarQueryParameterBaseName = "sortProperty"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortProperty", sortProperty)); + localVarQueryParameterBaseName = "sortOrder"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("sortOrder", sortOrder)); + localVarQueryParameterBaseName = "startTime"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("startTime", startTime)); + localVarQueryParameterBaseName = "endTime"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("endTime", endTime)); + localVarQueryParameterBaseName = "fetchOriginator"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("fetchOriginator", fetchOriginator)); if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { StringJoiner queryJoiner = new StringJoiner("&"); localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); @@ -16727,10 +17229,12 @@ private HttpRequest.Builder getCustomersByIdsRequestBuilder(@Nonnull List localVarResponse = getDashboardByIdWithHttpInfo(dashboardId, includeResources, acceptEncoding, null); + return localVarResponse.getData(); } /** @@ -16740,10 +17244,10 @@ public void getDashboardById(@Nonnull String dashboardId, @Nullable Boolean incl * @param includeResources Export used resources and replace resource links with resource metadata (optional) * @param acceptEncoding (optional) * @param headers Optional headers to include in the request - * @return ApiResponse<Void> + * @return ApiResponse<Dashboard> * @throws ApiException if fails to make API call */ - public ApiResponse getDashboardByIdWithHttpInfo(@Nonnull String dashboardId, @Nullable Boolean includeResources, @Nullable String acceptEncoding, Map headers) throws ApiException { + public ApiResponse getDashboardByIdWithHttpInfo(@Nonnull String dashboardId, @Nullable Boolean includeResources, @Nullable String acceptEncoding, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getDashboardByIdRequestBuilder(dashboardId, includeResources, acceptEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -16758,10 +17262,12 @@ public ApiResponse getDashboardByIdWithHttpInfo(@Nonnull String dashboardI throw getApiException("getDashboardById", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody != null) { - localVarResponseBody.readAllBytes(); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + String responseBody = new String(localVarResponseBody.readAllBytes()); + Dashboard responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); } finally { if (localVarResponseBody != null) { localVarResponseBody.close(); @@ -20839,10 +21345,12 @@ private HttpRequest.Builder getHighestAlarmSeverityRequestBuilder(@Nonnull Strin * Get Home Dashboard (getHomeDashboard) * Returns the home dashboard object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. The Dashboard object is a heavyweight object that contains information about the dashboard (e.g. title, image, assigned customers) and also configuration JSON (e.g. layouts, widgets, entity aliases). Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param acceptEncoding (optional) + * @return HomeDashboard * @throws ApiException if fails to make API call */ - public void getHomeDashboard(@Nullable String acceptEncoding) throws ApiException { - getHomeDashboardWithHttpInfo(acceptEncoding, null); + public HomeDashboard getHomeDashboard(@Nullable String acceptEncoding) throws ApiException { + ApiResponse localVarResponse = getHomeDashboardWithHttpInfo(acceptEncoding, null); + return localVarResponse.getData(); } /** @@ -20850,10 +21358,10 @@ public void getHomeDashboard(@Nullable String acceptEncoding) throws ApiExceptio * Returns the home dashboard object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. The Dashboard object is a heavyweight object that contains information about the dashboard (e.g. title, image, assigned customers) and also configuration JSON (e.g. layouts, widgets, entity aliases). Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param acceptEncoding (optional) * @param headers Optional headers to include in the request - * @return ApiResponse<Void> + * @return ApiResponse<HomeDashboard> * @throws ApiException if fails to make API call */ - public ApiResponse getHomeDashboardWithHttpInfo(@Nullable String acceptEncoding, Map headers) throws ApiException { + public ApiResponse getHomeDashboardWithHttpInfo(@Nullable String acceptEncoding, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getHomeDashboardRequestBuilder(acceptEncoding, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -20868,10 +21376,12 @@ public ApiResponse getHomeDashboardWithHttpInfo(@Nullable String acceptEnc throw getApiException("getHomeDashboard", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody != null) { - localVarResponseBody.readAllBytes(); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); } - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + String responseBody = new String(localVarResponseBody.readAllBytes()); + HomeDashboard responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); } finally { if (localVarResponseBody != null) { localVarResponseBody.close(); @@ -21455,6 +21965,83 @@ private HttpRequest.Builder getJwtSettingsRequestBuilder(Map hea return localVarRequestBuilder; } + /** + * Get latest alarm rule debug event (getLatestAlarmRuleDebugEvent) + * Gets latest alarm rule debug event for specified alarm rule id. Referencing non-existing alarm rule id will cause an error. Available for users with 'TENANT_ADMIN' authority. + * @param alarmRuleId (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode getLatestAlarmRuleDebugEvent(@Nonnull String alarmRuleId) throws ApiException { + ApiResponse localVarResponse = getLatestAlarmRuleDebugEventWithHttpInfo(alarmRuleId, null); + return localVarResponse.getData(); + } + + /** + * Get latest alarm rule debug event (getLatestAlarmRuleDebugEvent) + * Gets latest alarm rule debug event for specified alarm rule id. Referencing non-existing alarm rule id will cause an error. Available for users with 'TENANT_ADMIN' authority. + * @param alarmRuleId (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<com.fasterxml.jackson.databind.JsonNode> + * @throws ApiException if fails to make API call + */ + public ApiResponse getLatestAlarmRuleDebugEventWithHttpInfo(@Nonnull String alarmRuleId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getLatestAlarmRuleDebugEventRequestBuilder(alarmRuleId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getLatestAlarmRuleDebugEvent", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + String responseBody = new String(localVarResponseBody.readAllBytes()); + com.fasterxml.jackson.databind.JsonNode responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getLatestAlarmRuleDebugEventRequestBuilder(@Nonnull String alarmRuleId, Map headers) throws ApiException { + // verify the required parameter 'alarmRuleId' is set + if (alarmRuleId == null) { + throw new ApiException(400, "Missing the required parameter 'alarmRuleId' when calling getLatestAlarmRuleDebugEvent"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/alarm/rule/{alarmRuleId}/debug" + .replace("{alarmRuleId}", ApiClient.urlEncode(alarmRuleId.toString())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** * Get latest calculated field debug event (getLatestCalculatedFieldDebugEvent) * Gets latest calculated field debug event for specified calculated field id. Referencing non-existing calculated field id will cause an error. Available for users with 'TENANT_ADMIN' authority. @@ -32846,7 +33433,7 @@ private HttpRequest.Builder handleMailOAuth2CallbackRequestBuilder(@Nonnull Stri * Send one-way RPC request (handleOneWayDeviceRPCRequestV1) * Deprecated. See 'Rpc V 2 Controller' instead. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param deviceId A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the RPC request. (required) * @return String * @throws ApiException if fails to make API call */ @@ -32859,7 +33446,7 @@ public String handleOneWayDeviceRPCRequestV1(@Nonnull String deviceId, @Nonnull * Send one-way RPC request (handleOneWayDeviceRPCRequestV1) * Deprecated. See 'Rpc V 2 Controller' instead. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param deviceId A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the RPC request. (required) * @param headers Optional headers to include in the request * @return ApiResponse<String> * @throws ApiException if fails to make API call @@ -32912,7 +33499,7 @@ private HttpRequest.Builder handleOneWayDeviceRPCRequestV1RequestBuilder(@Nonnul String localVarPath = "/api/plugins/rpc/oneway/{deviceId}" .replace("{deviceId}", ApiClient.urlEncode(deviceId.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -32930,7 +33517,7 @@ private HttpRequest.Builder handleOneWayDeviceRPCRequestV1RequestBuilder(@Nonnul * Send one-way RPC request (handleOneWayDeviceRPCRequestV2) * Sends the one-way remote-procedure call (RPC) request to device. Sends the one-way remote-procedure call (RPC) request to device. The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. See example below. We will review the properties of the RPC call one-by-one below. ```json { \"method\": \"setGpio\", \"params\": { \"pin\": 7, \"value\": 1 }, \"persistent\": false, \"timeout\": 5000 } ``` ### Server-side RPC structure The body of server-side RPC request consists of multiple fields: * **method** - mandatory, name of the method to distinct the RPC calls. For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string. * **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed. * **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds). * **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present. * **persistent** - optional, indicates persistent RPC. The default value is \"false\". * **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side. * **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events. ### RPC Result In case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, the result of this call is either 200 OK if the message was sent to device, or 504 Gateway Timeout if device is offline. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param deviceId A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the RPC request. (required) * @return String * @throws ApiException if fails to make API call */ @@ -32943,7 +33530,7 @@ public String handleOneWayDeviceRPCRequestV2(@Nonnull String deviceId, @Nonnull * Send one-way RPC request (handleOneWayDeviceRPCRequestV2) * Sends the one-way remote-procedure call (RPC) request to device. Sends the one-way remote-procedure call (RPC) request to device. The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. See example below. We will review the properties of the RPC call one-by-one below. ```json { \"method\": \"setGpio\", \"params\": { \"pin\": 7, \"value\": 1 }, \"persistent\": false, \"timeout\": 5000 } ``` ### Server-side RPC structure The body of server-side RPC request consists of multiple fields: * **method** - mandatory, name of the method to distinct the RPC calls. For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string. * **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed. * **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds). * **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present. * **persistent** - optional, indicates persistent RPC. The default value is \"false\". * **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side. * **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events. ### RPC Result In case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, the result of this call is either 200 OK if the message was sent to device, or 504 Gateway Timeout if device is offline. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param deviceId A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the RPC request. (required) * @param headers Optional headers to include in the request * @return ApiResponse<String> * @throws ApiException if fails to make API call @@ -32996,7 +33583,7 @@ private HttpRequest.Builder handleOneWayDeviceRPCRequestV2RequestBuilder(@Nonnul String localVarPath = "/api/rpc/oneway/{deviceId}" .replace("{deviceId}", ApiClient.urlEncode(deviceId.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -33015,7 +33602,7 @@ private HttpRequest.Builder handleOneWayDeviceRPCRequestV2RequestBuilder(@Nonnul * Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses specified Entity Id as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields: * **'serviceId'** to identify the platform server that received the request; * **'requestUUID'** to identify the request and route possible response from the Rule Engine; Use **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). * @param entityType A string value representing the entity type. For example, 'DEVICE' (required) * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the message. (required) * @return String * @throws ApiException if fails to make API call */ @@ -33029,7 +33616,7 @@ public String handleRuleEngineRequestForEntity(@Nonnull String entityType, @Nonn * Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses specified Entity Id as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields: * **'serviceId'** to identify the platform server that received the request; * **'requestUUID'** to identify the request and route possible response from the Rule Engine; Use **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). * @param entityType A string value representing the entity type. For example, 'DEVICE' (required) * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the message. (required) * @param headers Optional headers to include in the request * @return ApiResponse<String> * @throws ApiException if fails to make API call @@ -33087,7 +33674,7 @@ private HttpRequest.Builder handleRuleEngineRequestForEntityRequestBuilder(@Nonn .replace("{entityType}", ApiClient.urlEncode(entityType.toString())) .replace("{entityId}", ApiClient.urlEncode(entityId.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -33108,7 +33695,7 @@ private HttpRequest.Builder handleRuleEngineRequestForEntityRequestBuilder(@Nonn * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) * @param queueName Queue name to process the request in the rule engine (required) * @param timeout Timeout to process the request in milliseconds (required) - * @param body (required) + * @param body A JSON object representing the message. (required) * @return String * @throws ApiException if fails to make API call */ @@ -33124,7 +33711,7 @@ public String handleRuleEngineRequestForEntityWithQueueAndTimeout(@Nonnull Strin * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) * @param queueName Queue name to process the request in the rule engine (required) * @param timeout Timeout to process the request in milliseconds (required) - * @param body (required) + * @param body A JSON object representing the message. (required) * @param headers Optional headers to include in the request * @return ApiResponse<String> * @throws ApiException if fails to make API call @@ -33192,7 +33779,7 @@ private HttpRequest.Builder handleRuleEngineRequestForEntityWithQueueAndTimeoutR .replace("{queueName}", ApiClient.urlEncode(queueName.toString())) .replace("{timeout}", ApiClient.urlEncode(timeout.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -33212,7 +33799,7 @@ private HttpRequest.Builder handleRuleEngineRequestForEntityWithQueueAndTimeoutR * @param entityType A string value representing the entity type. For example, 'DEVICE' (required) * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) * @param timeout Timeout to process the request in milliseconds (required) - * @param body (required) + * @param body A JSON object representing the message. (required) * @return String * @throws ApiException if fails to make API call */ @@ -33227,7 +33814,7 @@ public String handleRuleEngineRequestForEntityWithTimeout(@Nonnull String entity * @param entityType A string value representing the entity type. For example, 'DEVICE' (required) * @param entityId A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) * @param timeout Timeout to process the request in milliseconds (required) - * @param body (required) + * @param body A JSON object representing the message. (required) * @param headers Optional headers to include in the request * @return ApiResponse<String> * @throws ApiException if fails to make API call @@ -33290,7 +33877,7 @@ private HttpRequest.Builder handleRuleEngineRequestForEntityWithTimeoutRequestBu .replace("{entityId}", ApiClient.urlEncode(entityId.toString())) .replace("{timeout}", ApiClient.urlEncode(timeout.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -33307,7 +33894,7 @@ private HttpRequest.Builder handleRuleEngineRequestForEntityWithTimeoutRequestBu /** * Push user message to the rule engine (handleRuleEngineRequestForUser) * Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses current User Id ( the one which credentials is used to perform the request) as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields: * **'serviceId'** to identify the platform server that received the request; * **'requestUUID'** to identify the request and route possible response from the Rule Engine; Use **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). - * @param body (required) + * @param body A JSON object representing the message. (required) * @return String * @throws ApiException if fails to make API call */ @@ -33319,7 +33906,7 @@ public String handleRuleEngineRequestForUser(@Nonnull String body) throws ApiExc /** * Push user message to the rule engine (handleRuleEngineRequestForUser) * Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses current User Id ( the one which credentials is used to perform the request) as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields: * **'serviceId'** to identify the platform server that received the request; * **'requestUUID'** to identify the request and route possible response from the Rule Engine; Use **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). - * @param body (required) + * @param body A JSON object representing the message. (required) * @param headers Optional headers to include in the request * @return ApiResponse<String> * @throws ApiException if fails to make API call @@ -33367,7 +33954,7 @@ private HttpRequest.Builder handleRuleEngineRequestForUserRequestBuilder(@Nonnul HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/api/rule-engine/"; localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -33385,7 +33972,7 @@ private HttpRequest.Builder handleRuleEngineRequestForUserRequestBuilder(@Nonnul * Send two-way RPC request (handleTwoWayDeviceRPCRequestV1) * Deprecated. See 'Rpc V 2 Controller' instead. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param deviceId A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the RPC request. (required) * @return String * @throws ApiException if fails to make API call */ @@ -33398,7 +33985,7 @@ public String handleTwoWayDeviceRPCRequestV1(@Nonnull String deviceId, @Nonnull * Send two-way RPC request (handleTwoWayDeviceRPCRequestV1) * Deprecated. See 'Rpc V 2 Controller' instead. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param deviceId A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the RPC request. (required) * @param headers Optional headers to include in the request * @return ApiResponse<String> * @throws ApiException if fails to make API call @@ -33451,7 +34038,7 @@ private HttpRequest.Builder handleTwoWayDeviceRPCRequestV1RequestBuilder(@Nonnul String localVarPath = "/api/plugins/rpc/twoway/{deviceId}" .replace("{deviceId}", ApiClient.urlEncode(deviceId.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -33469,7 +34056,7 @@ private HttpRequest.Builder handleTwoWayDeviceRPCRequestV1RequestBuilder(@Nonnul * Send two-way RPC request (handleTwoWayDeviceRPCRequestV2) * Sends the two-way remote-procedure call (RPC) request to device. Sends the one-way remote-procedure call (RPC) request to device. The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. See example below. We will review the properties of the RPC call one-by-one below. ```json { \"method\": \"setGpio\", \"params\": { \"pin\": 7, \"value\": 1 }, \"persistent\": false, \"timeout\": 5000 } ``` ### Server-side RPC structure The body of server-side RPC request consists of multiple fields: * **method** - mandatory, name of the method to distinct the RPC calls. For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string. * **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed. * **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds). * **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present. * **persistent** - optional, indicates persistent RPC. The default value is \"false\". * **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side. * **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events. ### RPC Result In case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, the result of this call is the response from device, or 504 Gateway Timeout if device is offline. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param deviceId A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the RPC request. (required) * @return String * @throws ApiException if fails to make API call */ @@ -33482,7 +34069,7 @@ public String handleTwoWayDeviceRPCRequestV2(@Nonnull String deviceId, @Nonnull * Send two-way RPC request (handleTwoWayDeviceRPCRequestV2) * Sends the two-way remote-procedure call (RPC) request to device. Sends the one-way remote-procedure call (RPC) request to device. The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. See example below. We will review the properties of the RPC call one-by-one below. ```json { \"method\": \"setGpio\", \"params\": { \"pin\": 7, \"value\": 1 }, \"persistent\": false, \"timeout\": 5000 } ``` ### Server-side RPC structure The body of server-side RPC request consists of multiple fields: * **method** - mandatory, name of the method to distinct the RPC calls. For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string. * **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed. * **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds). * **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present. * **persistent** - optional, indicates persistent RPC. The default value is \"false\". * **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side. * **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events. ### RPC Result In case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, the result of this call is the response from device, or 504 Gateway Timeout if device is offline. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. * @param deviceId A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) - * @param body (required) + * @param body A JSON object representing the RPC request. (required) * @param headers Optional headers to include in the request * @return ApiResponse<String> * @throws ApiException if fails to make API call @@ -33535,7 +34122,7 @@ private HttpRequest.Builder handleTwoWayDeviceRPCRequestV2RequestBuilder(@Nonnul String localVarPath = "/api/rpc/twoway/{deviceId}" .replace("{deviceId}", ApiClient.urlEncode(deviceId.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -36707,6 +37294,88 @@ private HttpRequest.Builder saveAlarmCommentRequestBuilder(@Nonnull String alarm return localVarRequestBuilder; } + /** + * Create Or Update Alarm Rule (saveAlarmRule) + * Creates or Updates the Alarm Rule. When creating alarm rule, platform generates Alarm Rule Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Alarm Rule Id will be present in the response. Specify existing Alarm Rule Id to update the alarm rule. Referencing non-existing Alarm Rule Id will cause 'Not Found' error. Remove 'id', 'tenantId' from the request body example (below) to create new Alarm Rule entity. Available for users with 'TENANT_ADMIN' authority. + * @param alarmRuleDefinition A JSON value representing the alarm rule. (required) + * @return AlarmRuleDefinition + * @throws ApiException if fails to make API call + */ + public AlarmRuleDefinition saveAlarmRule(@Nonnull AlarmRuleDefinition alarmRuleDefinition) throws ApiException { + ApiResponse localVarResponse = saveAlarmRuleWithHttpInfo(alarmRuleDefinition, null); + return localVarResponse.getData(); + } + + /** + * Create Or Update Alarm Rule (saveAlarmRule) + * Creates or Updates the Alarm Rule. When creating alarm rule, platform generates Alarm Rule Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Alarm Rule Id will be present in the response. Specify existing Alarm Rule Id to update the alarm rule. Referencing non-existing Alarm Rule Id will cause 'Not Found' error. Remove 'id', 'tenantId' from the request body example (below) to create new Alarm Rule entity. Available for users with 'TENANT_ADMIN' authority. + * @param alarmRuleDefinition A JSON value representing the alarm rule. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<AlarmRuleDefinition> + * @throws ApiException if fails to make API call + */ + public ApiResponse saveAlarmRuleWithHttpInfo(@Nonnull AlarmRuleDefinition alarmRuleDefinition, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = saveAlarmRuleRequestBuilder(alarmRuleDefinition, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("saveAlarmRule", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + String responseBody = new String(localVarResponseBody.readAllBytes()); + AlarmRuleDefinition responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder saveAlarmRuleRequestBuilder(@Nonnull AlarmRuleDefinition alarmRuleDefinition, Map headers) throws ApiException { + // verify the required parameter 'alarmRuleDefinition' is set + if (alarmRuleDefinition == null) { + throw new ApiException(400, "Missing the required parameter 'alarmRuleDefinition' when calling saveAlarmRule"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/alarm/rule"; + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(alarmRuleDefinition); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** * Save API key for user (saveApiKey) * Creates an API key for the given user and returns the token ONCE as 'ApiKey {value}'. Available for any authorized user. @@ -37603,7 +38272,7 @@ private HttpRequest.Builder saveDeviceAttributesRequestBuilder(@Nonnull String d .replace("{deviceId}", ApiClient.urlEncode(deviceId.toString())) .replace("{scope}", ApiClient.urlEncode(scope.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -37619,7 +38288,7 @@ private HttpRequest.Builder saveDeviceAttributesRequestBuilder(@Nonnull String d /** * Create Or Update Device Profile (saveDeviceProfile) - * Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. Device profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant. # Device profile data definition Device profile data object contains alarm rules configuration, device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. ```json { \"alarms\":[ ], \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"DISABLED\", \"provisionDeviceSecret\":null }, \"transportConfiguration\":{ \"type\":\"DEFAULT\" } } ``` ```json { \"alarms\":[ { \"id\":\"2492b935-1226-59e9-8615-17d8978a4f93\", \"alarmType\":\"Temperature Alarm\", \"clearRule\":{ \"schedule\":null, \"condition\":{ \"spec\":{ \"type\":\"SIMPLE\" }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":30.0, \"dynamicValue\":null }, \"operation\":\"LESS\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"propagate\":false, \"createRules\":{ \"MAJOR\":{ \"schedule\":{ \"type\":\"SPECIFIC_TIME\", \"endsOn\":64800000, \"startsOn\":43200000, \"timezone\":\"Europe/Kiev\", \"daysOfWeek\":[ 1, 3, 5 ] }, \"condition\":{ \"spec\":{ \"type\":\"DURATION\", \"unit\":\"MINUTES\", \"predicate\":{ \"userValue\":null, \"defaultValue\":30, \"dynamicValue\":null } }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"COMPLEX\", \"operation\":\"OR\", \"predicates\":[ { \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":50.0, \"dynamicValue\":null }, \"operation\":\"LESS_OR_EQUAL\" }, { \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":30.0, \"dynamicValue\":null }, \"operation\":\"GREATER\" } ] }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"WARNING\":{ \"schedule\":{ \"type\":\"CUSTOM\", \"items\":[ { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":1 }, { \"endsOn\":64800000, \"enabled\":true, \"startsOn\":43200000, \"dayOfWeek\":2 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":3 }, { \"endsOn\":57600000, \"enabled\":true, \"startsOn\":36000000, \"dayOfWeek\":4 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":5 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":6 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":7 } ], \"timezone\":\"Europe/Kiev\" }, \"condition\":{ \"spec\":{ \"type\":\"REPEATING\", \"predicate\":{ \"userValue\":null, \"defaultValue\":5, \"dynamicValue\":null } }, \"condition\":[ { \"key\":{ \"key\":\"tempConstant\", \"type\":\"CONSTANT\" }, \"value\":30, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":0.0, \"dynamicValue\":{ \"inherit\":false, \"sourceType\":\"CURRENT_DEVICE\", \"sourceAttribute\":\"tempThreshold\" } }, \"operation\":\"EQUAL\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"CRITICAL\":{ \"schedule\":null, \"condition\":{ \"spec\":{ \"type\":\"SIMPLE\" }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":50.0, \"dynamicValue\":null }, \"operation\":\"GREATER\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null } }, \"propagateRelationTypes\":null } ], \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"ALLOW_CREATE_NEW_DEVICES\", \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\" }, \"transportConfiguration\":{ \"type\":\"MQTT\", \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\", \"deviceAttributesTopic\":\"v1/devices/me/attributes\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"PROTOBUF\", \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\", \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\", \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\", \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\" } } } ``` Let's review some specific objects examples related to the device profile configuration: # Alarm Schedule Alarm Schedule JSON object represents the time interval during which the alarm rule is active. Note, ```json \"schedule\": null ``` means alarm rule is active all the time. **'daysOfWeek'** field represents Monday as 1, Tuesday as 2 and so on. **'startsOn'** and **'endsOn'** fields represent hours in millis (e.g. 64800000 = 18:00 or 6pm). **'enabled'** flag specifies if item in a custom rule is active for specific day of the week: ## Specific Time Schedule ```json { \"schedule\":{ \"type\":\"SPECIFIC_TIME\", \"endsOn\":64800000, \"startsOn\":43200000, \"timezone\":\"Europe/Kiev\", \"daysOfWeek\":[ 1, 3, 5 ] } } ``` ## Custom Schedule ```json { \"schedule\":{ \"type\":\"CUSTOM\", \"items\":[ { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":1 }, { \"endsOn\":64800000, \"enabled\":true, \"startsOn\":43200000, \"dayOfWeek\":2 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":3 }, { \"endsOn\":57600000, \"enabled\":true, \"startsOn\":36000000, \"dayOfWeek\":4 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":5 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":6 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":7 } ], \"timezone\":\"Europe/Kiev\" } } ``` # Alarm condition type (**'spec'**) Alarm condition type can be either simple, duration, or repeating. For example, 5 times in a row or during 5 minutes. Note, **'userValue'** field is not used and reserved for future usage, **'dynamicValue'** is used for condition appliance by using the value of the **'sourceAttribute'** or else **'defaultValue'** is used (if **'sourceAttribute'** is absent). **'sourceType'** of the **'sourceAttribute'** can be: * 'CURRENT_DEVICE'; * 'CURRENT_CUSTOMER'; * 'CURRENT_TENANT'. **'sourceAttribute'** can be inherited from the owner if **'inherit'** is set to true (for CURRENT_DEVICE and CURRENT_CUSTOMER). ## Repeating alarm condition ```json { \"spec\":{ \"type\":\"REPEATING\", \"predicate\":{ \"userValue\":null, \"defaultValue\":5, \"dynamicValue\":{ \"inherit\":true, \"sourceType\":\"CURRENT_DEVICE\", \"sourceAttribute\":\"tempAttr\" } } } } ``` ## Duration alarm condition ```json { \"spec\":{ \"type\":\"DURATION\", \"unit\":\"MINUTES\", \"predicate\":{ \"userValue\":null, \"defaultValue\":30, \"dynamicValue\":null } } } ``` **'unit'** can be: * 'SECONDS'; * 'MINUTES'; * 'HOURS'; * 'DAYS'. # Key Filters Key filter objects are created under the **'condition'** array. They allow you to define complex logical expressions over entity field, attribute, latest time series value or constant. The filter is defined using 'key', 'valueType', 'value' (refers to the value of the 'CONSTANT' alarm filter key type) and 'predicate' objects. Let's review each object: ## Alarm Filter Key Filter Key defines either entity field, attribute, telemetry or constant. It is a JSON object that consists the key name and type. The following filter key types are supported: * 'ATTRIBUTE' - used for attributes values; * 'TIME_SERIES' - used for time series values; * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type; * 'CONSTANT' - constant value specified. Let's review the example: ```json { \"type\": \"TIME_SERIES\", \"key\": \"temperature\" } ``` ## Value Type and Operations Provides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL; * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; ## Filter Predicate Filter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key. Simple predicate example to check 'value < 100': ```json { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 100, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ``` Complex predicate example, to check 'value < 10 or value > 20': ```json { \"type\": \"COMPLEX\", \"operation\": \"OR\", \"predicates\": [ { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 10, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 20, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ] } ``` More complex predicate example, to check 'value < 10 or (value > 50 && value < 60)': ```json { \"type\": \"COMPLEX\", \"operation\": \"OR\", \"predicates\": [ { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 10, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"type\": \"COMPLEX\", \"operation\": \"AND\", \"predicates\": [ { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 50, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 60, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ] } ] } ``` You may also want to replace hardcoded values (for example, temperature > 20) with the more dynamic expression (for example, temperature > value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or device. See example below: ```json { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 0, \"dynamicValue\": { \"inherit\": false, \"sourceType\": \"CURRENT_TENANT\", \"sourceAttribute\": \"temperatureThreshold\" } }, \"type\": \"NUMERIC\" } ``` Note that you may use 'CURRENT_DEVICE', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source. The 'sourceAttribute' can be inherited from the owner of the specified 'sourceType' if 'inherit' is set to true. # Provision Configuration There are 3 types of device provision configuration for the device profile: * 'DISABLED'; * 'ALLOW_CREATE_NEW_DEVICES'; * 'CHECK_PRE_PROVISIONED_DEVICES'. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details. # Transport Configuration 5 transport configuration types are available: * 'DEFAULT'; * 'MQTT'; * 'LWM2M'; * 'COAP'; * 'SNMP'. Default type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types. See another example of COAP transport configuration below: ```json { \"type\":\"COAP\", \"clientSettings\":{ \"edrxCycle\":null, \"powerMode\":\"DRX\", \"psmActivityTimer\":null, \"pagingTransmissionWindow\":null }, \"coapDeviceTypeConfiguration\":{ \"coapDeviceType\":\"DEFAULT\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"JSON\" } } } ```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. Available for users with 'TENANT_ADMIN' authority. + * Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. Device profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant. # Device profile data definition Device profile data object contains device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. ```json { \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"DISABLED\", \"provisionDeviceSecret\":null }, \"transportConfiguration\":{ \"type\":\"DEFAULT\" } } ``` ```json { \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"ALLOW_CREATE_NEW_DEVICES\", \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\" }, \"transportConfiguration\":{ \"type\":\"MQTT\", \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\", \"deviceAttributesTopic\":\"v1/devices/me/attributes\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"PROTOBUF\", \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\", \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\", \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\", \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\" } } } ``` Let's review some specific objects examples related to the device profile configuration:# Provision Configuration There are 3 types of device provision configuration for the device profile: * 'DISABLED'; * 'ALLOW_CREATE_NEW_DEVICES'; * 'CHECK_PRE_PROVISIONED_DEVICES'. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details. # Transport Configuration 5 transport configuration types are available: * 'DEFAULT'; * 'MQTT'; * 'LWM2M'; * 'COAP'; * 'SNMP'. Default type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types. See another example of COAP transport configuration below: ```json { \"type\":\"COAP\", \"clientSettings\":{ \"edrxCycle\":null, \"powerMode\":\"DRX\", \"psmActivityTimer\":null, \"pagingTransmissionWindow\":null }, \"coapDeviceTypeConfiguration\":{ \"coapDeviceType\":\"DEFAULT\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"JSON\" } } } ```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. Available for users with 'TENANT_ADMIN' authority. * @param deviceProfile (required) * @return DeviceProfile * @throws ApiException if fails to make API call @@ -37631,7 +38300,7 @@ public DeviceProfile saveDeviceProfile(@Nonnull DeviceProfile deviceProfile) thr /** * Create Or Update Device Profile (saveDeviceProfile) - * Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. Device profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant. # Device profile data definition Device profile data object contains alarm rules configuration, device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. ```json { \"alarms\":[ ], \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"DISABLED\", \"provisionDeviceSecret\":null }, \"transportConfiguration\":{ \"type\":\"DEFAULT\" } } ``` ```json { \"alarms\":[ { \"id\":\"2492b935-1226-59e9-8615-17d8978a4f93\", \"alarmType\":\"Temperature Alarm\", \"clearRule\":{ \"schedule\":null, \"condition\":{ \"spec\":{ \"type\":\"SIMPLE\" }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":30.0, \"dynamicValue\":null }, \"operation\":\"LESS\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"propagate\":false, \"createRules\":{ \"MAJOR\":{ \"schedule\":{ \"type\":\"SPECIFIC_TIME\", \"endsOn\":64800000, \"startsOn\":43200000, \"timezone\":\"Europe/Kiev\", \"daysOfWeek\":[ 1, 3, 5 ] }, \"condition\":{ \"spec\":{ \"type\":\"DURATION\", \"unit\":\"MINUTES\", \"predicate\":{ \"userValue\":null, \"defaultValue\":30, \"dynamicValue\":null } }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"COMPLEX\", \"operation\":\"OR\", \"predicates\":[ { \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":50.0, \"dynamicValue\":null }, \"operation\":\"LESS_OR_EQUAL\" }, { \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":30.0, \"dynamicValue\":null }, \"operation\":\"GREATER\" } ] }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"WARNING\":{ \"schedule\":{ \"type\":\"CUSTOM\", \"items\":[ { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":1 }, { \"endsOn\":64800000, \"enabled\":true, \"startsOn\":43200000, \"dayOfWeek\":2 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":3 }, { \"endsOn\":57600000, \"enabled\":true, \"startsOn\":36000000, \"dayOfWeek\":4 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":5 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":6 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":7 } ], \"timezone\":\"Europe/Kiev\" }, \"condition\":{ \"spec\":{ \"type\":\"REPEATING\", \"predicate\":{ \"userValue\":null, \"defaultValue\":5, \"dynamicValue\":null } }, \"condition\":[ { \"key\":{ \"key\":\"tempConstant\", \"type\":\"CONSTANT\" }, \"value\":30, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":0.0, \"dynamicValue\":{ \"inherit\":false, \"sourceType\":\"CURRENT_DEVICE\", \"sourceAttribute\":\"tempThreshold\" } }, \"operation\":\"EQUAL\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null }, \"CRITICAL\":{ \"schedule\":null, \"condition\":{ \"spec\":{ \"type\":\"SIMPLE\" }, \"condition\":[ { \"key\":{ \"key\":\"temperature\", \"type\":\"TIME_SERIES\" }, \"value\":null, \"predicate\":{ \"type\":\"NUMERIC\", \"value\":{ \"userValue\":null, \"defaultValue\":50.0, \"dynamicValue\":null }, \"operation\":\"GREATER\" }, \"valueType\":\"NUMERIC\" } ] }, \"dashboardId\":null, \"alarmDetails\":null } }, \"propagateRelationTypes\":null } ], \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"ALLOW_CREATE_NEW_DEVICES\", \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\" }, \"transportConfiguration\":{ \"type\":\"MQTT\", \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\", \"deviceAttributesTopic\":\"v1/devices/me/attributes\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"PROTOBUF\", \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\", \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\", \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\", \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\" } } } ``` Let's review some specific objects examples related to the device profile configuration: # Alarm Schedule Alarm Schedule JSON object represents the time interval during which the alarm rule is active. Note, ```json \"schedule\": null ``` means alarm rule is active all the time. **'daysOfWeek'** field represents Monday as 1, Tuesday as 2 and so on. **'startsOn'** and **'endsOn'** fields represent hours in millis (e.g. 64800000 = 18:00 or 6pm). **'enabled'** flag specifies if item in a custom rule is active for specific day of the week: ## Specific Time Schedule ```json { \"schedule\":{ \"type\":\"SPECIFIC_TIME\", \"endsOn\":64800000, \"startsOn\":43200000, \"timezone\":\"Europe/Kiev\", \"daysOfWeek\":[ 1, 3, 5 ] } } ``` ## Custom Schedule ```json { \"schedule\":{ \"type\":\"CUSTOM\", \"items\":[ { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":1 }, { \"endsOn\":64800000, \"enabled\":true, \"startsOn\":43200000, \"dayOfWeek\":2 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":3 }, { \"endsOn\":57600000, \"enabled\":true, \"startsOn\":36000000, \"dayOfWeek\":4 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":5 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":6 }, { \"endsOn\":0, \"enabled\":false, \"startsOn\":0, \"dayOfWeek\":7 } ], \"timezone\":\"Europe/Kiev\" } } ``` # Alarm condition type (**'spec'**) Alarm condition type can be either simple, duration, or repeating. For example, 5 times in a row or during 5 minutes. Note, **'userValue'** field is not used and reserved for future usage, **'dynamicValue'** is used for condition appliance by using the value of the **'sourceAttribute'** or else **'defaultValue'** is used (if **'sourceAttribute'** is absent). **'sourceType'** of the **'sourceAttribute'** can be: * 'CURRENT_DEVICE'; * 'CURRENT_CUSTOMER'; * 'CURRENT_TENANT'. **'sourceAttribute'** can be inherited from the owner if **'inherit'** is set to true (for CURRENT_DEVICE and CURRENT_CUSTOMER). ## Repeating alarm condition ```json { \"spec\":{ \"type\":\"REPEATING\", \"predicate\":{ \"userValue\":null, \"defaultValue\":5, \"dynamicValue\":{ \"inherit\":true, \"sourceType\":\"CURRENT_DEVICE\", \"sourceAttribute\":\"tempAttr\" } } } } ``` ## Duration alarm condition ```json { \"spec\":{ \"type\":\"DURATION\", \"unit\":\"MINUTES\", \"predicate\":{ \"userValue\":null, \"defaultValue\":30, \"dynamicValue\":null } } } ``` **'unit'** can be: * 'SECONDS'; * 'MINUTES'; * 'HOURS'; * 'DAYS'. # Key Filters Key filter objects are created under the **'condition'** array. They allow you to define complex logical expressions over entity field, attribute, latest time series value or constant. The filter is defined using 'key', 'valueType', 'value' (refers to the value of the 'CONSTANT' alarm filter key type) and 'predicate' objects. Let's review each object: ## Alarm Filter Key Filter Key defines either entity field, attribute, telemetry or constant. It is a JSON object that consists the key name and type. The following filter key types are supported: * 'ATTRIBUTE' - used for attributes values; * 'TIME_SERIES' - used for time series values; * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type; * 'CONSTANT' - constant value specified. Let's review the example: ```json { \"type\": \"TIME_SERIES\", \"key\": \"temperature\" } ``` ## Value Type and Operations Provides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL; * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; ## Filter Predicate Filter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key. Simple predicate example to check 'value < 100': ```json { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 100, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ``` Complex predicate example, to check 'value < 10 or value > 20': ```json { \"type\": \"COMPLEX\", \"operation\": \"OR\", \"predicates\": [ { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 10, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 20, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ] } ``` More complex predicate example, to check 'value < 10 or (value > 50 && value < 60)': ```json { \"type\": \"COMPLEX\", \"operation\": \"OR\", \"predicates\": [ { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 10, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"type\": \"COMPLEX\", \"operation\": \"AND\", \"predicates\": [ { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 50, \"dynamicValue\": null }, \"type\": \"NUMERIC\" }, { \"operation\": \"LESS\", \"value\": { \"userValue\": null, \"defaultValue\": 60, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } ] } ] } ``` You may also want to replace hardcoded values (for example, temperature > 20) with the more dynamic expression (for example, temperature > value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or device. See example below: ```json { \"operation\": \"GREATER\", \"value\": { \"userValue\": null, \"defaultValue\": 0, \"dynamicValue\": { \"inherit\": false, \"sourceType\": \"CURRENT_TENANT\", \"sourceAttribute\": \"temperatureThreshold\" } }, \"type\": \"NUMERIC\" } ``` Note that you may use 'CURRENT_DEVICE', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source. The 'sourceAttribute' can be inherited from the owner of the specified 'sourceType' if 'inherit' is set to true. # Provision Configuration There are 3 types of device provision configuration for the device profile: * 'DISABLED'; * 'ALLOW_CREATE_NEW_DEVICES'; * 'CHECK_PRE_PROVISIONED_DEVICES'. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details. # Transport Configuration 5 transport configuration types are available: * 'DEFAULT'; * 'MQTT'; * 'LWM2M'; * 'COAP'; * 'SNMP'. Default type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types. See another example of COAP transport configuration below: ```json { \"type\":\"COAP\", \"clientSettings\":{ \"edrxCycle\":null, \"powerMode\":\"DRX\", \"psmActivityTimer\":null, \"pagingTransmissionWindow\":null }, \"coapDeviceTypeConfiguration\":{ \"coapDeviceType\":\"DEFAULT\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"JSON\" } } } ```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. Available for users with 'TENANT_ADMIN' authority. + * Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. Device profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant. # Device profile data definition Device profile data object contains device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. ```json { \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"DISABLED\", \"provisionDeviceSecret\":null }, \"transportConfiguration\":{ \"type\":\"DEFAULT\" } } ``` ```json { \"configuration\":{ \"type\":\"DEFAULT\" }, \"provisionConfiguration\":{ \"type\":\"ALLOW_CREATE_NEW_DEVICES\", \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\" }, \"transportConfiguration\":{ \"type\":\"MQTT\", \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\", \"deviceAttributesTopic\":\"v1/devices/me/attributes\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"PROTOBUF\", \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\", \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\", \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\", \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\" } } } ``` Let's review some specific objects examples related to the device profile configuration:# Provision Configuration There are 3 types of device provision configuration for the device profile: * 'DISABLED'; * 'ALLOW_CREATE_NEW_DEVICES'; * 'CHECK_PRE_PROVISIONED_DEVICES'. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details. # Transport Configuration 5 transport configuration types are available: * 'DEFAULT'; * 'MQTT'; * 'LWM2M'; * 'COAP'; * 'SNMP'. Default type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types. See another example of COAP transport configuration below: ```json { \"type\":\"COAP\", \"clientSettings\":{ \"edrxCycle\":null, \"powerMode\":\"DRX\", \"psmActivityTimer\":null, \"pagingTransmissionWindow\":null }, \"coapDeviceTypeConfiguration\":{ \"coapDeviceType\":\"DEFAULT\", \"transportPayloadTypeConfiguration\":{ \"transportPayloadType\":\"JSON\" } } } ```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. Available for users with 'TENANT_ADMIN' authority. * @param deviceProfile (required) * @param headers Optional headers to include in the request * @return ApiResponse<DeviceProfile> @@ -38151,7 +38820,7 @@ private HttpRequest.Builder saveEntityAttributesV1RequestBuilder(@Nonnull String .replace("{entityId}", ApiClient.urlEncode(entityId.toString())) .replace("{scope}", ApiClient.urlEncode(scope.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -38249,7 +38918,7 @@ private HttpRequest.Builder saveEntityAttributesV2RequestBuilder(@Nonnull String .replace("{entityId}", ApiClient.urlEncode(entityId.toString())) .replace("{scope}", ApiClient.urlEncode(scope.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -38347,7 +39016,7 @@ private HttpRequest.Builder saveEntityTelemetryRequestBuilder(@Nonnull String en .replace("{entityId}", ApiClient.urlEncode(entityId.toString())) .replace("{scope}", ApiClient.urlEncode(scope.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -38452,7 +39121,7 @@ private HttpRequest.Builder saveEntityTelemetryWithTTLRequestBuilder(@Nonnull St .replace("{scope}", ApiClient.urlEncode(scope.toString())) .replace("{ttl}", ApiClient.urlEncode(ttl.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "text/plain"); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); if (memberVarReadTimeout != null) { @@ -42449,6 +43118,88 @@ private HttpRequest.Builder syncEdgeRequestBuilder(@Nonnull String edgeId, Map localVarResponse = testAlarmRuleScriptWithHttpInfo(body, null); + return localVarResponse.getData(); + } + + /** + * Test alarm rule TBEL expression (testAlarmRuleScript) + * Execute the alarm rule TBEL condition expression and return the result. Alarm rule expressions must return a boolean value. The format of request: ```json { \"expression\": \"return temperature > 50;\", \"arguments\": { \"temperature\": { \"type\": \"SINGLE_VALUE\", \"ts\": 1739776478057, \"value\": 55 } } } ``` Expected result JSON contains \"output\" and \"error\". Available for users with 'TENANT_ADMIN' authority. + * @param body Test alarm rule TBEL condition expression. The expression must return a boolean value. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<com.fasterxml.jackson.databind.JsonNode> + * @throws ApiException if fails to make API call + */ + public ApiResponse testAlarmRuleScriptWithHttpInfo(@Nullable Object body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testAlarmRuleScriptRequestBuilder(body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testAlarmRuleScript", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } + String responseBody = new String(localVarResponseBody.readAllBytes()); + com.fasterxml.jackson.databind.JsonNode responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testAlarmRuleScriptRequestBuilder(@Nullable Object body, Map headers) throws ApiException { + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testAlarmRuleScript"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/alarm/rule/testScript"; + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** * Test Script expression * Execute the Script expression and return the result. The format of request: ```json { \"expression\": \"var temp = 0; foreach(element: temperature.values) {temp += element.value;} var avgTemperature = temp / temperature.values.size(); var adjustedTemperature = avgTemperature + 0.1 * humidity.value; return {\\\"adjustedTemperature\\\": adjustedTemperature};\", \"arguments\": { \"temperature\": { \"type\": \"TS_ROLLING\", \"timeWindow\": { \"startTs\": 1739775630002, \"endTs\": 65432211, \"limit\": 5 }, \"values\": [ { \"ts\": 1739775639851, \"value\": 23 }, { \"ts\": 1739775664561, \"value\": 43 }, { \"ts\": 1739775713079, \"value\": 15 }, { \"ts\": 1739775999522, \"value\": 34 }, { \"ts\": 1739776228452, \"value\": 22 } ] }, \"humidity\": { \"type\": \"SINGLE_VALUE\", \"ts\": 1739776478057, \"value\": 23 } } } ``` Expected result JSON contains \"output\" and \"error\". Available for users with 'TENANT_ADMIN' authority. diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmCondition.java b/ce/src/main/java/org/thingsboard/client/model/AlarmCondition.java deleted file mode 100644 index 1252f57a..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AlarmCondition.java +++ /dev/null @@ -1,208 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.thingsboard.client.model.AlarmConditionFilter; -import org.thingsboard.client.model.AlarmConditionSpec; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * AlarmCondition - */ -@JsonPropertyOrder({ - AlarmCondition.JSON_PROPERTY_CONDITION, - AlarmCondition.JSON_PROPERTY_SPEC -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class AlarmCondition { - public static final String JSON_PROPERTY_CONDITION = "condition"; - @Nullable - private List condition = new ArrayList<>(); - - public static final String JSON_PROPERTY_SPEC = "spec"; - @Nullable - private AlarmConditionSpec spec; - - public AlarmCondition() { - } - - public AlarmCondition condition(@Nullable List condition) { - this.condition = condition; - return this; - } - - public AlarmCondition addConditionItem(AlarmConditionFilter conditionItem) { - if (this.condition == null) { - this.condition = new ArrayList<>(); - } - this.condition.add(conditionItem); - return this; - } - - /** - * Get condition - * @return condition - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_CONDITION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCondition() { - return condition; - } - - - @JsonProperty(value = JSON_PROPERTY_CONDITION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCondition(@Nullable List condition) { - this.condition = condition; - } - - - public AlarmCondition spec(@Nullable AlarmConditionSpec spec) { - this.spec = spec; - return this; - } - - /** - * JSON object representing alarm condition type - * @return spec - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_SPEC, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AlarmConditionSpec getSpec() { - return spec; - } - - - @JsonProperty(value = JSON_PROPERTY_SPEC, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSpec(@Nullable AlarmConditionSpec spec) { - this.spec = spec; - } - - - /** - * Return true if this AlarmCondition object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlarmCondition alarmCondition = (AlarmCondition) o; - return Objects.equals(this.condition, alarmCondition.condition) && - Objects.equals(this.spec, alarmCondition.spec); - } - - @Override - public int hashCode() { - return Objects.hash(condition, spec); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AlarmCondition {\n"); - sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); - sb.append(" spec: ").append(toIndentedString(spec)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `condition` to the URL query string - if (getCondition() != null) { - for (int i = 0; i < getCondition().size(); i++) { - if (getCondition().get(i) != null) { - joiner.add(getCondition().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%scondition%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); - } - } - } - - // add `spec` to the URL query string - if (getSpec() != null) { - joiner.add(getSpec().toUrlQueryString(prefix + "spec" + suffix)); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmConditionFilter.java b/ce/src/main/java/org/thingsboard/client/model/AlarmConditionFilter.java deleted file mode 100644 index 7fca76b0..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AlarmConditionFilter.java +++ /dev/null @@ -1,288 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; -import org.thingsboard.client.model.AlarmConditionFilterKey; -import org.thingsboard.client.model.EntityKeyValueType; -import org.thingsboard.client.model.KeyFilterPredicate; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * AlarmConditionFilter - */ -@JsonPropertyOrder({ - AlarmConditionFilter.JSON_PROPERTY_VALUE_TYPE, - AlarmConditionFilter.JSON_PROPERTY_KEY, - AlarmConditionFilter.JSON_PROPERTY_PREDICATE, - AlarmConditionFilter.JSON_PROPERTY_VALUE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class AlarmConditionFilter { - public static final String JSON_PROPERTY_VALUE_TYPE = "valueType"; - @Nullable - private EntityKeyValueType valueType; - - public static final String JSON_PROPERTY_KEY = "key"; - @Nullable - private AlarmConditionFilterKey key; - - public static final String JSON_PROPERTY_PREDICATE = "predicate"; - @Nullable - private KeyFilterPredicate predicate; - - public static final String JSON_PROPERTY_VALUE = "value"; - private JsonNullable value = JsonNullable.of(null); - - public AlarmConditionFilter() { - } - - public AlarmConditionFilter valueType(@Nullable EntityKeyValueType valueType) { - this.valueType = valueType; - return this; - } - - /** - * String representation of the type of the value - * @return valueType - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_VALUE_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EntityKeyValueType getValueType() { - return valueType; - } - - - @JsonProperty(value = JSON_PROPERTY_VALUE_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValueType(@Nullable EntityKeyValueType valueType) { - this.valueType = valueType; - } - - - public AlarmConditionFilter key(@Nullable AlarmConditionFilterKey key) { - this.key = key; - return this; - } - - /** - * JSON object for specifying alarm condition by specific key - * @return key - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_KEY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AlarmConditionFilterKey getKey() { - return key; - } - - - @JsonProperty(value = JSON_PROPERTY_KEY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKey(@Nullable AlarmConditionFilterKey key) { - this.key = key; - } - - - public AlarmConditionFilter predicate(@Nullable KeyFilterPredicate predicate) { - this.predicate = predicate; - return this; - } - - /** - * JSON object representing filter condition - * @return predicate - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_PREDICATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public KeyFilterPredicate getPredicate() { - return predicate; - } - - - @JsonProperty(value = JSON_PROPERTY_PREDICATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPredicate(@Nullable KeyFilterPredicate predicate) { - this.predicate = predicate; - } - - - public AlarmConditionFilter value(@Nullable Object value) { - this.value = JsonNullable.of(value); - return this; - } - - /** - * Get value - * @return value - */ - @Nullable - @JsonIgnore - public Object getValue() { - return value.orElse(null); - } - - @JsonProperty(value = JSON_PROPERTY_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getValue_JsonNullable() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - public void setValue_JsonNullable(JsonNullable value) { - this.value = value; - } - - public void setValue(@Nullable Object value) { - this.value = JsonNullable.of(value); - } - - - /** - * Return true if this AlarmConditionFilter object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlarmConditionFilter alarmConditionFilter = (AlarmConditionFilter) o; - return Objects.equals(this.valueType, alarmConditionFilter.valueType) && - Objects.equals(this.key, alarmConditionFilter.key) && - Objects.equals(this.predicate, alarmConditionFilter.predicate) && - equalsNullable(this.value, alarmConditionFilter.value); - } - - 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(valueType, key, predicate, hashCodeNullable(value)); - } - - 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 AlarmConditionFilter {\n"); - sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" predicate: ").append(toIndentedString(predicate)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `valueType` to the URL query string - if (getValueType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%svalueType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getValueType())))); - } - - // add `key` to the URL query string - if (getKey() != null) { - joiner.add(getKey().toUrlQueryString(prefix + "key" + suffix)); - } - - // add `predicate` to the URL query string - if (getPredicate() != null) { - joiner.add(getPredicate().toUrlQueryString(prefix + "predicate" + suffix)); - } - - // add `value` to the URL query string - if (getValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%svalue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getValue())))); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmConditionFilterKey.java b/ce/src/main/java/org/thingsboard/client/model/AlarmConditionFilterKey.java deleted file mode 100644 index e3fc6887..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AlarmConditionFilterKey.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.AlarmConditionKeyType; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * AlarmConditionFilterKey - */ -@JsonPropertyOrder({ - AlarmConditionFilterKey.JSON_PROPERTY_TYPE, - AlarmConditionFilterKey.JSON_PROPERTY_KEY -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class AlarmConditionFilterKey { - public static final String JSON_PROPERTY_TYPE = "type"; - @Nullable - private AlarmConditionKeyType type; - - public static final String JSON_PROPERTY_KEY = "key"; - @Nullable - private String key; - - public AlarmConditionFilterKey() { - } - - public AlarmConditionFilterKey type(@Nullable AlarmConditionKeyType type) { - this.type = type; - return this; - } - - /** - * The key type - * @return type - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AlarmConditionKeyType getType() { - return type; - } - - - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@Nullable AlarmConditionKeyType type) { - this.type = type; - } - - - public AlarmConditionFilterKey key(@Nullable String key) { - this.key = key; - return this; - } - - /** - * String value representing the key - * @return key - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_KEY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getKey() { - return key; - } - - - @JsonProperty(value = JSON_PROPERTY_KEY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKey(@Nullable String key) { - this.key = key; - } - - - /** - * Return true if this AlarmConditionFilterKey object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlarmConditionFilterKey alarmConditionFilterKey = (AlarmConditionFilterKey) o; - return Objects.equals(this.type, alarmConditionFilterKey.type) && - Objects.equals(this.key, alarmConditionFilterKey.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AlarmConditionFilterKey {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - // add `key` to the URL query string - if (getKey() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%skey%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKey())))); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmConditionKeyType.java b/ce/src/main/java/org/thingsboard/client/model/AlarmConditionKeyType.java deleted file mode 100644 index d73758e9..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AlarmConditionKeyType.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets AlarmConditionKeyType - */ -public enum AlarmConditionKeyType { - - ATTRIBUTE("ATTRIBUTE"), - - TIME_SERIES("TIME_SERIES"), - - ENTITY_FIELD("ENTITY_FIELD"), - - CONSTANT("CONSTANT"); - - private String value; - - AlarmConditionKeyType(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static AlarmConditionKeyType fromValue(String value) { - for (AlarmConditionKeyType b : AlarmConditionKeyType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - if (prefix == null) { - prefix = ""; - } - - return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); - } - -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmConditionSpec.java b/ce/src/main/java/org/thingsboard/client/model/AlarmConditionSpec.java deleted file mode 100644 index 3b97c290..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AlarmConditionSpec.java +++ /dev/null @@ -1,179 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nonnull; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.JSON; -import org.thingsboard.client.ApiClient; -/** - * Specification for alarm conditions - */ -@JsonPropertyOrder({ - AlarmConditionSpec.JSON_PROPERTY_TYPE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -@JsonIgnoreProperties( - value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = DurationAlarmConditionSpec.class, name = "DURATION"), - @JsonSubTypes.Type(value = RepeatingAlarmConditionSpec.class, name = "REPEATING"), - @JsonSubTypes.Type(value = SimpleAlarmConditionSpec.class, name = "SIMPLE"), -}) - -public class AlarmConditionSpec { - public static final String JSON_PROPERTY_TYPE = "type"; - @Nonnull - private String type; - - public AlarmConditionSpec() { - } - - public AlarmConditionSpec type(@Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@Nonnull String type) { - this.type = type; - } - - - /** - * Return true if this AlarmConditionSpec object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlarmConditionSpec alarmConditionSpec = (AlarmConditionSpec) o; - return Objects.equals(this.type, alarmConditionSpec.type); - } - - @Override - public int hashCode() { - return Objects.hash(type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AlarmConditionSpec {\n"); - sb.append(" type: ").append(toIndentedString(type)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("DURATION", DurationAlarmConditionSpec.class); - mappings.put("REPEATING", RepeatingAlarmConditionSpec.class); - mappings.put("SIMPLE", SimpleAlarmConditionSpec.class); - mappings.put("AlarmConditionSpec", AlarmConditionSpec.class); - JSON.registerDiscriminator(AlarmConditionSpec.class, "type", mappings); -} -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmRule.java b/ce/src/main/java/org/thingsboard/client/model/AlarmRule.java deleted file mode 100644 index 284bb26c..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AlarmRule.java +++ /dev/null @@ -1,266 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.AlarmCondition; -import org.thingsboard.client.model.AlarmSchedule; -import org.thingsboard.client.model.DashboardId; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * AlarmRule - */ -@JsonPropertyOrder({ - AlarmRule.JSON_PROPERTY_CONDITION, - AlarmRule.JSON_PROPERTY_ALARM_DETAILS, - AlarmRule.JSON_PROPERTY_DASHBOARD_ID, - AlarmRule.JSON_PROPERTY_SCHEDULE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class AlarmRule { - public static final String JSON_PROPERTY_CONDITION = "condition"; - @Nullable - private AlarmCondition condition; - - public static final String JSON_PROPERTY_ALARM_DETAILS = "alarmDetails"; - @Nullable - private String alarmDetails; - - public static final String JSON_PROPERTY_DASHBOARD_ID = "dashboardId"; - @Nullable - private DashboardId dashboardId; - - public static final String JSON_PROPERTY_SCHEDULE = "schedule"; - @Nullable - private AlarmSchedule schedule; - - public AlarmRule() { - } - - public AlarmRule condition(@Nullable AlarmCondition condition) { - this.condition = condition; - return this; - } - - /** - * JSON object representing the alarm rule condition - * @return condition - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_CONDITION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AlarmCondition getCondition() { - return condition; - } - - - @JsonProperty(value = JSON_PROPERTY_CONDITION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCondition(@Nullable AlarmCondition condition) { - this.condition = condition; - } - - - public AlarmRule alarmDetails(@Nullable String alarmDetails) { - this.alarmDetails = alarmDetails; - return this; - } - - /** - * String value representing the additional details for an alarm rule - * @return alarmDetails - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_ALARM_DETAILS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAlarmDetails() { - return alarmDetails; - } - - - @JsonProperty(value = JSON_PROPERTY_ALARM_DETAILS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAlarmDetails(@Nullable String alarmDetails) { - this.alarmDetails = alarmDetails; - } - - - public AlarmRule dashboardId(@Nullable DashboardId dashboardId) { - this.dashboardId = dashboardId; - return this; - } - - /** - * JSON object with the dashboard Id representing the reference to alarm details dashboard used by mobile application - * @return dashboardId - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_DASHBOARD_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DashboardId getDashboardId() { - return dashboardId; - } - - - @JsonProperty(value = JSON_PROPERTY_DASHBOARD_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDashboardId(@Nullable DashboardId dashboardId) { - this.dashboardId = dashboardId; - } - - - public AlarmRule schedule(@Nullable AlarmSchedule schedule) { - this.schedule = schedule; - return this; - } - - /** - * JSON object representing time interval during which the rule is active - * @return schedule - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_SCHEDULE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AlarmSchedule getSchedule() { - return schedule; - } - - - @JsonProperty(value = JSON_PROPERTY_SCHEDULE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSchedule(@Nullable AlarmSchedule schedule) { - this.schedule = schedule; - } - - - /** - * Return true if this AlarmRule object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlarmRule alarmRule = (AlarmRule) o; - return Objects.equals(this.condition, alarmRule.condition) && - Objects.equals(this.alarmDetails, alarmRule.alarmDetails) && - Objects.equals(this.dashboardId, alarmRule.dashboardId) && - Objects.equals(this.schedule, alarmRule.schedule); - } - - @Override - public int hashCode() { - return Objects.hash(condition, alarmDetails, dashboardId, schedule); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AlarmRule {\n"); - sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); - sb.append(" alarmDetails: ").append(toIndentedString(alarmDetails)).append("\n"); - sb.append(" dashboardId: ").append(toIndentedString(dashboardId)).append("\n"); - sb.append(" schedule: ").append(toIndentedString(schedule)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `condition` to the URL query string - if (getCondition() != null) { - joiner.add(getCondition().toUrlQueryString(prefix + "condition" + suffix)); - } - - // add `alarmDetails` to the URL query string - if (getAlarmDetails() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%salarmDetails%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAlarmDetails())))); - } - - // add `dashboardId` to the URL query string - if (getDashboardId() != null) { - joiner.add(getDashboardId().toUrlQueryString(prefix + "dashboardId" + suffix)); - } - - // add `schedule` to the URL query string - if (getSchedule() != null) { - joiner.add(getSchedule().toUrlQueryString(prefix + "schedule" + suffix)); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmRuleDefinitionInfo.java b/ce/src/main/java/org/thingsboard/client/model/AlarmRuleDefinitionInfo.java new file mode 100644 index 00000000..b969d54d --- /dev/null +++ b/ce/src/main/java/org/thingsboard/client/model/AlarmRuleDefinitionInfo.java @@ -0,0 +1,557 @@ +/** + * Copyright © 2026-2026 ThingsBoard, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.client.model; + +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.thingsboard.client.model.AlarmCalculatedFieldConfiguration; +import org.thingsboard.client.model.CalculatedFieldId; +import org.thingsboard.client.model.DebugSettings; +import org.thingsboard.client.model.EntityId; +import org.thingsboard.client.model.TenantId; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.thingsboard.client.ApiClient; +/** + * AlarmRuleDefinitionInfo + */ +@JsonPropertyOrder({ + AlarmRuleDefinitionInfo.JSON_PROPERTY_ID, + AlarmRuleDefinitionInfo.JSON_PROPERTY_CREATED_TIME, + AlarmRuleDefinitionInfo.JSON_PROPERTY_TENANT_ID, + AlarmRuleDefinitionInfo.JSON_PROPERTY_ENTITY_ID, + AlarmRuleDefinitionInfo.JSON_PROPERTY_NAME, + AlarmRuleDefinitionInfo.JSON_PROPERTY_DEBUG_SETTINGS, + AlarmRuleDefinitionInfo.JSON_PROPERTY_CONFIGURATION_VERSION, + AlarmRuleDefinitionInfo.JSON_PROPERTY_CONFIGURATION, + AlarmRuleDefinitionInfo.JSON_PROPERTY_VERSION, + AlarmRuleDefinitionInfo.JSON_PROPERTY_ADDITIONAL_INFO, + AlarmRuleDefinitionInfo.JSON_PROPERTY_ENTITY_NAME, + AlarmRuleDefinitionInfo.JSON_PROPERTY_DEBUG_MODE +}) +@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") +public class AlarmRuleDefinitionInfo { + public static final String JSON_PROPERTY_ID = "id"; + @Nullable + private CalculatedFieldId id; + + public static final String JSON_PROPERTY_CREATED_TIME = "createdTime"; + @Nullable + private Long createdTime; + + public static final String JSON_PROPERTY_TENANT_ID = "tenantId"; + @Nullable + private TenantId tenantId; + + public static final String JSON_PROPERTY_ENTITY_ID = "entityId"; + @Nullable + private EntityId entityId; + + public static final String JSON_PROPERTY_NAME = "name"; + @Nullable + private String name; + + public static final String JSON_PROPERTY_DEBUG_SETTINGS = "debugSettings"; + @Nullable + private DebugSettings debugSettings; + + public static final String JSON_PROPERTY_CONFIGURATION_VERSION = "configurationVersion"; + @Nullable + private Integer configurationVersion; + + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; + @Nonnull + private AlarmCalculatedFieldConfiguration _configuration; + + public static final String JSON_PROPERTY_VERSION = "version"; + @Nullable + private Long version; + + public static final String JSON_PROPERTY_ADDITIONAL_INFO = "additionalInfo"; + @Nullable + private com.fasterxml.jackson.databind.JsonNode additionalInfo; + + public static final String JSON_PROPERTY_ENTITY_NAME = "entityName"; + @Nullable + private String entityName; + + public static final String JSON_PROPERTY_DEBUG_MODE = "debugMode"; + @Nullable + private Boolean debugMode; + + public AlarmRuleDefinitionInfo() { + } + + @JsonCreator + public AlarmRuleDefinitionInfo( + @JsonProperty(JSON_PROPERTY_CREATED_TIME) Long createdTime + ) { + this(); + this.createdTime = createdTime; + } + + public AlarmRuleDefinitionInfo id(@Nullable CalculatedFieldId id) { + this.id = id; + return this; + } + + /** + * JSON object with the Alarm Rule Id. Referencing non-existing Alarm Rule Id will cause error. + * @return id + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CalculatedFieldId getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@Nullable CalculatedFieldId id) { + this.id = id; + } + + + /** + * Timestamp of the alarm rule creation, in milliseconds + * @return createdTime + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCreatedTime() { + return createdTime; + } + + + + + public AlarmRuleDefinitionInfo tenantId(@Nullable TenantId tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get tenantId + * @return tenantId + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_TENANT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TenantId getTenantId() { + return tenantId; + } + + + @JsonProperty(value = JSON_PROPERTY_TENANT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTenantId(@Nullable TenantId tenantId) { + this.tenantId = tenantId; + } + + + public AlarmRuleDefinitionInfo entityId(@Nullable EntityId entityId) { + this.entityId = entityId; + return this; + } + + /** + * Get entityId + * @return entityId + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_ENTITY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EntityId getEntityId() { + return entityId; + } + + + @JsonProperty(value = JSON_PROPERTY_ENTITY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEntityId(@Nullable EntityId entityId) { + this.entityId = entityId; + } + + + public AlarmRuleDefinitionInfo name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * User defined name of the alarm rule. + * @return name + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@Nullable String name) { + this.name = name; + } + + + public AlarmRuleDefinitionInfo debugSettings(@Nullable DebugSettings debugSettings) { + this.debugSettings = debugSettings; + return this; + } + + /** + * Debug settings object. + * @return debugSettings + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_DEBUG_SETTINGS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DebugSettings getDebugSettings() { + return debugSettings; + } + + + @JsonProperty(value = JSON_PROPERTY_DEBUG_SETTINGS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDebugSettings(@Nullable DebugSettings debugSettings) { + this.debugSettings = debugSettings; + } + + + public AlarmRuleDefinitionInfo configurationVersion(@Nullable Integer configurationVersion) { + this.configurationVersion = configurationVersion; + return this; + } + + /** + * Version of alarm rule configuration. + * @return configurationVersion + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_CONFIGURATION_VERSION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getConfigurationVersion() { + return configurationVersion; + } + + + @JsonProperty(value = JSON_PROPERTY_CONFIGURATION_VERSION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigurationVersion(@Nullable Integer configurationVersion) { + this.configurationVersion = configurationVersion; + } + + + public AlarmRuleDefinitionInfo _configuration(@Nonnull AlarmCalculatedFieldConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * @return _configuration + */ + @Nonnull + @JsonProperty(value = JSON_PROPERTY_CONFIGURATION, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AlarmCalculatedFieldConfiguration getConfiguration() { + return _configuration; + } + + + @JsonProperty(value = JSON_PROPERTY_CONFIGURATION, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setConfiguration(@Nonnull AlarmCalculatedFieldConfiguration _configuration) { + this._configuration = _configuration; + } + + + public AlarmRuleDefinitionInfo version(@Nullable Long version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + + @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@Nullable Long version) { + this.version = version; + } + + + public AlarmRuleDefinitionInfo additionalInfo(@Nullable com.fasterxml.jackson.databind.JsonNode additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + /** + * Additional parameters of the alarm rule. May include: 'description' (string). + * @return additionalInfo + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_ADDITIONAL_INFO, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public com.fasterxml.jackson.databind.JsonNode getAdditionalInfo() { + return additionalInfo; + } + + + @JsonProperty(value = JSON_PROPERTY_ADDITIONAL_INFO, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalInfo(@Nullable com.fasterxml.jackson.databind.JsonNode additionalInfo) { + this.additionalInfo = additionalInfo; + } + + + public AlarmRuleDefinitionInfo entityName(@Nullable String entityName) { + this.entityName = entityName; + return this; + } + + /** + * Get entityName + * @return entityName + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_ENTITY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEntityName() { + return entityName; + } + + + @JsonProperty(value = JSON_PROPERTY_ENTITY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEntityName(@Nullable String entityName) { + this.entityName = entityName; + } + + + public AlarmRuleDefinitionInfo debugMode(@Nullable Boolean debugMode) { + this.debugMode = debugMode; + return this; + } + + /** + * Get debugMode + * @return debugMode + * @deprecated + */ + @Deprecated + @Nullable + @JsonProperty(value = JSON_PROPERTY_DEBUG_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDebugMode() { + return debugMode; + } + + + @JsonProperty(value = JSON_PROPERTY_DEBUG_MODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDebugMode(@Nullable Boolean debugMode) { + this.debugMode = debugMode; + } + + + /** + * Return true if this AlarmRuleDefinitionInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlarmRuleDefinitionInfo alarmRuleDefinitionInfo = (AlarmRuleDefinitionInfo) o; + return Objects.equals(this.id, alarmRuleDefinitionInfo.id) && + Objects.equals(this.createdTime, alarmRuleDefinitionInfo.createdTime) && + Objects.equals(this.tenantId, alarmRuleDefinitionInfo.tenantId) && + Objects.equals(this.entityId, alarmRuleDefinitionInfo.entityId) && + Objects.equals(this.name, alarmRuleDefinitionInfo.name) && + Objects.equals(this.debugSettings, alarmRuleDefinitionInfo.debugSettings) && + Objects.equals(this.configurationVersion, alarmRuleDefinitionInfo.configurationVersion) && + Objects.equals(this._configuration, alarmRuleDefinitionInfo._configuration) && + Objects.equals(this.version, alarmRuleDefinitionInfo.version) && + Objects.equals(this.additionalInfo, alarmRuleDefinitionInfo.additionalInfo) && + Objects.equals(this.entityName, alarmRuleDefinitionInfo.entityName) && + Objects.equals(this.debugMode, alarmRuleDefinitionInfo.debugMode); + } + + @Override + public int hashCode() { + return Objects.hash(id, createdTime, tenantId, entityId, name, debugSettings, configurationVersion, _configuration, version, additionalInfo, entityName, debugMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlarmRuleDefinitionInfo {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" createdTime: ").append(toIndentedString(createdTime)).append("\n"); + sb.append(" tenantId: ").append(toIndentedString(tenantId)).append("\n"); + sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" debugSettings: ").append(toIndentedString(debugSettings)).append("\n"); + sb.append(" configurationVersion: ").append(toIndentedString(configurationVersion)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" entityName: ").append(toIndentedString(entityName)).append("\n"); + sb.append(" debugMode: ").append(toIndentedString(debugMode)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(getId().toUrlQueryString(prefix + "id" + suffix)); + } + + // add `createdTime` to the URL query string + if (getCreatedTime() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screatedTime%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedTime())))); + } + + // add `tenantId` to the URL query string + if (getTenantId() != null) { + joiner.add(getTenantId().toUrlQueryString(prefix + "tenantId" + suffix)); + } + + // add `entityId` to the URL query string + if (getEntityId() != null) { + joiner.add(getEntityId().toUrlQueryString(prefix + "entityId" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `debugSettings` to the URL query string + if (getDebugSettings() != null) { + joiner.add(getDebugSettings().toUrlQueryString(prefix + "debugSettings" + suffix)); + } + + // add `configurationVersion` to the URL query string + if (getConfigurationVersion() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sconfigurationVersion%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getConfigurationVersion())))); + } + + // add `configuration` to the URL query string + if (getConfiguration() != null) { + joiner.add(getConfiguration().toUrlQueryString(prefix + "configuration" + suffix)); + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sversion%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `additionalInfo` to the URL query string + if (getAdditionalInfo() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sadditionalInfo%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAdditionalInfo())))); + } + + // add `entityName` to the URL query string + if (getEntityName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sentityName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEntityName())))); + } + + // add `debugMode` to the URL query string + if (getDebugMode() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdebugMode%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDebugMode())))); + } + + return joiner.toString(); + } +} + diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmSchedule.java b/ce/src/main/java/org/thingsboard/client/model/AlarmSchedule.java deleted file mode 100644 index cb692de3..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AlarmSchedule.java +++ /dev/null @@ -1,217 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.AlarmScheduleType; -import org.thingsboard.client.model.DynamicValueString; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.JSON; -import org.thingsboard.client.ApiClient; -/** - * Configuration for alarm schedule - */ -@JsonPropertyOrder({ - AlarmSchedule.JSON_PROPERTY_DYNAMIC_VALUE, - AlarmSchedule.JSON_PROPERTY_TYPE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -@JsonIgnoreProperties( - value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = AnyTimeSchedule.class, name = "ANY_TIME"), - @JsonSubTypes.Type(value = CustomTimeSchedule.class, name = "CUSTOM"), - @JsonSubTypes.Type(value = SpecificTimeSchedule.class, name = "SPECIFIC_TIME"), -}) - -public class AlarmSchedule { - public static final String JSON_PROPERTY_DYNAMIC_VALUE = "dynamicValue"; - @Nullable - private DynamicValueString dynamicValue; - - public static final String JSON_PROPERTY_TYPE = "type"; - @Nullable - private AlarmScheduleType type; - - public AlarmSchedule() { - } - - public AlarmSchedule dynamicValue(@Nullable DynamicValueString dynamicValue) { - this.dynamicValue = dynamicValue; - return this; - } - - /** - * Get dynamicValue - * @return dynamicValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_DYNAMIC_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DynamicValueString getDynamicValue() { - return dynamicValue; - } - - - @JsonProperty(value = JSON_PROPERTY_DYNAMIC_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDynamicValue(@Nullable DynamicValueString dynamicValue) { - this.dynamicValue = dynamicValue; - } - - - public AlarmSchedule type(@Nullable AlarmScheduleType type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AlarmScheduleType getType() { - return type; - } - - - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@Nullable AlarmScheduleType type) { - this.type = type; - } - - - /** - * Return true if this AlarmSchedule object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlarmSchedule alarmSchedule = (AlarmSchedule) o; - return Objects.equals(this.dynamicValue, alarmSchedule.dynamicValue) && - Objects.equals(this.type, alarmSchedule.type); - } - - @Override - public int hashCode() { - return Objects.hash(dynamicValue, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AlarmSchedule {\n"); - sb.append(" dynamicValue: ").append(toIndentedString(dynamicValue)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `dynamicValue` to the URL query string - if (getDynamicValue() != null) { - joiner.add(getDynamicValue().toUrlQueryString(prefix + "dynamicValue" + suffix)); - } - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ANY_TIME", AnyTimeSchedule.class); - mappings.put("CUSTOM", CustomTimeSchedule.class); - mappings.put("SPECIFIC_TIME", SpecificTimeSchedule.class); - mappings.put("AlarmSchedule", AlarmSchedule.class); - JSON.registerDiscriminator(AlarmSchedule.class, "type", mappings); -} -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AlarmScheduleType.java b/ce/src/main/java/org/thingsboard/client/model/AlarmScheduleType.java deleted file mode 100644 index 06e2e5af..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AlarmScheduleType.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets AlarmScheduleType - */ -public enum AlarmScheduleType { - - ANY_TIME("ANY_TIME"), - - SPECIFIC_TIME("SPECIFIC_TIME"), - - CUSTOM("CUSTOM"); - - private String value; - - AlarmScheduleType(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static AlarmScheduleType fromValue(String value) { - for (AlarmScheduleType b : AlarmScheduleType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - if (prefix == null) { - prefix = ""; - } - - return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); - } - -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AnyTimeSchedule.java b/ce/src/main/java/org/thingsboard/client/model/AnyTimeSchedule.java deleted file mode 100644 index 21050051..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/AnyTimeSchedule.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.AlarmSchedule; -import org.thingsboard.client.model.AlarmScheduleType; -import org.thingsboard.client.model.DynamicValueString; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.JSON; -import org.thingsboard.client.ApiClient; -/** - * AnyTimeSchedule - */ -@JsonPropertyOrder({ -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -@JsonIgnoreProperties( - value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) - -public class AnyTimeSchedule extends AlarmSchedule { - public AnyTimeSchedule() { - } - - @Override - public AnyTimeSchedule dynamicValue(@Nullable DynamicValueString dynamicValue) { - this.setDynamicValue(dynamicValue); - return this; - } - - /** - * Return true if this AnyTimeSchedule object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnyTimeSchedule {\n"); - sb.append(" ").append(toIndentedString(super.toString())).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `dynamicValue` to the URL query string - if (getDynamicValue() != null) { - joiner.add(getDynamicValue().toUrlQueryString(prefix + "dynamicValue" + suffix)); - } - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("AnyTimeSchedule", AnyTimeSchedule.class); - JSON.registerDiscriminator(AnyTimeSchedule.class, "type", mappings); -} -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/AssetProfileInfo.java b/ce/src/main/java/org/thingsboard/client/model/AssetProfileInfo.java index 2bfc800c..c87418a5 100644 --- a/ce/src/main/java/org/thingsboard/client/model/AssetProfileInfo.java +++ b/ce/src/main/java/org/thingsboard/client/model/AssetProfileInfo.java @@ -29,8 +29,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; +import org.thingsboard.client.model.AssetProfileId; import org.thingsboard.client.model.DashboardId; -import org.thingsboard.client.model.EntityId; import org.thingsboard.client.model.TenantId; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +50,7 @@ public class AssetProfileInfo { public static final String JSON_PROPERTY_ID = "id"; @Nullable - private EntityId id; + private AssetProfileId id; public static final String JSON_PROPERTY_NAME = "name"; @Nullable @@ -71,26 +71,26 @@ public class AssetProfileInfo { public AssetProfileInfo() { } - public AssetProfileInfo id(@Nullable EntityId id) { + public AssetProfileInfo id(@Nullable AssetProfileId id) { this.id = id; return this; } /** - * JSON object with the entity Id. + * JSON object with the Asset Profile Id. * @return id */ @Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EntityId getId() { + public AssetProfileId getId() { return id; } @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@Nullable EntityId id) { + public void setId(@Nullable AssetProfileId id) { this.id = id; } diff --git a/ce/src/main/java/org/thingsboard/client/model/CustomTimeSchedule.java b/ce/src/main/java/org/thingsboard/client/model/CustomTimeSchedule.java deleted file mode 100644 index a6d1c480..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/CustomTimeSchedule.java +++ /dev/null @@ -1,244 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.thingsboard.client.model.AlarmSchedule; -import org.thingsboard.client.model.AlarmScheduleType; -import org.thingsboard.client.model.CustomTimeScheduleItem; -import org.thingsboard.client.model.DynamicValueString; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.JSON; -import org.thingsboard.client.ApiClient; -/** - * CustomTimeSchedule - */ -@JsonPropertyOrder({ - CustomTimeSchedule.JSON_PROPERTY_TIMEZONE, - CustomTimeSchedule.JSON_PROPERTY_ITEMS -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -@JsonIgnoreProperties( - value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) - -public class CustomTimeSchedule extends AlarmSchedule { - public static final String JSON_PROPERTY_TIMEZONE = "timezone"; - @Nullable - private String timezone; - - public static final String JSON_PROPERTY_ITEMS = "items"; - @Nullable - private List items = new ArrayList<>(); - - public CustomTimeSchedule() { - } - - public CustomTimeSchedule timezone(@Nullable String timezone) { - this.timezone = timezone; - return this; - } - - /** - * Get timezone - * @return timezone - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTimezone() { - return timezone; - } - - - @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTimezone(@Nullable String timezone) { - this.timezone = timezone; - } - - - public CustomTimeSchedule items(@Nullable List items) { - this.items = items; - return this; - } - - public CustomTimeSchedule addItemsItem(CustomTimeScheduleItem itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * Get items - * @return items - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_ITEMS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getItems() { - return items; - } - - - @JsonProperty(value = JSON_PROPERTY_ITEMS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setItems(@Nullable List items) { - this.items = items; - } - - - @Override - public CustomTimeSchedule dynamicValue(@Nullable DynamicValueString dynamicValue) { - this.setDynamicValue(dynamicValue); - return this; - } - - /** - * Return true if this CustomTimeSchedule object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CustomTimeSchedule customTimeSchedule = (CustomTimeSchedule) o; - return Objects.equals(this.timezone, customTimeSchedule.timezone) && - Objects.equals(this.items, customTimeSchedule.items) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(timezone, items, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CustomTimeSchedule {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `dynamicValue` to the URL query string - if (getDynamicValue() != null) { - joiner.add(getDynamicValue().toUrlQueryString(prefix + "dynamicValue" + suffix)); - } - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - // add `timezone` to the URL query string - if (getTimezone() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stimezone%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTimezone())))); - } - - // add `items` to the URL query string - if (getItems() != null) { - for (int i = 0; i < getItems().size(); i++) { - if (getItems().get(i) != null) { - joiner.add(getItems().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sitems%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); - } - } - } - - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("CustomTimeSchedule", CustomTimeSchedule.class); - JSON.registerDiscriminator(CustomTimeSchedule.class, "type", mappings); -} -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/CustomTimeScheduleItem.java b/ce/src/main/java/org/thingsboard/client/model/CustomTimeScheduleItem.java deleted file mode 100644 index 6264ab9b..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/CustomTimeScheduleItem.java +++ /dev/null @@ -1,263 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * CustomTimeScheduleItem - */ -@JsonPropertyOrder({ - CustomTimeScheduleItem.JSON_PROPERTY_DAY_OF_WEEK, - CustomTimeScheduleItem.JSON_PROPERTY_ENABLED, - CustomTimeScheduleItem.JSON_PROPERTY_ENDS_ON, - CustomTimeScheduleItem.JSON_PROPERTY_STARTS_ON -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class CustomTimeScheduleItem { - public static final String JSON_PROPERTY_DAY_OF_WEEK = "dayOfWeek"; - @Nullable - private Integer dayOfWeek; - - public static final String JSON_PROPERTY_ENABLED = "enabled"; - @Nullable - private Boolean enabled; - - public static final String JSON_PROPERTY_ENDS_ON = "endsOn"; - @Nullable - private Long endsOn; - - public static final String JSON_PROPERTY_STARTS_ON = "startsOn"; - @Nullable - private Long startsOn; - - public CustomTimeScheduleItem() { - } - - public CustomTimeScheduleItem dayOfWeek(@Nullable Integer dayOfWeek) { - this.dayOfWeek = dayOfWeek; - return this; - } - - /** - * Get dayOfWeek - * @return dayOfWeek - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_DAY_OF_WEEK, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getDayOfWeek() { - return dayOfWeek; - } - - - @JsonProperty(value = JSON_PROPERTY_DAY_OF_WEEK, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDayOfWeek(@Nullable Integer dayOfWeek) { - this.dayOfWeek = dayOfWeek; - } - - - public CustomTimeScheduleItem enabled(@Nullable Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * @return enabled - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_ENABLED, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnabled() { - return enabled; - } - - - @JsonProperty(value = JSON_PROPERTY_ENABLED, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnabled(@Nullable Boolean enabled) { - this.enabled = enabled; - } - - - public CustomTimeScheduleItem endsOn(@Nullable Long endsOn) { - this.endsOn = endsOn; - return this; - } - - /** - * Get endsOn - * @return endsOn - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_ENDS_ON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getEndsOn() { - return endsOn; - } - - - @JsonProperty(value = JSON_PROPERTY_ENDS_ON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEndsOn(@Nullable Long endsOn) { - this.endsOn = endsOn; - } - - - public CustomTimeScheduleItem startsOn(@Nullable Long startsOn) { - this.startsOn = startsOn; - return this; - } - - /** - * Get startsOn - * @return startsOn - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_STARTS_ON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getStartsOn() { - return startsOn; - } - - - @JsonProperty(value = JSON_PROPERTY_STARTS_ON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStartsOn(@Nullable Long startsOn) { - this.startsOn = startsOn; - } - - - /** - * Return true if this CustomTimeScheduleItem object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CustomTimeScheduleItem customTimeScheduleItem = (CustomTimeScheduleItem) o; - return Objects.equals(this.dayOfWeek, customTimeScheduleItem.dayOfWeek) && - Objects.equals(this.enabled, customTimeScheduleItem.enabled) && - Objects.equals(this.endsOn, customTimeScheduleItem.endsOn) && - Objects.equals(this.startsOn, customTimeScheduleItem.startsOn); - } - - @Override - public int hashCode() { - return Objects.hash(dayOfWeek, enabled, endsOn, startsOn); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CustomTimeScheduleItem {\n"); - sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" endsOn: ").append(toIndentedString(endsOn)).append("\n"); - sb.append(" startsOn: ").append(toIndentedString(startsOn)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `dayOfWeek` to the URL query string - if (getDayOfWeek() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sdayOfWeek%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDayOfWeek())))); - } - - // add `enabled` to the URL query string - if (getEnabled() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%senabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnabled())))); - } - - // add `endsOn` to the URL query string - if (getEndsOn() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sendsOn%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndsOn())))); - } - - // add `startsOn` to the URL query string - if (getStartsOn() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sstartsOn%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStartsOn())))); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/Customer.java b/ce/src/main/java/org/thingsboard/client/model/Customer.java index e83f6cec..2dfa061a 100644 --- a/ce/src/main/java/org/thingsboard/client/model/Customer.java +++ b/ce/src/main/java/org/thingsboard/client/model/Customer.java @@ -95,7 +95,7 @@ public class Customer { private String phone; public static final String JSON_PROPERTY_EMAIL = "email"; - @Nonnull + @Nullable private String email; public static final String JSON_PROPERTY_TITLE = "title"; @@ -337,7 +337,7 @@ public void setPhone(@Nullable String phone) { } - public Customer email(@Nonnull String email) { + public Customer email(@Nullable String email) { this.email = email; return this; } @@ -346,17 +346,17 @@ public Customer email(@Nonnull String email) { * Email * @return email */ - @Nonnull - @JsonProperty(value = JSON_PROPERTY_EMAIL, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @Nullable + @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getEmail() { return email; } - @JsonProperty(value = JSON_PROPERTY_EMAIL, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmail(@Nonnull String email) { + @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(@Nullable String email) { this.email = email; } diff --git a/ce/src/main/java/org/thingsboard/client/model/Device.java b/ce/src/main/java/org/thingsboard/client/model/Device.java index 03423430..d32beac7 100644 --- a/ce/src/main/java/org/thingsboard/client/model/Device.java +++ b/ce/src/main/java/org/thingsboard/client/model/Device.java @@ -89,7 +89,7 @@ public class Device { private String label; public static final String JSON_PROPERTY_DEVICE_PROFILE_ID = "deviceProfileId"; - @Nonnull + @Nullable private DeviceProfileId deviceProfileId; public static final String JSON_PROPERTY_FIRMWARE_ID = "firmwareId"; @@ -265,26 +265,26 @@ public void setLabel(@Nullable String label) { } - public Device deviceProfileId(@Nonnull DeviceProfileId deviceProfileId) { + public Device deviceProfileId(@Nullable DeviceProfileId deviceProfileId) { this.deviceProfileId = deviceProfileId; return this; } /** - * JSON object with Device Profile Id. + * JSON object with Device Profile Id. If not provided, the type will be used to determine the profile. If neither deviceProfileId nor type is specified, the default device profile will be used. * @return deviceProfileId */ - @Nonnull - @JsonProperty(value = JSON_PROPERTY_DEVICE_PROFILE_ID, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @Nullable + @JsonProperty(value = JSON_PROPERTY_DEVICE_PROFILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public DeviceProfileId getDeviceProfileId() { return deviceProfileId; } - @JsonProperty(value = JSON_PROPERTY_DEVICE_PROFILE_ID, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDeviceProfileId(@Nonnull DeviceProfileId deviceProfileId) { + @JsonProperty(value = JSON_PROPERTY_DEVICE_PROFILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfileId(@Nullable DeviceProfileId deviceProfileId) { this.deviceProfileId = deviceProfileId; } diff --git a/ce/src/main/java/org/thingsboard/client/model/DeviceInfo.java b/ce/src/main/java/org/thingsboard/client/model/DeviceInfo.java index 914573bd..c6c1970b 100644 --- a/ce/src/main/java/org/thingsboard/client/model/DeviceInfo.java +++ b/ce/src/main/java/org/thingsboard/client/model/DeviceInfo.java @@ -93,7 +93,7 @@ public class DeviceInfo { private String label; public static final String JSON_PROPERTY_DEVICE_PROFILE_ID = "deviceProfileId"; - @Nonnull + @Nullable private DeviceProfileId deviceProfileId; public static final String JSON_PROPERTY_FIRMWARE_ID = "firmwareId"; @@ -293,26 +293,26 @@ public void setLabel(@Nullable String label) { } - public DeviceInfo deviceProfileId(@Nonnull DeviceProfileId deviceProfileId) { + public DeviceInfo deviceProfileId(@Nullable DeviceProfileId deviceProfileId) { this.deviceProfileId = deviceProfileId; return this; } /** - * JSON object with Device Profile Id. + * JSON object with Device Profile Id. If not provided, the type will be used to determine the profile. If neither deviceProfileId nor type is specified, the default device profile will be used. * @return deviceProfileId */ - @Nonnull - @JsonProperty(value = JSON_PROPERTY_DEVICE_PROFILE_ID, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @Nullable + @JsonProperty(value = JSON_PROPERTY_DEVICE_PROFILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public DeviceProfileId getDeviceProfileId() { return deviceProfileId; } - @JsonProperty(value = JSON_PROPERTY_DEVICE_PROFILE_ID, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDeviceProfileId(@Nonnull DeviceProfileId deviceProfileId) { + @JsonProperty(value = JSON_PROPERTY_DEVICE_PROFILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceProfileId(@Nullable DeviceProfileId deviceProfileId) { this.deviceProfileId = deviceProfileId; } diff --git a/ce/src/main/java/org/thingsboard/client/model/DeviceProfileAlarm.java b/ce/src/main/java/org/thingsboard/client/model/DeviceProfileAlarm.java deleted file mode 100644 index 4503b985..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/DeviceProfileAlarm.java +++ /dev/null @@ -1,437 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.thingsboard.client.model.AlarmRule; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * DeviceProfileAlarm - */ -@JsonPropertyOrder({ - DeviceProfileAlarm.JSON_PROPERTY_ID, - DeviceProfileAlarm.JSON_PROPERTY_ALARM_TYPE, - DeviceProfileAlarm.JSON_PROPERTY_CREATE_RULES, - DeviceProfileAlarm.JSON_PROPERTY_CLEAR_RULE, - DeviceProfileAlarm.JSON_PROPERTY_PROPAGATE, - DeviceProfileAlarm.JSON_PROPERTY_PROPAGATE_TO_OWNER, - DeviceProfileAlarm.JSON_PROPERTY_PROPAGATE_TO_TENANT, - DeviceProfileAlarm.JSON_PROPERTY_PROPAGATE_RELATION_TYPES -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class DeviceProfileAlarm { - public static final String JSON_PROPERTY_ID = "id"; - @Nullable - private String id; - - public static final String JSON_PROPERTY_ALARM_TYPE = "alarmType"; - @Nullable - private String alarmType; - - public static final String JSON_PROPERTY_CREATE_RULES = "createRules"; - @Nullable - private Map createRules = new HashMap<>(); - - public static final String JSON_PROPERTY_CLEAR_RULE = "clearRule"; - @Nullable - private AlarmRule clearRule; - - public static final String JSON_PROPERTY_PROPAGATE = "propagate"; - @Nullable - private Boolean propagate; - - public static final String JSON_PROPERTY_PROPAGATE_TO_OWNER = "propagateToOwner"; - @Nullable - private Boolean propagateToOwner; - - public static final String JSON_PROPERTY_PROPAGATE_TO_TENANT = "propagateToTenant"; - @Nullable - private Boolean propagateToTenant; - - public static final String JSON_PROPERTY_PROPAGATE_RELATION_TYPES = "propagateRelationTypes"; - @Nullable - private List propagateRelationTypes = new ArrayList<>(); - - public DeviceProfileAlarm() { - } - - public DeviceProfileAlarm id(@Nullable String id) { - this.id = id; - return this; - } - - /** - * String value representing the alarm rule id - * @return id - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getId() { - return id; - } - - - @JsonProperty(value = JSON_PROPERTY_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@Nullable String id) { - this.id = id; - } - - - public DeviceProfileAlarm alarmType(@Nullable String alarmType) { - this.alarmType = alarmType; - return this; - } - - /** - * String value representing type of the alarm - * @return alarmType - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_ALARM_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAlarmType() { - return alarmType; - } - - - @JsonProperty(value = JSON_PROPERTY_ALARM_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAlarmType(@Nullable String alarmType) { - this.alarmType = alarmType; - } - - - public DeviceProfileAlarm createRules(@Nullable Map createRules) { - this.createRules = createRules; - return this; - } - - public DeviceProfileAlarm putCreateRulesItem(String key, AlarmRule createRulesItem) { - if (this.createRules == null) { - this.createRules = new HashMap<>(); - } - this.createRules.put(key, createRulesItem); - return this; - } - - /** - * Complex JSON object representing create alarm rules. The unique create alarm rule can be created for each alarm severity type. There can be 5 create alarm rules configured per a single alarm type. See method implementation notes and AlarmRule model for more details - * @return createRules - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_CREATE_RULES, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getCreateRules() { - return createRules; - } - - - @JsonProperty(value = JSON_PROPERTY_CREATE_RULES, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreateRules(@Nullable Map createRules) { - this.createRules = createRules; - } - - - public DeviceProfileAlarm clearRule(@Nullable AlarmRule clearRule) { - this.clearRule = clearRule; - return this; - } - - /** - * JSON object representing clear alarm rule - * @return clearRule - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_CLEAR_RULE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AlarmRule getClearRule() { - return clearRule; - } - - - @JsonProperty(value = JSON_PROPERTY_CLEAR_RULE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClearRule(@Nullable AlarmRule clearRule) { - this.clearRule = clearRule; - } - - - public DeviceProfileAlarm propagate(@Nullable Boolean propagate) { - this.propagate = propagate; - return this; - } - - /** - * Propagation flag to specify if alarm should be propagated to parent entities of alarm originator - * @return propagate - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_PROPAGATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPropagate() { - return propagate; - } - - - @JsonProperty(value = JSON_PROPERTY_PROPAGATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropagate(@Nullable Boolean propagate) { - this.propagate = propagate; - } - - - public DeviceProfileAlarm propagateToOwner(@Nullable Boolean propagateToOwner) { - this.propagateToOwner = propagateToOwner; - return this; - } - - /** - * Propagation flag to specify if alarm should be propagated to the owner (tenant or customer) of alarm originator - * @return propagateToOwner - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_PROPAGATE_TO_OWNER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPropagateToOwner() { - return propagateToOwner; - } - - - @JsonProperty(value = JSON_PROPERTY_PROPAGATE_TO_OWNER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropagateToOwner(@Nullable Boolean propagateToOwner) { - this.propagateToOwner = propagateToOwner; - } - - - public DeviceProfileAlarm propagateToTenant(@Nullable Boolean propagateToTenant) { - this.propagateToTenant = propagateToTenant; - return this; - } - - /** - * Propagation flag to specify if alarm should be propagated to the tenant entity - * @return propagateToTenant - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_PROPAGATE_TO_TENANT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPropagateToTenant() { - return propagateToTenant; - } - - - @JsonProperty(value = JSON_PROPERTY_PROPAGATE_TO_TENANT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropagateToTenant(@Nullable Boolean propagateToTenant) { - this.propagateToTenant = propagateToTenant; - } - - - public DeviceProfileAlarm propagateRelationTypes(@Nullable List propagateRelationTypes) { - this.propagateRelationTypes = propagateRelationTypes; - return this; - } - - public DeviceProfileAlarm addPropagateRelationTypesItem(String propagateRelationTypesItem) { - if (this.propagateRelationTypes == null) { - this.propagateRelationTypes = new ArrayList<>(); - } - this.propagateRelationTypes.add(propagateRelationTypesItem); - return this; - } - - /** - * JSON array of relation types that should be used for propagation. By default, 'propagateRelationTypes' array is empty which means that the alarm will be propagated based on any relation type to parent entities. This parameter should be used only in case when 'propagate' parameter is set to true, otherwise, 'propagateRelationTypes' array will be ignored. - * @return propagateRelationTypes - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_PROPAGATE_RELATION_TYPES, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPropagateRelationTypes() { - return propagateRelationTypes; - } - - - @JsonProperty(value = JSON_PROPERTY_PROPAGATE_RELATION_TYPES, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropagateRelationTypes(@Nullable List propagateRelationTypes) { - this.propagateRelationTypes = propagateRelationTypes; - } - - - /** - * Return true if this DeviceProfileAlarm object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeviceProfileAlarm deviceProfileAlarm = (DeviceProfileAlarm) o; - return Objects.equals(this.id, deviceProfileAlarm.id) && - Objects.equals(this.alarmType, deviceProfileAlarm.alarmType) && - Objects.equals(this.createRules, deviceProfileAlarm.createRules) && - Objects.equals(this.clearRule, deviceProfileAlarm.clearRule) && - Objects.equals(this.propagate, deviceProfileAlarm.propagate) && - Objects.equals(this.propagateToOwner, deviceProfileAlarm.propagateToOwner) && - Objects.equals(this.propagateToTenant, deviceProfileAlarm.propagateToTenant) && - Objects.equals(this.propagateRelationTypes, deviceProfileAlarm.propagateRelationTypes); - } - - @Override - public int hashCode() { - return Objects.hash(id, alarmType, createRules, clearRule, propagate, propagateToOwner, propagateToTenant, propagateRelationTypes); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeviceProfileAlarm {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" alarmType: ").append(toIndentedString(alarmType)).append("\n"); - sb.append(" createRules: ").append(toIndentedString(createRules)).append("\n"); - sb.append(" clearRule: ").append(toIndentedString(clearRule)).append("\n"); - sb.append(" propagate: ").append(toIndentedString(propagate)).append("\n"); - sb.append(" propagateToOwner: ").append(toIndentedString(propagateToOwner)).append("\n"); - sb.append(" propagateToTenant: ").append(toIndentedString(propagateToTenant)).append("\n"); - sb.append(" propagateRelationTypes: ").append(toIndentedString(propagateRelationTypes)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `id` to the URL query string - if (getId() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); - } - - // add `alarmType` to the URL query string - if (getAlarmType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%salarmType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAlarmType())))); - } - - // add `createRules` to the URL query string - if (getCreateRules() != null) { - for (String _key : getCreateRules().keySet()) { - if (getCreateRules().get(_key) != null) { - joiner.add(getCreateRules().get(_key).toUrlQueryString(String.format(java.util.Locale.ROOT, "%screateRules%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix)))); - } - } - } - - // add `clearRule` to the URL query string - if (getClearRule() != null) { - joiner.add(getClearRule().toUrlQueryString(prefix + "clearRule" + suffix)); - } - - // add `propagate` to the URL query string - if (getPropagate() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%spropagate%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPropagate())))); - } - - // add `propagateToOwner` to the URL query string - if (getPropagateToOwner() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%spropagateToOwner%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPropagateToOwner())))); - } - - // add `propagateToTenant` to the URL query string - if (getPropagateToTenant() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%spropagateToTenant%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPropagateToTenant())))); - } - - // add `propagateRelationTypes` to the URL query string - if (getPropagateRelationTypes() != null) { - for (int i = 0; i < getPropagateRelationTypes().size(); i++) { - joiner.add(String.format(java.util.Locale.ROOT, "%spropagateRelationTypes%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), - ApiClient.urlEncode(ApiClient.valueToString(getPropagateRelationTypes().get(i))))); - } - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/DeviceProfileData.java b/ce/src/main/java/org/thingsboard/client/model/DeviceProfileData.java index a91bd374..fef89f26 100644 --- a/ce/src/main/java/org/thingsboard/client/model/DeviceProfileData.java +++ b/ce/src/main/java/org/thingsboard/client/model/DeviceProfileData.java @@ -28,10 +28,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; -import org.thingsboard.client.model.DeviceProfileAlarm; import org.thingsboard.client.model.DeviceProfileConfiguration; import org.thingsboard.client.model.DeviceProfileProvisionConfiguration; import org.thingsboard.client.model.DeviceProfileTransportConfiguration; @@ -45,8 +42,7 @@ @JsonPropertyOrder({ DeviceProfileData.JSON_PROPERTY_CONFIGURATION, DeviceProfileData.JSON_PROPERTY_TRANSPORT_CONFIGURATION, - DeviceProfileData.JSON_PROPERTY_PROVISION_CONFIGURATION, - DeviceProfileData.JSON_PROPERTY_ALARMS + DeviceProfileData.JSON_PROPERTY_PROVISION_CONFIGURATION }) @Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") public class DeviceProfileData { @@ -62,10 +58,6 @@ public class DeviceProfileData { @Nullable private DeviceProfileProvisionConfiguration provisionConfiguration; - public static final String JSON_PROPERTY_ALARMS = "alarms"; - @Nullable - private List alarms = new ArrayList<>(); - public DeviceProfileData() { } @@ -141,38 +133,6 @@ public void setProvisionConfiguration(@Nullable DeviceProfileProvisionConfigurat } - public DeviceProfileData alarms(@Nullable List alarms) { - this.alarms = alarms; - return this; - } - - public DeviceProfileData addAlarmsItem(DeviceProfileAlarm alarmsItem) { - if (this.alarms == null) { - this.alarms = new ArrayList<>(); - } - this.alarms.add(alarmsItem); - return this; - } - - /** - * Get alarms - * @return alarms - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_ALARMS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAlarms() { - return alarms; - } - - - @JsonProperty(value = JSON_PROPERTY_ALARMS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAlarms(@Nullable List alarms) { - this.alarms = alarms; - } - - /** * Return true if this DeviceProfileData object is equal to o. */ @@ -187,13 +147,12 @@ public boolean equals(Object o) { DeviceProfileData deviceProfileData = (DeviceProfileData) o; return Objects.equals(this._configuration, deviceProfileData._configuration) && Objects.equals(this.transportConfiguration, deviceProfileData.transportConfiguration) && - Objects.equals(this.provisionConfiguration, deviceProfileData.provisionConfiguration) && - Objects.equals(this.alarms, deviceProfileData.alarms); + Objects.equals(this.provisionConfiguration, deviceProfileData.provisionConfiguration); } @Override public int hashCode() { - return Objects.hash(_configuration, transportConfiguration, provisionConfiguration, alarms); + return Objects.hash(_configuration, transportConfiguration, provisionConfiguration); } @Override @@ -203,7 +162,6 @@ public String toString() { sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); sb.append(" transportConfiguration: ").append(toIndentedString(transportConfiguration)).append("\n"); sb.append(" provisionConfiguration: ").append(toIndentedString(provisionConfiguration)).append("\n"); - sb.append(" alarms: ").append(toIndentedString(alarms)).append("\n"); sb.append("}"); return sb.toString(); } @@ -266,16 +224,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getProvisionConfiguration().toUrlQueryString(prefix + "provisionConfiguration" + suffix)); } - // add `alarms` to the URL query string - if (getAlarms() != null) { - for (int i = 0; i < getAlarms().size(); i++) { - if (getAlarms().get(i) != null) { - joiner.add(getAlarms().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%salarms%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); - } - } - } - return joiner.toString(); } } diff --git a/ce/src/main/java/org/thingsboard/client/model/DeviceProfileInfo.java b/ce/src/main/java/org/thingsboard/client/model/DeviceProfileInfo.java index 10c2e4bb..b01aa9ef 100644 --- a/ce/src/main/java/org/thingsboard/client/model/DeviceProfileInfo.java +++ b/ce/src/main/java/org/thingsboard/client/model/DeviceProfileInfo.java @@ -30,9 +30,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import org.thingsboard.client.model.DashboardId; +import org.thingsboard.client.model.DeviceProfileId; import org.thingsboard.client.model.DeviceProfileType; import org.thingsboard.client.model.DeviceTransportType; -import org.thingsboard.client.model.EntityId; import org.thingsboard.client.model.TenantId; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -54,7 +54,7 @@ public class DeviceProfileInfo { public static final String JSON_PROPERTY_ID = "id"; @Nullable - private EntityId id; + private DeviceProfileId id; public static final String JSON_PROPERTY_NAME = "name"; @Nullable @@ -83,26 +83,26 @@ public class DeviceProfileInfo { public DeviceProfileInfo() { } - public DeviceProfileInfo id(@Nullable EntityId id) { + public DeviceProfileInfo id(@Nullable DeviceProfileId id) { this.id = id; return this; } /** - * JSON object with the entity Id. + * JSON object with the Device Profile Id. * @return id */ @Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EntityId getId() { + public DeviceProfileId getId() { return id; } @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@Nullable EntityId id) { + public void setId(@Nullable DeviceProfileId id) { this.id = id; } diff --git a/ce/src/main/java/org/thingsboard/client/model/DurationAlarmConditionSpec.java b/ce/src/main/java/org/thingsboard/client/model/DurationAlarmConditionSpec.java deleted file mode 100644 index b576d914..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/DurationAlarmConditionSpec.java +++ /dev/null @@ -1,217 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.AlarmConditionSpec; -import org.thingsboard.client.model.FilterPredicateValueLong; -import org.thingsboard.client.model.TimeUnit; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.JSON; -import org.thingsboard.client.ApiClient; -/** - * Duration Alarm Condition Specification - */ -@JsonPropertyOrder({ - DurationAlarmConditionSpec.JSON_PROPERTY_UNIT, - DurationAlarmConditionSpec.JSON_PROPERTY_PREDICATE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -@JsonIgnoreProperties( - value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) - -public class DurationAlarmConditionSpec extends AlarmConditionSpec { - public static final String JSON_PROPERTY_UNIT = "unit"; - @Nullable - private TimeUnit unit; - - public static final String JSON_PROPERTY_PREDICATE = "predicate"; - @Nullable - private FilterPredicateValueLong predicate; - - public DurationAlarmConditionSpec() { - } - - public DurationAlarmConditionSpec unit(@Nullable TimeUnit unit) { - this.unit = unit; - return this; - } - - /** - * Duration time unit - * @return unit - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_UNIT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TimeUnit getUnit() { - return unit; - } - - - @JsonProperty(value = JSON_PROPERTY_UNIT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUnit(@Nullable TimeUnit unit) { - this.unit = unit; - } - - - public DurationAlarmConditionSpec predicate(@Nullable FilterPredicateValueLong predicate) { - this.predicate = predicate; - return this; - } - - /** - * Duration predicate - * @return predicate - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_PREDICATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FilterPredicateValueLong getPredicate() { - return predicate; - } - - - @JsonProperty(value = JSON_PROPERTY_PREDICATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPredicate(@Nullable FilterPredicateValueLong predicate) { - this.predicate = predicate; - } - - - /** - * Return true if this DurationAlarmConditionSpec object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DurationAlarmConditionSpec durationAlarmConditionSpec = (DurationAlarmConditionSpec) o; - return Objects.equals(this.unit, durationAlarmConditionSpec.unit) && - Objects.equals(this.predicate, durationAlarmConditionSpec.predicate) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(unit, predicate, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DurationAlarmConditionSpec {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); - sb.append(" predicate: ").append(toIndentedString(predicate)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - // add `unit` to the URL query string - if (getUnit() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sunit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUnit())))); - } - - // add `predicate` to the URL query string - if (getPredicate() != null) { - joiner.add(getPredicate().toUrlQueryString(prefix + "predicate" + suffix)); - } - - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("DurationAlarmConditionSpec", DurationAlarmConditionSpec.class); - JSON.registerDiscriminator(DurationAlarmConditionSpec.class, "type", mappings); -} -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/DynamicValueInteger.java b/ce/src/main/java/org/thingsboard/client/model/DynamicValueInteger.java deleted file mode 100644 index 7c6c3875..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/DynamicValueInteger.java +++ /dev/null @@ -1,264 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.DynamicValueSourceType; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * DynamicValueInteger - */ -@JsonPropertyOrder({ - DynamicValueInteger.JSON_PROPERTY_RESOLVED_VALUE, - DynamicValueInteger.JSON_PROPERTY_SOURCE_TYPE, - DynamicValueInteger.JSON_PROPERTY_SOURCE_ATTRIBUTE, - DynamicValueInteger.JSON_PROPERTY_INHERIT -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class DynamicValueInteger { - public static final String JSON_PROPERTY_RESOLVED_VALUE = "resolvedValue"; - @Nullable - private Integer resolvedValue; - - public static final String JSON_PROPERTY_SOURCE_TYPE = "sourceType"; - @Nullable - private DynamicValueSourceType sourceType; - - public static final String JSON_PROPERTY_SOURCE_ATTRIBUTE = "sourceAttribute"; - @Nullable - private String sourceAttribute; - - public static final String JSON_PROPERTY_INHERIT = "inherit"; - @Nullable - private Boolean inherit; - - public DynamicValueInteger() { - } - - public DynamicValueInteger resolvedValue(@Nullable Integer resolvedValue) { - this.resolvedValue = resolvedValue; - return this; - } - - /** - * Get resolvedValue - * @return resolvedValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_RESOLVED_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getResolvedValue() { - return resolvedValue; - } - - - @JsonProperty(value = JSON_PROPERTY_RESOLVED_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResolvedValue(@Nullable Integer resolvedValue) { - this.resolvedValue = resolvedValue; - } - - - public DynamicValueInteger sourceType(@Nullable DynamicValueSourceType sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * Get sourceType - * @return sourceType - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DynamicValueSourceType getSourceType() { - return sourceType; - } - - - @JsonProperty(value = JSON_PROPERTY_SOURCE_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceType(@Nullable DynamicValueSourceType sourceType) { - this.sourceType = sourceType; - } - - - public DynamicValueInteger sourceAttribute(@Nullable String sourceAttribute) { - this.sourceAttribute = sourceAttribute; - return this; - } - - /** - * Get sourceAttribute - * @return sourceAttribute - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_ATTRIBUTE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSourceAttribute() { - return sourceAttribute; - } - - - @JsonProperty(value = JSON_PROPERTY_SOURCE_ATTRIBUTE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceAttribute(@Nullable String sourceAttribute) { - this.sourceAttribute = sourceAttribute; - } - - - public DynamicValueInteger inherit(@Nullable Boolean inherit) { - this.inherit = inherit; - return this; - } - - /** - * Get inherit - * @return inherit - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_INHERIT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getInherit() { - return inherit; - } - - - @JsonProperty(value = JSON_PROPERTY_INHERIT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInherit(@Nullable Boolean inherit) { - this.inherit = inherit; - } - - - /** - * Return true if this DynamicValueInteger object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DynamicValueInteger dynamicValueInteger = (DynamicValueInteger) o; - return Objects.equals(this.resolvedValue, dynamicValueInteger.resolvedValue) && - Objects.equals(this.sourceType, dynamicValueInteger.sourceType) && - Objects.equals(this.sourceAttribute, dynamicValueInteger.sourceAttribute) && - Objects.equals(this.inherit, dynamicValueInteger.inherit); - } - - @Override - public int hashCode() { - return Objects.hash(resolvedValue, sourceType, sourceAttribute, inherit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DynamicValueInteger {\n"); - sb.append(" resolvedValue: ").append(toIndentedString(resolvedValue)).append("\n"); - sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); - sb.append(" sourceAttribute: ").append(toIndentedString(sourceAttribute)).append("\n"); - sb.append(" inherit: ").append(toIndentedString(inherit)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `resolvedValue` to the URL query string - if (getResolvedValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sresolvedValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getResolvedValue())))); - } - - // add `sourceType` to the URL query string - if (getSourceType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%ssourceType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceType())))); - } - - // add `sourceAttribute` to the URL query string - if (getSourceAttribute() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%ssourceAttribute%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceAttribute())))); - } - - // add `inherit` to the URL query string - if (getInherit() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sinherit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getInherit())))); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/DynamicValueLong.java b/ce/src/main/java/org/thingsboard/client/model/DynamicValueLong.java deleted file mode 100644 index c22a5956..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/DynamicValueLong.java +++ /dev/null @@ -1,264 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.DynamicValueSourceType; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * DynamicValueLong - */ -@JsonPropertyOrder({ - DynamicValueLong.JSON_PROPERTY_RESOLVED_VALUE, - DynamicValueLong.JSON_PROPERTY_SOURCE_TYPE, - DynamicValueLong.JSON_PROPERTY_SOURCE_ATTRIBUTE, - DynamicValueLong.JSON_PROPERTY_INHERIT -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class DynamicValueLong { - public static final String JSON_PROPERTY_RESOLVED_VALUE = "resolvedValue"; - @Nullable - private Long resolvedValue; - - public static final String JSON_PROPERTY_SOURCE_TYPE = "sourceType"; - @Nullable - private DynamicValueSourceType sourceType; - - public static final String JSON_PROPERTY_SOURCE_ATTRIBUTE = "sourceAttribute"; - @Nullable - private String sourceAttribute; - - public static final String JSON_PROPERTY_INHERIT = "inherit"; - @Nullable - private Boolean inherit; - - public DynamicValueLong() { - } - - public DynamicValueLong resolvedValue(@Nullable Long resolvedValue) { - this.resolvedValue = resolvedValue; - return this; - } - - /** - * Get resolvedValue - * @return resolvedValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_RESOLVED_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getResolvedValue() { - return resolvedValue; - } - - - @JsonProperty(value = JSON_PROPERTY_RESOLVED_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResolvedValue(@Nullable Long resolvedValue) { - this.resolvedValue = resolvedValue; - } - - - public DynamicValueLong sourceType(@Nullable DynamicValueSourceType sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * Get sourceType - * @return sourceType - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DynamicValueSourceType getSourceType() { - return sourceType; - } - - - @JsonProperty(value = JSON_PROPERTY_SOURCE_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceType(@Nullable DynamicValueSourceType sourceType) { - this.sourceType = sourceType; - } - - - public DynamicValueLong sourceAttribute(@Nullable String sourceAttribute) { - this.sourceAttribute = sourceAttribute; - return this; - } - - /** - * Get sourceAttribute - * @return sourceAttribute - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_ATTRIBUTE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSourceAttribute() { - return sourceAttribute; - } - - - @JsonProperty(value = JSON_PROPERTY_SOURCE_ATTRIBUTE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceAttribute(@Nullable String sourceAttribute) { - this.sourceAttribute = sourceAttribute; - } - - - public DynamicValueLong inherit(@Nullable Boolean inherit) { - this.inherit = inherit; - return this; - } - - /** - * Get inherit - * @return inherit - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_INHERIT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getInherit() { - return inherit; - } - - - @JsonProperty(value = JSON_PROPERTY_INHERIT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInherit(@Nullable Boolean inherit) { - this.inherit = inherit; - } - - - /** - * Return true if this DynamicValueLong object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DynamicValueLong dynamicValueLong = (DynamicValueLong) o; - return Objects.equals(this.resolvedValue, dynamicValueLong.resolvedValue) && - Objects.equals(this.sourceType, dynamicValueLong.sourceType) && - Objects.equals(this.sourceAttribute, dynamicValueLong.sourceAttribute) && - Objects.equals(this.inherit, dynamicValueLong.inherit); - } - - @Override - public int hashCode() { - return Objects.hash(resolvedValue, sourceType, sourceAttribute, inherit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DynamicValueLong {\n"); - sb.append(" resolvedValue: ").append(toIndentedString(resolvedValue)).append("\n"); - sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); - sb.append(" sourceAttribute: ").append(toIndentedString(sourceAttribute)).append("\n"); - sb.append(" inherit: ").append(toIndentedString(inherit)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `resolvedValue` to the URL query string - if (getResolvedValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sresolvedValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getResolvedValue())))); - } - - // add `sourceType` to the URL query string - if (getSourceType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%ssourceType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceType())))); - } - - // add `sourceAttribute` to the URL query string - if (getSourceAttribute() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%ssourceAttribute%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceAttribute())))); - } - - // add `inherit` to the URL query string - if (getInherit() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sinherit%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getInherit())))); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/FilterPredicateValueInteger.java b/ce/src/main/java/org/thingsboard/client/model/FilterPredicateValueInteger.java deleted file mode 100644 index a7dc87d8..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/FilterPredicateValueInteger.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.DynamicValueInteger; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * FilterPredicateValueInteger - */ -@JsonPropertyOrder({ - FilterPredicateValueInteger.JSON_PROPERTY_DEFAULT_VALUE, - FilterPredicateValueInteger.JSON_PROPERTY_USER_VALUE, - FilterPredicateValueInteger.JSON_PROPERTY_DYNAMIC_VALUE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class FilterPredicateValueInteger { - public static final String JSON_PROPERTY_DEFAULT_VALUE = "defaultValue"; - @Nullable - private Integer defaultValue; - - public static final String JSON_PROPERTY_USER_VALUE = "userValue"; - @Nullable - private Integer userValue; - - public static final String JSON_PROPERTY_DYNAMIC_VALUE = "dynamicValue"; - @Nullable - private DynamicValueInteger dynamicValue; - - public FilterPredicateValueInteger() { - } - - public FilterPredicateValueInteger defaultValue(@Nullable Integer defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * Get defaultValue - * @return defaultValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_DEFAULT_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getDefaultValue() { - return defaultValue; - } - - - @JsonProperty(value = JSON_PROPERTY_DEFAULT_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDefaultValue(@Nullable Integer defaultValue) { - this.defaultValue = defaultValue; - } - - - public FilterPredicateValueInteger userValue(@Nullable Integer userValue) { - this.userValue = userValue; - return this; - } - - /** - * Get userValue - * @return userValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_USER_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getUserValue() { - return userValue; - } - - - @JsonProperty(value = JSON_PROPERTY_USER_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUserValue(@Nullable Integer userValue) { - this.userValue = userValue; - } - - - public FilterPredicateValueInteger dynamicValue(@Nullable DynamicValueInteger dynamicValue) { - this.dynamicValue = dynamicValue; - return this; - } - - /** - * Get dynamicValue - * @return dynamicValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_DYNAMIC_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DynamicValueInteger getDynamicValue() { - return dynamicValue; - } - - - @JsonProperty(value = JSON_PROPERTY_DYNAMIC_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDynamicValue(@Nullable DynamicValueInteger dynamicValue) { - this.dynamicValue = dynamicValue; - } - - - /** - * Return true if this FilterPredicateValueInteger object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FilterPredicateValueInteger filterPredicateValueInteger = (FilterPredicateValueInteger) o; - return Objects.equals(this.defaultValue, filterPredicateValueInteger.defaultValue) && - Objects.equals(this.userValue, filterPredicateValueInteger.userValue) && - Objects.equals(this.dynamicValue, filterPredicateValueInteger.dynamicValue); - } - - @Override - public int hashCode() { - return Objects.hash(defaultValue, userValue, dynamicValue); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FilterPredicateValueInteger {\n"); - sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); - sb.append(" userValue: ").append(toIndentedString(userValue)).append("\n"); - sb.append(" dynamicValue: ").append(toIndentedString(dynamicValue)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `defaultValue` to the URL query string - if (getDefaultValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sdefaultValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDefaultValue())))); - } - - // add `userValue` to the URL query string - if (getUserValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%suserValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUserValue())))); - } - - // add `dynamicValue` to the URL query string - if (getDynamicValue() != null) { - joiner.add(getDynamicValue().toUrlQueryString(prefix + "dynamicValue" + suffix)); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/FilterPredicateValueLong.java b/ce/src/main/java/org/thingsboard/client/model/FilterPredicateValueLong.java deleted file mode 100644 index 3bda2f66..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/FilterPredicateValueLong.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.DynamicValueLong; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.ApiClient; -/** - * FilterPredicateValueLong - */ -@JsonPropertyOrder({ - FilterPredicateValueLong.JSON_PROPERTY_DEFAULT_VALUE, - FilterPredicateValueLong.JSON_PROPERTY_USER_VALUE, - FilterPredicateValueLong.JSON_PROPERTY_DYNAMIC_VALUE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -public class FilterPredicateValueLong { - public static final String JSON_PROPERTY_DEFAULT_VALUE = "defaultValue"; - @Nullable - private Long defaultValue; - - public static final String JSON_PROPERTY_USER_VALUE = "userValue"; - @Nullable - private Long userValue; - - public static final String JSON_PROPERTY_DYNAMIC_VALUE = "dynamicValue"; - @Nullable - private DynamicValueLong dynamicValue; - - public FilterPredicateValueLong() { - } - - public FilterPredicateValueLong defaultValue(@Nullable Long defaultValue) { - this.defaultValue = defaultValue; - return this; - } - - /** - * Get defaultValue - * @return defaultValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_DEFAULT_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getDefaultValue() { - return defaultValue; - } - - - @JsonProperty(value = JSON_PROPERTY_DEFAULT_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDefaultValue(@Nullable Long defaultValue) { - this.defaultValue = defaultValue; - } - - - public FilterPredicateValueLong userValue(@Nullable Long userValue) { - this.userValue = userValue; - return this; - } - - /** - * Get userValue - * @return userValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_USER_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getUserValue() { - return userValue; - } - - - @JsonProperty(value = JSON_PROPERTY_USER_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUserValue(@Nullable Long userValue) { - this.userValue = userValue; - } - - - public FilterPredicateValueLong dynamicValue(@Nullable DynamicValueLong dynamicValue) { - this.dynamicValue = dynamicValue; - return this; - } - - /** - * Get dynamicValue - * @return dynamicValue - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_DYNAMIC_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public DynamicValueLong getDynamicValue() { - return dynamicValue; - } - - - @JsonProperty(value = JSON_PROPERTY_DYNAMIC_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDynamicValue(@Nullable DynamicValueLong dynamicValue) { - this.dynamicValue = dynamicValue; - } - - - /** - * Return true if this FilterPredicateValueLong object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FilterPredicateValueLong filterPredicateValueLong = (FilterPredicateValueLong) o; - return Objects.equals(this.defaultValue, filterPredicateValueLong.defaultValue) && - Objects.equals(this.userValue, filterPredicateValueLong.userValue) && - Objects.equals(this.dynamicValue, filterPredicateValueLong.dynamicValue); - } - - @Override - public int hashCode() { - return Objects.hash(defaultValue, userValue, dynamicValue); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FilterPredicateValueLong {\n"); - sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); - sb.append(" userValue: ").append(toIndentedString(userValue)).append("\n"); - sb.append(" dynamicValue: ").append(toIndentedString(dynamicValue)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `defaultValue` to the URL query string - if (getDefaultValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sdefaultValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDefaultValue())))); - } - - // add `userValue` to the URL query string - if (getUserValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%suserValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUserValue())))); - } - - // add `dynamicValue` to the URL query string - if (getDynamicValue() != null) { - joiner.add(getDynamicValue().toUrlQueryString(prefix + "dynamicValue" + suffix)); - } - - return joiner.toString(); - } -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/HomeDashboard.java b/ce/src/main/java/org/thingsboard/client/model/HomeDashboard.java new file mode 100644 index 00000000..6d2ddc2b --- /dev/null +++ b/ce/src/main/java/org/thingsboard/client/model/HomeDashboard.java @@ -0,0 +1,584 @@ +/** + * Copyright © 2026-2026 ThingsBoard, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.client.model; + +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.thingsboard.client.model.DashboardId; +import org.thingsboard.client.model.ResourceExportData; +import org.thingsboard.client.model.ShortCustomerInfo; +import org.thingsboard.client.model.TenantId; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.thingsboard.client.ApiClient; +/** + * HomeDashboard + */ +@JsonPropertyOrder({ + HomeDashboard.JSON_PROPERTY_ID, + HomeDashboard.JSON_PROPERTY_CREATED_TIME, + HomeDashboard.JSON_PROPERTY_TENANT_ID, + HomeDashboard.JSON_PROPERTY_TITLE, + HomeDashboard.JSON_PROPERTY_NAME, + HomeDashboard.JSON_PROPERTY_IMAGE, + HomeDashboard.JSON_PROPERTY_MOBILE_HIDE, + HomeDashboard.JSON_PROPERTY_MOBILE_ORDER, + HomeDashboard.JSON_PROPERTY_ASSIGNED_CUSTOMERS, + HomeDashboard.JSON_PROPERTY_CONFIGURATION, + HomeDashboard.JSON_PROPERTY_RESOURCES, + HomeDashboard.JSON_PROPERTY_VERSION, + HomeDashboard.JSON_PROPERTY_HIDE_DASHBOARD_TOOLBAR +}) +@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") +public class HomeDashboard { + public static final String JSON_PROPERTY_ID = "id"; + @Nullable + private DashboardId id; + + public static final String JSON_PROPERTY_CREATED_TIME = "createdTime"; + @Nullable + private Long createdTime; + + public static final String JSON_PROPERTY_TENANT_ID = "tenantId"; + @Nullable + private TenantId tenantId; + + public static final String JSON_PROPERTY_TITLE = "title"; + @Nonnull + private String title; + + public static final String JSON_PROPERTY_NAME = "name"; + @Nullable + private String name; + + public static final String JSON_PROPERTY_IMAGE = "image"; + @Nullable + private String image; + + public static final String JSON_PROPERTY_MOBILE_HIDE = "mobileHide"; + @Nullable + private Boolean mobileHide; + + public static final String JSON_PROPERTY_MOBILE_ORDER = "mobileOrder"; + @Nullable + private Integer mobileOrder; + + public static final String JSON_PROPERTY_ASSIGNED_CUSTOMERS = "assignedCustomers"; + @Nullable + private Set assignedCustomers = new LinkedHashSet<>(); + + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; + @Nullable + private com.fasterxml.jackson.databind.JsonNode _configuration; + + public static final String JSON_PROPERTY_RESOURCES = "resources"; + @Nullable + private List resources = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + @Nullable + private Long version; + + public static final String JSON_PROPERTY_HIDE_DASHBOARD_TOOLBAR = "hideDashboardToolbar"; + @Nullable + private Boolean hideDashboardToolbar; + + public HomeDashboard() { + } + + @JsonCreator + public HomeDashboard( + @JsonProperty(JSON_PROPERTY_CREATED_TIME) Long createdTime, + @JsonProperty(JSON_PROPERTY_TENANT_ID) TenantId tenantId, + @JsonProperty(JSON_PROPERTY_NAME) String name, + @JsonProperty(JSON_PROPERTY_IMAGE) String image, + @JsonProperty(JSON_PROPERTY_MOBILE_HIDE) Boolean mobileHide, + @JsonProperty(JSON_PROPERTY_MOBILE_ORDER) Integer mobileOrder + ) { + this(); + this.createdTime = createdTime; + this.tenantId = tenantId; + this.name = name; + this.image = image; + this.mobileHide = mobileHide; + this.mobileOrder = mobileOrder; + } + + public HomeDashboard id(@Nullable DashboardId id) { + this.id = id; + return this; + } + + /** + * JSON object with the dashboard Id. Specify existing dashboard Id to update the dashboard. Referencing non-existing dashboard id will cause error. Omit this field to create new dashboard. + * @return id + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DashboardId getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@Nullable DashboardId id) { + this.id = id; + } + + + /** + * Timestamp of the dashboard creation, in milliseconds + * @return createdTime + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_CREATED_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCreatedTime() { + return createdTime; + } + + + + + /** + * JSON object with Tenant Id. Tenant Id of the dashboard can't be changed. + * @return tenantId + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_TENANT_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TenantId getTenantId() { + return tenantId; + } + + + + + public HomeDashboard title(@Nonnull String title) { + this.title = title; + return this; + } + + /** + * Title of the dashboard. + * @return title + */ + @Nonnull + @JsonProperty(value = JSON_PROPERTY_TITLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + + @JsonProperty(value = JSON_PROPERTY_TITLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(@Nonnull String title) { + this.title = title; + } + + + /** + * Same as title of the dashboard. Read-only field. Update the 'title' to change the 'name' of the dashboard. + * @return name + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + + + /** + * Thumbnail picture for rendering of the dashboards in a grid view on mobile devices. + * @return image + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_IMAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getImage() { + return image; + } + + + + + /** + * Hide dashboard from mobile devices. Useful if the dashboard is not designed for small screens. + * @return mobileHide + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_MOBILE_HIDE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMobileHide() { + return mobileHide; + } + + + + + /** + * Order on mobile devices. Useful to adjust sorting of the dashboards for mobile applications + * @return mobileOrder + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_MOBILE_ORDER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMobileOrder() { + return mobileOrder; + } + + + + + public HomeDashboard assignedCustomers(@Nullable Set assignedCustomers) { + this.assignedCustomers = assignedCustomers; + return this; + } + + public HomeDashboard addAssignedCustomersItem(ShortCustomerInfo assignedCustomersItem) { + if (this.assignedCustomers == null) { + this.assignedCustomers = new LinkedHashSet<>(); + } + this.assignedCustomers.add(assignedCustomersItem); + return this; + } + + /** + * List of assigned customers with their info. + * @return assignedCustomers + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_ASSIGNED_CUSTOMERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Set getAssignedCustomers() { + return assignedCustomers; + } + + + @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty(value = JSON_PROPERTY_ASSIGNED_CUSTOMERS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAssignedCustomers(@Nullable Set assignedCustomers) { + this.assignedCustomers = assignedCustomers; + } + + + public HomeDashboard _configuration(@Nullable com.fasterxml.jackson.databind.JsonNode _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * JSON object with main configuration of the dashboard: layouts, widgets, aliases, etc. The JSON structure of the dashboard configuration is quite complex. The easiest way to learn it is to export existing dashboard to JSON. + * @return _configuration + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_CONFIGURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public com.fasterxml.jackson.databind.JsonNode getConfiguration() { + return _configuration; + } + + + @JsonProperty(value = JSON_PROPERTY_CONFIGURATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfiguration(@Nullable com.fasterxml.jackson.databind.JsonNode _configuration) { + this._configuration = _configuration; + } + + + public HomeDashboard resources(@Nullable List resources) { + this.resources = resources; + return this; + } + + public HomeDashboard addResourcesItem(ResourceExportData resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * @return resources + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_RESOURCES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getResources() { + return resources; + } + + + @JsonProperty(value = JSON_PROPERTY_RESOURCES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResources(@Nullable List resources) { + this.resources = resources; + } + + + public HomeDashboard version(@Nullable Long version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + + @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(@Nullable Long version) { + this.version = version; + } + + + public HomeDashboard hideDashboardToolbar(@Nullable Boolean hideDashboardToolbar) { + this.hideDashboardToolbar = hideDashboardToolbar; + return this; + } + + /** + * Hide dashboard toolbar flag. Useful for rendering dashboards on mobile. + * @return hideDashboardToolbar + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_HIDE_DASHBOARD_TOOLBAR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHideDashboardToolbar() { + return hideDashboardToolbar; + } + + + @JsonProperty(value = JSON_PROPERTY_HIDE_DASHBOARD_TOOLBAR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideDashboardToolbar(@Nullable Boolean hideDashboardToolbar) { + this.hideDashboardToolbar = hideDashboardToolbar; + } + + + /** + * Return true if this HomeDashboard object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HomeDashboard homeDashboard = (HomeDashboard) o; + return Objects.equals(this.id, homeDashboard.id) && + Objects.equals(this.createdTime, homeDashboard.createdTime) && + Objects.equals(this.tenantId, homeDashboard.tenantId) && + Objects.equals(this.title, homeDashboard.title) && + Objects.equals(this.name, homeDashboard.name) && + Objects.equals(this.image, homeDashboard.image) && + Objects.equals(this.mobileHide, homeDashboard.mobileHide) && + Objects.equals(this.mobileOrder, homeDashboard.mobileOrder) && + Objects.equals(this.assignedCustomers, homeDashboard.assignedCustomers) && + Objects.equals(this._configuration, homeDashboard._configuration) && + Objects.equals(this.resources, homeDashboard.resources) && + Objects.equals(this.version, homeDashboard.version) && + Objects.equals(this.hideDashboardToolbar, homeDashboard.hideDashboardToolbar); + } + + @Override + public int hashCode() { + return Objects.hash(id, createdTime, tenantId, title, name, image, mobileHide, mobileOrder, assignedCustomers, _configuration, resources, version, hideDashboardToolbar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HomeDashboard {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" createdTime: ").append(toIndentedString(createdTime)).append("\n"); + sb.append(" tenantId: ").append(toIndentedString(tenantId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" image: ").append(toIndentedString(image)).append("\n"); + sb.append(" mobileHide: ").append(toIndentedString(mobileHide)).append("\n"); + sb.append(" mobileOrder: ").append(toIndentedString(mobileOrder)).append("\n"); + sb.append(" assignedCustomers: ").append(toIndentedString(assignedCustomers)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" hideDashboardToolbar: ").append(toIndentedString(hideDashboardToolbar)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(getId().toUrlQueryString(prefix + "id" + suffix)); + } + + // add `createdTime` to the URL query string + if (getCreatedTime() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%screatedTime%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCreatedTime())))); + } + + // add `tenantId` to the URL query string + if (getTenantId() != null) { + joiner.add(getTenantId().toUrlQueryString(prefix + "tenantId" + suffix)); + } + + // add `title` to the URL query string + if (getTitle() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stitle%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTitle())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `image` to the URL query string + if (getImage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%simage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getImage())))); + } + + // add `mobileHide` to the URL query string + if (getMobileHide() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smobileHide%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMobileHide())))); + } + + // add `mobileOrder` to the URL query string + if (getMobileOrder() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smobileOrder%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMobileOrder())))); + } + + // add `assignedCustomers` to the URL query string + if (getAssignedCustomers() != null) { + int i = 0; + for (ShortCustomerInfo _item : getAssignedCustomers()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format(java.util.Locale.ROOT, "%sassignedCustomers%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + + // add `configuration` to the URL query string + if (getConfiguration() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sconfiguration%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getConfiguration())))); + } + + // add `resources` to the URL query string + if (getResources() != null) { + for (int i = 0; i < getResources().size(); i++) { + if (getResources().get(i) != null) { + joiner.add(getResources().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sresources%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `version` to the URL query string + if (getVersion() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sversion%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion())))); + } + + // add `hideDashboardToolbar` to the URL query string + if (getHideDashboardToolbar() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shideDashboardToolbar%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHideDashboardToolbar())))); + } + + return joiner.toString(); + } +} + diff --git a/ce/src/main/java/org/thingsboard/client/model/PageDataAlarmRuleDefinition.java b/ce/src/main/java/org/thingsboard/client/model/PageDataAlarmRuleDefinition.java new file mode 100644 index 00000000..48235de3 --- /dev/null +++ b/ce/src/main/java/org/thingsboard/client/model/PageDataAlarmRuleDefinition.java @@ -0,0 +1,261 @@ +/** + * Copyright © 2026-2026 ThingsBoard, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.client.model; + +import javax.annotation.Generated; +import javax.annotation.Nullable; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.thingsboard.client.model.AlarmRuleDefinition; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.thingsboard.client.ApiClient; +/** + * PageDataAlarmRuleDefinition + */ +@JsonPropertyOrder({ + PageDataAlarmRuleDefinition.JSON_PROPERTY_DATA, + PageDataAlarmRuleDefinition.JSON_PROPERTY_TOTAL_PAGES, + PageDataAlarmRuleDefinition.JSON_PROPERTY_TOTAL_ELEMENTS, + PageDataAlarmRuleDefinition.JSON_PROPERTY_HAS_NEXT +}) +@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") +public class PageDataAlarmRuleDefinition { + public static final String JSON_PROPERTY_DATA = "data"; + @Nullable + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_PAGES = "totalPages"; + @Nullable + private Integer totalPages; + + public static final String JSON_PROPERTY_TOTAL_ELEMENTS = "totalElements"; + @Nullable + private Long totalElements; + + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; + @Nullable + private Boolean hasNext; + + public PageDataAlarmRuleDefinition() { + } + + @JsonCreator + public PageDataAlarmRuleDefinition( + @JsonProperty(JSON_PROPERTY_TOTAL_PAGES) Integer totalPages, + @JsonProperty(JSON_PROPERTY_TOTAL_ELEMENTS) Long totalElements, + @JsonProperty(JSON_PROPERTY_HAS_NEXT) Boolean hasNext + ) { + this(); + this.totalPages = totalPages; + this.totalElements = totalElements; + this.hasNext = hasNext; + } + + public PageDataAlarmRuleDefinition data(@Nullable List data) { + this.data = data; + return this; + } + + public PageDataAlarmRuleDefinition addDataItem(AlarmRuleDefinition dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Array of the entities + * @return data + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@Nullable List data) { + this.data = data; + } + + + /** + * Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria + * @return totalPages + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_TOTAL_PAGES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalPages() { + return totalPages; + } + + + + + /** + * Total number of elements in all available pages + * @return totalElements + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_TOTAL_ELEMENTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalElements() { + return totalElements; + } + + + + + /** + * 'false' value indicates the end of the result set + * @return hasNext + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_HAS_NEXT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasNext() { + return hasNext; + } + + + + + /** + * Return true if this PageDataAlarmRuleDefinition object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PageDataAlarmRuleDefinition pageDataAlarmRuleDefinition = (PageDataAlarmRuleDefinition) o; + return Objects.equals(this.data, pageDataAlarmRuleDefinition.data) && + Objects.equals(this.totalPages, pageDataAlarmRuleDefinition.totalPages) && + Objects.equals(this.totalElements, pageDataAlarmRuleDefinition.totalElements) && + Objects.equals(this.hasNext, pageDataAlarmRuleDefinition.hasNext); + } + + @Override + public int hashCode() { + return Objects.hash(data, totalPages, totalElements, hasNext); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PageDataAlarmRuleDefinition {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); + sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n"); + sb.append(" hasNext: ").append(toIndentedString(hasNext)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sdata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `totalPages` to the URL query string + if (getTotalPages() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stotalPages%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTotalPages())))); + } + + // add `totalElements` to the URL query string + if (getTotalElements() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stotalElements%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTotalElements())))); + } + + // add `hasNext` to the URL query string + if (getHasNext() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shasNext%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHasNext())))); + } + + return joiner.toString(); + } +} + diff --git a/ce/src/main/java/org/thingsboard/client/model/PageDataAlarmRuleDefinitionInfo.java b/ce/src/main/java/org/thingsboard/client/model/PageDataAlarmRuleDefinitionInfo.java new file mode 100644 index 00000000..53ae9de9 --- /dev/null +++ b/ce/src/main/java/org/thingsboard/client/model/PageDataAlarmRuleDefinitionInfo.java @@ -0,0 +1,261 @@ +/** + * Copyright © 2026-2026 ThingsBoard, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.client.model; + +import javax.annotation.Generated; +import javax.annotation.Nullable; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.thingsboard.client.model.AlarmRuleDefinitionInfo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.thingsboard.client.ApiClient; +/** + * PageDataAlarmRuleDefinitionInfo + */ +@JsonPropertyOrder({ + PageDataAlarmRuleDefinitionInfo.JSON_PROPERTY_DATA, + PageDataAlarmRuleDefinitionInfo.JSON_PROPERTY_TOTAL_PAGES, + PageDataAlarmRuleDefinitionInfo.JSON_PROPERTY_TOTAL_ELEMENTS, + PageDataAlarmRuleDefinitionInfo.JSON_PROPERTY_HAS_NEXT +}) +@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") +public class PageDataAlarmRuleDefinitionInfo { + public static final String JSON_PROPERTY_DATA = "data"; + @Nullable + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_TOTAL_PAGES = "totalPages"; + @Nullable + private Integer totalPages; + + public static final String JSON_PROPERTY_TOTAL_ELEMENTS = "totalElements"; + @Nullable + private Long totalElements; + + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; + @Nullable + private Boolean hasNext; + + public PageDataAlarmRuleDefinitionInfo() { + } + + @JsonCreator + public PageDataAlarmRuleDefinitionInfo( + @JsonProperty(JSON_PROPERTY_TOTAL_PAGES) Integer totalPages, + @JsonProperty(JSON_PROPERTY_TOTAL_ELEMENTS) Long totalElements, + @JsonProperty(JSON_PROPERTY_HAS_NEXT) Boolean hasNext + ) { + this(); + this.totalPages = totalPages; + this.totalElements = totalElements; + this.hasNext = hasNext; + } + + public PageDataAlarmRuleDefinitionInfo data(@Nullable List data) { + this.data = data; + return this; + } + + public PageDataAlarmRuleDefinitionInfo addDataItem(AlarmRuleDefinitionInfo dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Array of the entities + * @return data + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@Nullable List data) { + this.data = data; + } + + + /** + * Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria + * @return totalPages + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_TOTAL_PAGES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotalPages() { + return totalPages; + } + + + + + /** + * Total number of elements in all available pages + * @return totalElements + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_TOTAL_ELEMENTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalElements() { + return totalElements; + } + + + + + /** + * 'false' value indicates the end of the result set + * @return hasNext + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_HAS_NEXT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasNext() { + return hasNext; + } + + + + + /** + * Return true if this PageDataAlarmRuleDefinitionInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PageDataAlarmRuleDefinitionInfo pageDataAlarmRuleDefinitionInfo = (PageDataAlarmRuleDefinitionInfo) o; + return Objects.equals(this.data, pageDataAlarmRuleDefinitionInfo.data) && + Objects.equals(this.totalPages, pageDataAlarmRuleDefinitionInfo.totalPages) && + Objects.equals(this.totalElements, pageDataAlarmRuleDefinitionInfo.totalElements) && + Objects.equals(this.hasNext, pageDataAlarmRuleDefinitionInfo.hasNext); + } + + @Override + public int hashCode() { + return Objects.hash(data, totalPages, totalElements, hasNext); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PageDataAlarmRuleDefinitionInfo {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); + sb.append(" totalElements: ").append(toIndentedString(totalElements)).append("\n"); + sb.append(" hasNext: ").append(toIndentedString(hasNext)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `data` to the URL query string + if (getData() != null) { + for (int i = 0; i < getData().size(); i++) { + if (getData().get(i) != null) { + joiner.add(getData().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sdata%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `totalPages` to the URL query string + if (getTotalPages() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stotalPages%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTotalPages())))); + } + + // add `totalElements` to the URL query string + if (getTotalElements() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stotalElements%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTotalElements())))); + } + + // add `hasNext` to the URL query string + if (getHasNext() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shasNext%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHasNext())))); + } + + return joiner.toString(); + } +} + diff --git a/ce/src/main/java/org/thingsboard/client/model/RepeatingAlarmConditionSpec.java b/ce/src/main/java/org/thingsboard/client/model/RepeatingAlarmConditionSpec.java deleted file mode 100644 index 5b85d41f..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/RepeatingAlarmConditionSpec.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.AlarmConditionSpec; -import org.thingsboard.client.model.FilterPredicateValueInteger; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.JSON; -import org.thingsboard.client.ApiClient; -/** - * RepeatingAlarmConditionSpec - */ -@JsonPropertyOrder({ - RepeatingAlarmConditionSpec.JSON_PROPERTY_PREDICATE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -@JsonIgnoreProperties( - value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) - -public class RepeatingAlarmConditionSpec extends AlarmConditionSpec { - public static final String JSON_PROPERTY_PREDICATE = "predicate"; - @Nullable - private FilterPredicateValueInteger predicate; - - public RepeatingAlarmConditionSpec() { - } - - public RepeatingAlarmConditionSpec predicate(@Nullable FilterPredicateValueInteger predicate) { - this.predicate = predicate; - return this; - } - - /** - * Repeating predicate - * @return predicate - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_PREDICATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FilterPredicateValueInteger getPredicate() { - return predicate; - } - - - @JsonProperty(value = JSON_PROPERTY_PREDICATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPredicate(@Nullable FilterPredicateValueInteger predicate) { - this.predicate = predicate; - } - - - /** - * Return true if this RepeatingAlarmConditionSpec object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RepeatingAlarmConditionSpec repeatingAlarmConditionSpec = (RepeatingAlarmConditionSpec) o; - return Objects.equals(this.predicate, repeatingAlarmConditionSpec.predicate) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(predicate, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RepeatingAlarmConditionSpec {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" predicate: ").append(toIndentedString(predicate)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - // add `predicate` to the URL query string - if (getPredicate() != null) { - joiner.add(getPredicate().toUrlQueryString(prefix + "predicate" + suffix)); - } - - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("RepeatingAlarmConditionSpec", RepeatingAlarmConditionSpec.class); - JSON.registerDiscriminator(RepeatingAlarmConditionSpec.class, "type", mappings); -} -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/RuleChainMetaData.java b/ce/src/main/java/org/thingsboard/client/model/RuleChainMetaData.java index 5356f0f7..17ba1d11 100644 --- a/ce/src/main/java/org/thingsboard/client/model/RuleChainMetaData.java +++ b/ce/src/main/java/org/thingsboard/client/model/RuleChainMetaData.java @@ -35,6 +35,7 @@ import org.thingsboard.client.model.NodeConnectionInfo; import org.thingsboard.client.model.RuleChainConnectionInfo; import org.thingsboard.client.model.RuleChainId; +import org.thingsboard.client.model.RuleChainNote; import org.thingsboard.client.model.RuleNode; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -49,7 +50,8 @@ RuleChainMetaData.JSON_PROPERTY_FIRST_NODE_INDEX, RuleChainMetaData.JSON_PROPERTY_NODES, RuleChainMetaData.JSON_PROPERTY_CONNECTIONS, - RuleChainMetaData.JSON_PROPERTY_RULE_CHAIN_CONNECTIONS + RuleChainMetaData.JSON_PROPERTY_RULE_CHAIN_CONNECTIONS, + RuleChainMetaData.JSON_PROPERTY_NOTES }) @Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") public class RuleChainMetaData { @@ -77,6 +79,10 @@ public class RuleChainMetaData { @Nonnull private List ruleChainConnections = new ArrayList<>(); + public static final String JSON_PROPERTY_NOTES = "notes"; + @Nullable + private List notes = new ArrayList<>(); + public RuleChainMetaData() { } @@ -246,6 +252,38 @@ public void setRuleChainConnections(@Nonnull List ruleC } + public RuleChainMetaData notes(@Nullable List notes) { + this.notes = notes; + return this; + } + + public RuleChainMetaData addNotesItem(RuleChainNote notesItem) { + if (this.notes == null) { + this.notes = new ArrayList<>(); + } + this.notes.add(notesItem); + return this; + } + + /** + * List of sticky notes placed on the rule chain canvas + * @return notes + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_NOTES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNotes() { + return notes; + } + + + @JsonProperty(value = JSON_PROPERTY_NOTES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotes(@Nullable List notes) { + this.notes = notes; + } + + /** * Return true if this RuleChainMetaData object is equal to o. */ @@ -263,12 +301,13 @@ public boolean equals(Object o) { Objects.equals(this.firstNodeIndex, ruleChainMetaData.firstNodeIndex) && Objects.equals(this.nodes, ruleChainMetaData.nodes) && Objects.equals(this.connections, ruleChainMetaData.connections) && - Objects.equals(this.ruleChainConnections, ruleChainMetaData.ruleChainConnections); + Objects.equals(this.ruleChainConnections, ruleChainMetaData.ruleChainConnections) && + Objects.equals(this.notes, ruleChainMetaData.notes); } @Override public int hashCode() { - return Objects.hash(ruleChainId, version, firstNodeIndex, nodes, connections, ruleChainConnections); + return Objects.hash(ruleChainId, version, firstNodeIndex, nodes, connections, ruleChainConnections, notes); } @Override @@ -281,6 +320,7 @@ public String toString() { sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); sb.append(" ruleChainConnections: ").append(toIndentedString(ruleChainConnections)).append("\n"); + sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); sb.append("}"); return sb.toString(); } @@ -373,6 +413,16 @@ public String toUrlQueryString(String prefix) { } } + // add `notes` to the URL query string + if (getNotes() != null) { + for (int i = 0; i < getNotes().size(); i++) { + if (getNotes().get(i) != null) { + joiner.add(getNotes().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%snotes%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + return joiner.toString(); } } diff --git a/ce/src/main/java/org/thingsboard/client/model/RuleChainNote.java b/ce/src/main/java/org/thingsboard/client/model/RuleChainNote.java new file mode 100644 index 00000000..13dd34b3 --- /dev/null +++ b/ce/src/main/java/org/thingsboard/client/model/RuleChainNote.java @@ -0,0 +1,515 @@ +/** + * Copyright © 2026-2026 ThingsBoard, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.client.model; + +import javax.annotation.Generated; +import javax.annotation.Nullable; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.thingsboard.client.ApiClient; +/** + * RuleChainNote + */ +@JsonPropertyOrder({ + RuleChainNote.JSON_PROPERTY_ID, + RuleChainNote.JSON_PROPERTY_X, + RuleChainNote.JSON_PROPERTY_Y, + RuleChainNote.JSON_PROPERTY_WIDTH, + RuleChainNote.JSON_PROPERTY_HEIGHT, + RuleChainNote.JSON_PROPERTY_CONTENT, + RuleChainNote.JSON_PROPERTY_BACKGROUND_COLOR, + RuleChainNote.JSON_PROPERTY_BORDER_COLOR, + RuleChainNote.JSON_PROPERTY_BORDER_WIDTH, + RuleChainNote.JSON_PROPERTY_APPLY_DEFAULT_MARKDOWN_STYLE, + RuleChainNote.JSON_PROPERTY_MARKDOWN_CSS +}) +@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") +public class RuleChainNote { + public static final String JSON_PROPERTY_ID = "id"; + @Nullable + private String id; + + public static final String JSON_PROPERTY_X = "x"; + @Nullable + private Integer x; + + public static final String JSON_PROPERTY_Y = "y"; + @Nullable + private Integer y; + + public static final String JSON_PROPERTY_WIDTH = "width"; + @Nullable + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "height"; + @Nullable + private Integer height; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @Nullable + private String content; + + public static final String JSON_PROPERTY_BACKGROUND_COLOR = "backgroundColor"; + @Nullable + private String backgroundColor; + + public static final String JSON_PROPERTY_BORDER_COLOR = "borderColor"; + @Nullable + private String borderColor; + + public static final String JSON_PROPERTY_BORDER_WIDTH = "borderWidth"; + @Nullable + private Integer borderWidth; + + public static final String JSON_PROPERTY_APPLY_DEFAULT_MARKDOWN_STYLE = "applyDefaultMarkdownStyle"; + @Nullable + private Boolean applyDefaultMarkdownStyle; + + public static final String JSON_PROPERTY_MARKDOWN_CSS = "markdownCss"; + @Nullable + private String markdownCss; + + public RuleChainNote() { + } + + public RuleChainNote id(@Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the note on the canvas + * @return id + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@Nullable String id) { + this.id = id; + } + + + public RuleChainNote x(@Nullable Integer x) { + this.x = x; + return this; + } + + /** + * Horizontal position of the note on the canvas, in pixels + * @return x + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_X, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getX() { + return x; + } + + + @JsonProperty(value = JSON_PROPERTY_X, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(@Nullable Integer x) { + this.x = x; + } + + + public RuleChainNote y(@Nullable Integer y) { + this.y = y; + return this; + } + + /** + * Vertical position of the note on the canvas, in pixels + * @return y + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_Y, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getY() { + return y; + } + + + @JsonProperty(value = JSON_PROPERTY_Y, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(@Nullable Integer y) { + this.y = y; + } + + + public RuleChainNote width(@Nullable Integer width) { + this.width = width; + return this; + } + + /** + * Width of the note, in pixels + * @return width + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_WIDTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + + @JsonProperty(value = JSON_PROPERTY_WIDTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@Nullable Integer width) { + this.width = width; + } + + + public RuleChainNote height(@Nullable Integer height) { + this.height = height; + return this; + } + + /** + * Height of the note, in pixels + * @return height + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + + @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@Nullable Integer height) { + this.height = height; + } + + + public RuleChainNote content(@Nullable String content) { + this.content = content; + return this; + } + + /** + * Markdown or HTML content of the note + * @return content + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@Nullable String content) { + this.content = content; + } + + + public RuleChainNote backgroundColor(@Nullable String backgroundColor) { + this.backgroundColor = backgroundColor; + return this; + } + + /** + * Background color of the note in CSS hex format, e.g. '#FFF9C4' + * @return backgroundColor + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_BACKGROUND_COLOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBackgroundColor() { + return backgroundColor; + } + + + @JsonProperty(value = JSON_PROPERTY_BACKGROUND_COLOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBackgroundColor(@Nullable String backgroundColor) { + this.backgroundColor = backgroundColor; + } + + + public RuleChainNote borderColor(@Nullable String borderColor) { + this.borderColor = borderColor; + return this; + } + + /** + * Border color of the note in CSS hex format, e.g. '#E6C800' + * @return borderColor + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_BORDER_COLOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBorderColor() { + return borderColor; + } + + + @JsonProperty(value = JSON_PROPERTY_BORDER_COLOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBorderColor(@Nullable String borderColor) { + this.borderColor = borderColor; + } + + + public RuleChainNote borderWidth(@Nullable Integer borderWidth) { + this.borderWidth = borderWidth; + return this; + } + + /** + * Border width of the note in pixels + * @return borderWidth + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_BORDER_WIDTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBorderWidth() { + return borderWidth; + } + + + @JsonProperty(value = JSON_PROPERTY_BORDER_WIDTH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBorderWidth(@Nullable Integer borderWidth) { + this.borderWidth = borderWidth; + } + + + public RuleChainNote applyDefaultMarkdownStyle(@Nullable Boolean applyDefaultMarkdownStyle) { + this.applyDefaultMarkdownStyle = applyDefaultMarkdownStyle; + return this; + } + + /** + * Whether to apply the default markdown stylesheet to the note content + * @return applyDefaultMarkdownStyle + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_APPLY_DEFAULT_MARKDOWN_STYLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getApplyDefaultMarkdownStyle() { + return applyDefaultMarkdownStyle; + } + + + @JsonProperty(value = JSON_PROPERTY_APPLY_DEFAULT_MARKDOWN_STYLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplyDefaultMarkdownStyle(@Nullable Boolean applyDefaultMarkdownStyle) { + this.applyDefaultMarkdownStyle = applyDefaultMarkdownStyle; + } + + + public RuleChainNote markdownCss(@Nullable String markdownCss) { + this.markdownCss = markdownCss; + return this; + } + + /** + * Custom CSS styles applied to the note content + * @return markdownCss + */ + @Nullable + @JsonProperty(value = JSON_PROPERTY_MARKDOWN_CSS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMarkdownCss() { + return markdownCss; + } + + + @JsonProperty(value = JSON_PROPERTY_MARKDOWN_CSS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMarkdownCss(@Nullable String markdownCss) { + this.markdownCss = markdownCss; + } + + + /** + * Return true if this RuleChainNote object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RuleChainNote ruleChainNote = (RuleChainNote) o; + return Objects.equals(this.id, ruleChainNote.id) && + Objects.equals(this.x, ruleChainNote.x) && + Objects.equals(this.y, ruleChainNote.y) && + Objects.equals(this.width, ruleChainNote.width) && + Objects.equals(this.height, ruleChainNote.height) && + Objects.equals(this.content, ruleChainNote.content) && + Objects.equals(this.backgroundColor, ruleChainNote.backgroundColor) && + Objects.equals(this.borderColor, ruleChainNote.borderColor) && + Objects.equals(this.borderWidth, ruleChainNote.borderWidth) && + Objects.equals(this.applyDefaultMarkdownStyle, ruleChainNote.applyDefaultMarkdownStyle) && + Objects.equals(this.markdownCss, ruleChainNote.markdownCss); + } + + @Override + public int hashCode() { + return Objects.hash(id, x, y, width, height, content, backgroundColor, borderColor, borderWidth, applyDefaultMarkdownStyle, markdownCss); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RuleChainNote {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" backgroundColor: ").append(toIndentedString(backgroundColor)).append("\n"); + sb.append(" borderColor: ").append(toIndentedString(borderColor)).append("\n"); + sb.append(" borderWidth: ").append(toIndentedString(borderWidth)).append("\n"); + sb.append(" applyDefaultMarkdownStyle: ").append(toIndentedString(applyDefaultMarkdownStyle)).append("\n"); + sb.append(" markdownCss: ").append(toIndentedString(markdownCss)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `x` to the URL query string + if (getX() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sx%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getX())))); + } + + // add `y` to the URL query string + if (getY() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sy%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getY())))); + } + + // add `width` to the URL query string + if (getWidth() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%swidth%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWidth())))); + } + + // add `height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheight%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + // add `content` to the URL query string + if (getContent() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scontent%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getContent())))); + } + + // add `backgroundColor` to the URL query string + if (getBackgroundColor() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbackgroundColor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBackgroundColor())))); + } + + // add `borderColor` to the URL query string + if (getBorderColor() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sborderColor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBorderColor())))); + } + + // add `borderWidth` to the URL query string + if (getBorderWidth() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sborderWidth%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBorderWidth())))); + } + + // add `applyDefaultMarkdownStyle` to the URL query string + if (getApplyDefaultMarkdownStyle() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sapplyDefaultMarkdownStyle%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getApplyDefaultMarkdownStyle())))); + } + + // add `markdownCss` to the URL query string + if (getMarkdownCss() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smarkdownCss%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMarkdownCss())))); + } + + return joiner.toString(); + } +} + diff --git a/ce/src/main/java/org/thingsboard/client/model/ShortCustomerInfo.java b/ce/src/main/java/org/thingsboard/client/model/ShortCustomerInfo.java index f0063304..c7e32212 100644 --- a/ce/src/main/java/org/thingsboard/client/model/ShortCustomerInfo.java +++ b/ce/src/main/java/org/thingsboard/client/model/ShortCustomerInfo.java @@ -40,7 +40,7 @@ @JsonPropertyOrder({ ShortCustomerInfo.JSON_PROPERTY_CUSTOMER_ID, ShortCustomerInfo.JSON_PROPERTY_TITLE, - ShortCustomerInfo.JSON_PROPERTY_IS_PUBLIC + ShortCustomerInfo.JSON_PROPERTY_PUBLIC }) @Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") public class ShortCustomerInfo { @@ -52,9 +52,9 @@ public class ShortCustomerInfo { @Nullable private String title; - public static final String JSON_PROPERTY_IS_PUBLIC = "isPublic"; + public static final String JSON_PROPERTY_PUBLIC = "public"; @Nullable - private Boolean isPublic; + private Boolean _public; public ShortCustomerInfo() { } @@ -107,27 +107,27 @@ public void setTitle(@Nullable String title) { } - public ShortCustomerInfo isPublic(@Nullable Boolean isPublic) { - this.isPublic = isPublic; + public ShortCustomerInfo _public(@Nullable Boolean _public) { + this._public = _public; return this; } /** * Indicates special 'Public' customer used to embed dashboards on public websites. - * @return isPublic + * @return _public */ @Nullable - @JsonProperty(value = JSON_PROPERTY_IS_PUBLIC, required = false) + @JsonProperty(value = JSON_PROPERTY_PUBLIC, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsPublic() { - return isPublic; + public Boolean getPublic() { + return _public; } - @JsonProperty(value = JSON_PROPERTY_IS_PUBLIC, required = false) + @JsonProperty(value = JSON_PROPERTY_PUBLIC, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPublic(@Nullable Boolean isPublic) { - this.isPublic = isPublic; + public void setPublic(@Nullable Boolean _public) { + this._public = _public; } @@ -145,12 +145,12 @@ public boolean equals(Object o) { ShortCustomerInfo shortCustomerInfo = (ShortCustomerInfo) o; return Objects.equals(this.customerId, shortCustomerInfo.customerId) && Objects.equals(this.title, shortCustomerInfo.title) && - Objects.equals(this.isPublic, shortCustomerInfo.isPublic); + Objects.equals(this._public, shortCustomerInfo._public); } @Override public int hashCode() { - return Objects.hash(customerId, title, isPublic); + return Objects.hash(customerId, title, _public); } @Override @@ -159,7 +159,7 @@ public String toString() { sb.append("class ShortCustomerInfo {\n"); sb.append(" customerId: ").append(toIndentedString(customerId)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" isPublic: ").append(toIndentedString(isPublic)).append("\n"); + sb.append(" _public: ").append(toIndentedString(_public)).append("\n"); sb.append("}"); return sb.toString(); } @@ -217,9 +217,9 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%stitle%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTitle())))); } - // add `isPublic` to the URL query string - if (getIsPublic() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sisPublic%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIsPublic())))); + // add `public` to the URL query string + if (getPublic() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spublic%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPublic())))); } return joiner.toString(); diff --git a/ce/src/main/java/org/thingsboard/client/model/SimpleAlarmConditionSpec.java b/ce/src/main/java/org/thingsboard/client/model/SimpleAlarmConditionSpec.java deleted file mode 100644 index e20fa7d5..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/SimpleAlarmConditionSpec.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.thingsboard.client.model.AlarmConditionSpec; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.JSON; -import org.thingsboard.client.ApiClient; -/** - * SimpleAlarmConditionSpec - */ -@JsonPropertyOrder({ -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -@JsonIgnoreProperties( - value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) - -public class SimpleAlarmConditionSpec extends AlarmConditionSpec { - public SimpleAlarmConditionSpec() { - } - - /** - * Return true if this SimpleAlarmConditionSpec object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SimpleAlarmConditionSpec {\n"); - sb.append(" ").append(toIndentedString(super.toString())).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("SimpleAlarmConditionSpec", SimpleAlarmConditionSpec.class); - JSON.registerDiscriminator(SimpleAlarmConditionSpec.class, "type", mappings); -} -} - diff --git a/ce/src/main/java/org/thingsboard/client/model/SpecificTimeSchedule.java b/ce/src/main/java/org/thingsboard/client/model/SpecificTimeSchedule.java deleted file mode 100644 index 52357af7..00000000 --- a/ce/src/main/java/org/thingsboard/client/model/SpecificTimeSchedule.java +++ /dev/null @@ -1,318 +0,0 @@ -/** - * Copyright © 2026-2026 ThingsBoard, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.client.model; - -import javax.annotation.Generated; -import javax.annotation.Nullable; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.Set; -import org.thingsboard.client.model.AlarmSchedule; -import org.thingsboard.client.model.AlarmScheduleType; -import org.thingsboard.client.model.DynamicValueString; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import org.thingsboard.client.JSON; -import org.thingsboard.client.ApiClient; -/** - * SpecificTimeSchedule - */ -@JsonPropertyOrder({ - SpecificTimeSchedule.JSON_PROPERTY_DAYS_OF_WEEK, - SpecificTimeSchedule.JSON_PROPERTY_ENDS_ON, - SpecificTimeSchedule.JSON_PROPERTY_STARTS_ON, - SpecificTimeSchedule.JSON_PROPERTY_TIMEZONE -}) -@Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") -@JsonIgnoreProperties( - value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) - -public class SpecificTimeSchedule extends AlarmSchedule { - public static final String JSON_PROPERTY_DAYS_OF_WEEK = "daysOfWeek"; - @Nullable - private Set daysOfWeek = new LinkedHashSet<>(); - - public static final String JSON_PROPERTY_ENDS_ON = "endsOn"; - @Nullable - private Long endsOn; - - public static final String JSON_PROPERTY_STARTS_ON = "startsOn"; - @Nullable - private Long startsOn; - - public static final String JSON_PROPERTY_TIMEZONE = "timezone"; - @Nullable - private String timezone; - - public SpecificTimeSchedule() { - } - - public SpecificTimeSchedule daysOfWeek(@Nullable Set daysOfWeek) { - this.daysOfWeek = daysOfWeek; - return this; - } - - public SpecificTimeSchedule addDaysOfWeekItem(Integer daysOfWeekItem) { - if (this.daysOfWeek == null) { - this.daysOfWeek = new LinkedHashSet<>(); - } - this.daysOfWeek.add(daysOfWeekItem); - return this; - } - - /** - * Get daysOfWeek - * @return daysOfWeek - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_DAYS_OF_WEEK, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Set getDaysOfWeek() { - return daysOfWeek; - } - - - @JsonDeserialize(as = LinkedHashSet.class) - @JsonProperty(value = JSON_PROPERTY_DAYS_OF_WEEK, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDaysOfWeek(@Nullable Set daysOfWeek) { - this.daysOfWeek = daysOfWeek; - } - - - public SpecificTimeSchedule endsOn(@Nullable Long endsOn) { - this.endsOn = endsOn; - return this; - } - - /** - * Get endsOn - * @return endsOn - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_ENDS_ON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getEndsOn() { - return endsOn; - } - - - @JsonProperty(value = JSON_PROPERTY_ENDS_ON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEndsOn(@Nullable Long endsOn) { - this.endsOn = endsOn; - } - - - public SpecificTimeSchedule startsOn(@Nullable Long startsOn) { - this.startsOn = startsOn; - return this; - } - - /** - * Get startsOn - * @return startsOn - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_STARTS_ON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getStartsOn() { - return startsOn; - } - - - @JsonProperty(value = JSON_PROPERTY_STARTS_ON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStartsOn(@Nullable Long startsOn) { - this.startsOn = startsOn; - } - - - public SpecificTimeSchedule timezone(@Nullable String timezone) { - this.timezone = timezone; - return this; - } - - /** - * Get timezone - * @return timezone - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTimezone() { - return timezone; - } - - - @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTimezone(@Nullable String timezone) { - this.timezone = timezone; - } - - - @Override - public SpecificTimeSchedule dynamicValue(@Nullable DynamicValueString dynamicValue) { - this.setDynamicValue(dynamicValue); - return this; - } - - /** - * Return true if this SpecificTimeSchedule object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecificTimeSchedule specificTimeSchedule = (SpecificTimeSchedule) o; - return Objects.equals(this.daysOfWeek, specificTimeSchedule.daysOfWeek) && - Objects.equals(this.endsOn, specificTimeSchedule.endsOn) && - Objects.equals(this.startsOn, specificTimeSchedule.startsOn) && - Objects.equals(this.timezone, specificTimeSchedule.timezone) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(daysOfWeek, endsOn, startsOn, timezone, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecificTimeSchedule {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" daysOfWeek: ").append(toIndentedString(daysOfWeek)).append("\n"); - sb.append(" endsOn: ").append(toIndentedString(endsOn)).append("\n"); - sb.append(" startsOn: ").append(toIndentedString(startsOn)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).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 "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `dynamicValue` to the URL query string - if (getDynamicValue() != null) { - joiner.add(getDynamicValue().toUrlQueryString(prefix + "dynamicValue" + suffix)); - } - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); - } - - // add `daysOfWeek` to the URL query string - if (getDaysOfWeek() != null) { - int i = 0; - for (Integer _item : getDaysOfWeek()) { - joiner.add(String.format(java.util.Locale.ROOT, "%sdaysOfWeek%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), - ApiClient.urlEncode(ApiClient.valueToString(_item)))); - } - i++; - } - - // add `endsOn` to the URL query string - if (getEndsOn() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sendsOn%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEndsOn())))); - } - - // add `startsOn` to the URL query string - if (getStartsOn() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sstartsOn%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStartsOn())))); - } - - // add `timezone` to the URL query string - if (getTimezone() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%stimezone%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTimezone())))); - } - - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("SpecificTimeSchedule", SpecificTimeSchedule.class); - JSON.registerDiscriminator(SpecificTimeSchedule.class, "type", mappings); -} -} -