diff --git a/paas/docs/AiChatControllerApi.md b/paas/docs/AiChatControllerApi.md index 152cad2b..dda839c3 100644 --- a/paas/docs/AiChatControllerApi.md +++ b/paas/docs/AiChatControllerApi.md @@ -6,7 +6,7 @@ com.fasterxml.jackson.databind.JsonNode createChat(@Nonnull Object body) // createChat void deleteChat(@Nonnull UUID chatId) // deleteChat com.fasterxml.jackson.databind.JsonNode getChatMessages(@Nonnull UUID chatId) // getChatMessages -com.fasterxml.jackson.databind.JsonNode listChats() // listChats +com.fasterxml.jackson.databind.JsonNode listChats(@Nonnull ChatType chatType) // listChats List sendChatMessage(@Nonnull UUID chatId, @Nonnull String xAuthorization, @Nonnull String body) // sendChatMessage void updateChat(@Nonnull UUID chatId, @Nonnull Object body) // updateChat ``` @@ -81,13 +81,20 @@ getChatMessages ## listChats ``` -com.fasterxml.jackson.databind.JsonNode listChats() +com.fasterxml.jackson.databind.JsonNode listChats(@Nonnull ChatType chatType) ``` -**GET** `/api/ai/chats` +**GET** `/api/ai/chats/{chatType}` listChats + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **chatType** | **ChatType** | | [enum: GENERIC, SOLUTION_BUILDER] | + ### Return type **com.fasterxml.jackson.databind.JsonNode** diff --git a/paas/docs/AiSolutionControllerApi.md b/paas/docs/AiSolutionControllerApi.md new file mode 100644 index 00000000..010affd9 --- /dev/null +++ b/paas/docs/AiSolutionControllerApi.md @@ -0,0 +1,276 @@ +# AiSolutionControllerApi + +`ThingsboardClient` methods: + +``` +com.fasterxml.jackson.databind.JsonNode chat(@Nonnull UUID solutionId, @Nonnull SolutionStep step, @Nonnull String body) // chat +void clearStep(@Nonnull UUID solutionId, @Nonnull SolutionStep step) // clearStep +com.fasterxml.jackson.databind.JsonNode createSolution(@Nonnull UUID solutionId) // createSolution +void deleteSolution(@Nonnull UUID solutionId) // deleteSolution +com.fasterxml.jackson.databind.JsonNode exportSolution(@Nonnull UUID solutionId) // exportSolution +com.fasterxml.jackson.databind.JsonNode getSolution(@Nonnull UUID solutionId) // getSolution +com.fasterxml.jackson.databind.JsonNode getSolutions() // getSolutions +com.fasterxml.jackson.databind.JsonNode importSolution(@Nonnull Object body) // importSolution +com.fasterxml.jackson.databind.JsonNode installSolution(@Nonnull UUID solutionId, @Nonnull String xAuthorization) // installSolution +com.fasterxml.jackson.databind.JsonNode startNew() // startNew +com.fasterxml.jackson.databind.JsonNode uninstallSolution(@Nonnull UUID solutionId, @Nonnull String xAuthorization) // uninstallSolution +com.fasterxml.jackson.databind.JsonNode updateData(@Nonnull UUID solutionId, @Nonnull String dataKey, @Nonnull Object body) // updateData +``` + + +## chat + +``` +com.fasterxml.jackson.databind.JsonNode chat(@Nonnull UUID solutionId, @Nonnull SolutionStep step, @Nonnull String body) +``` + +**POST** `/api/ai/solution/{solutionId}/{step}/chat` + +chat + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | +| **step** | **SolutionStep** | | [enum: INITIAL_CONFIGURATION, DASHBOARDS_CONFIGURATION] | +| **body** | **String** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## clearStep + +``` +void clearStep(@Nonnull UUID solutionId, @Nonnull SolutionStep step) +``` + +**DELETE** `/api/ai/solution/{solutionId}/{step}/clear` + +clearStep + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | +| **step** | **SolutionStep** | | [enum: INITIAL_CONFIGURATION, DASHBOARDS_CONFIGURATION] | + +### Return type + +null (empty response body) + + +## createSolution + +``` +com.fasterxml.jackson.databind.JsonNode createSolution(@Nonnull UUID solutionId) +``` + +**POST** `/api/ai/solution/{solutionId}/create` + +createSolution + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## deleteSolution + +``` +void deleteSolution(@Nonnull UUID solutionId) +``` + +**DELETE** `/api/ai/solution/{solutionId}` + +deleteSolution + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | + +### Return type + +null (empty response body) + + +## exportSolution + +``` +com.fasterxml.jackson.databind.JsonNode exportSolution(@Nonnull UUID solutionId) +``` + +**GET** `/api/ai/solution/{solutionId}/export` + +exportSolution + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## getSolution + +``` +com.fasterxml.jackson.databind.JsonNode getSolution(@Nonnull UUID solutionId) +``` + +**GET** `/api/ai/solution/{solutionId}` + +getSolution + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## getSolutions + +``` +com.fasterxml.jackson.databind.JsonNode getSolutions() +``` + +**GET** `/api/ai/solution/infos` + +getSolutions + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## importSolution + +``` +com.fasterxml.jackson.databind.JsonNode importSolution(@Nonnull Object body) +``` + +**POST** `/api/ai/solution/import` + +importSolution + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Object** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## installSolution + +``` +com.fasterxml.jackson.databind.JsonNode installSolution(@Nonnull UUID solutionId, @Nonnull String xAuthorization) +``` + +**POST** `/api/ai/solution/{solutionId}/install` + +installSolution + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | +| **xAuthorization** | **String** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## startNew + +``` +com.fasterxml.jackson.databind.JsonNode startNew() +``` + +**POST** `/api/ai/solution/start` + +startNew + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## uninstallSolution + +``` +com.fasterxml.jackson.databind.JsonNode uninstallSolution(@Nonnull UUID solutionId, @Nonnull String xAuthorization) +``` + +**DELETE** `/api/ai/solution/{solutionId}/uninstall` + +uninstallSolution + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | +| **xAuthorization** | **String** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + + +## updateData + +``` +com.fasterxml.jackson.databind.JsonNode updateData(@Nonnull UUID solutionId, @Nonnull String dataKey, @Nonnull Object body) +``` + +**PUT** `/api/ai/solution/{solutionId}/{dataKey}` + +updateData + + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **solutionId** | **UUID** | | | +| **dataKey** | **String** | | | +| **body** | **Object** | | | + +### Return type + +**com.fasterxml.jackson.databind.JsonNode** + diff --git a/paas/docs/CalculatedFieldConfiguration.md b/paas/docs/CalculatedFieldConfiguration.md index 70f7f97b..e8892590 100644 --- a/paas/docs/CalculatedFieldConfiguration.md +++ b/paas/docs/CalculatedFieldConfiguration.md @@ -9,7 +9,6 @@ |------------ | ------------- | ------------- | -------------| | **type** | **String** | | | | **output** | **Output** | | [optional] | -| **aiGenerated** | **Boolean** | | [optional] | diff --git a/paas/docs/ChatType.md b/paas/docs/ChatType.md new file mode 100644 index 00000000..4dd1fe97 --- /dev/null +++ b/paas/docs/ChatType.md @@ -0,0 +1,23 @@ + +# ChatType + +`org.thingsboard.client.model.ChatType` + +## Enum Values + + +* `GENERIC` (value: `"GENERIC"`) + +* `SOLUTION_BUILDER` (value: `"SOLUTION_BUILDER"`) + + + +--- + +### 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/paas/docs/Resource.md b/paas/docs/Resource.md index 47f6b790..68984789 100644 --- a/paas/docs/Resource.md +++ b/paas/docs/Resource.md @@ -112,7 +112,7 @@ * `AI_MODEL` (value: `"AI_MODEL"`) -* `AI_SOLUTION_CREATOR` (value: `"AI_SOLUTION_CREATOR"`) +* `AI` (value: `"AI"`) * `API_KEY` (value: `"API_KEY"`) diff --git a/paas/docs/RuleChainMetaData.md b/paas/docs/RuleChainMetaData.md index 57c05c5d..8d44b2cd 100644 --- a/paas/docs/RuleChainMetaData.md +++ b/paas/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/paas/docs/RuleChainNote.md b/paas/docs/RuleChainNote.md new file mode 100644 index 00000000..09b6dacc --- /dev/null +++ b/paas/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/paas/docs/ShortCustomerInfo.md b/paas/docs/ShortCustomerInfo.md index d06b45f3..a15d02ea 100644 --- a/paas/docs/ShortCustomerInfo.md +++ b/paas/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/paas/docs/SolutionStep.md b/paas/docs/SolutionStep.md new file mode 100644 index 00000000..323ef8ab --- /dev/null +++ b/paas/docs/SolutionStep.md @@ -0,0 +1,23 @@ + +# SolutionStep + +`org.thingsboard.client.model.SolutionStep` + +## Enum Values + + +* `INITIAL_CONFIGURATION` (value: `"INITIAL_CONFIGURATION"`) + +* `DASHBOARDS_CONFIGURATION` (value: `"DASHBOARDS_CONFIGURATION"`) + + + +--- + +### 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/paas/spec/openapi.json b/paas/spec/openapi.json index d5dab343..93d76c84 100644 --- a/paas/spec/openapi.json +++ b/paas/spec/openapi.json @@ -12,7 +12,7 @@ "name": "Apache License Version 2.0", "url": "https://github.com/thingsboard/thingsboard/blob/master/LICENSE" }, - "version": "4.4.0PE-SNAPSHOT" + "version": "4.4.0PAAS" }, "servers": [ { @@ -33,6 +33,10 @@ "name": "ai-model-controller", "description": "Ai Model Controller" }, + { + "name": "ai-solution-controller", + "description": "Ai Solution Controller" + }, { "name": "ai-tool-controller", "description": "Ai Tool Controller" @@ -4178,15 +4182,25 @@ } }, "/api/ai/chats": { - "get": { + "post": { "tags": [ "ai-chat-controller" ], - "summary": "listChats", - "operationId": "listChats", + "summary": "createChat", + "operationId": "createChat", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + }, + "required": true + }, "responses": { - "200": { - "description": "OK", + "201": { + "description": "Created", "content": { "application/json": { "schema": { @@ -4195,6 +4209,159 @@ } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/chats/{chatId}": { + "delete": { + "tags": [ + "ai-chat-controller" + ], + "summary": "deleteChat", + "operationId": "deleteChat", + "parameters": [ + { + "name": "chatId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, "400": { "description": "Bad Request", "content": { @@ -4325,12 +4492,23 @@ } ] }, - "post": { + "patch": { "tags": [ "ai-chat-controller" ], - "summary": "createChat", - "operationId": "createChat", + "summary": "updateChat", + "operationId": "updateChat", + "parameters": [ + { + "name": "chatId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], "requestBody": { "content": { "application/json": { @@ -4342,15 +4520,8 @@ "required": true }, "responses": { - "201": { - "description": "Created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JsonNode" - } - } - } + "204": { + "description": "No Content" }, "400": { "description": "Bad Request", @@ -4363,7 +4534,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -4483,13 +4654,13 @@ ] } }, - "/api/ai/chats/{chatId}": { - "delete": { + "/api/ai/chats/{chatId}/messages": { + "get": { "tags": [ "ai-chat-controller" ], - "summary": "deleteChat", - "operationId": "deleteChat", + "summary": "getChatMessages", + "operationId": "getChatMessages", "parameters": [ { "name": "chatId", @@ -4502,8 +4673,15 @@ } ], "responses": { - "204": { - "description": "No Content" + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + } }, "400": { "description": "Bad Request", @@ -4635,12 +4813,12 @@ } ] }, - "patch": { + "post": { "tags": [ "ai-chat-controller" ], - "summary": "updateChat", - "operationId": "updateChat", + "summary": "sendChatMessage", + "operationId": "sendChatMessage", "parameters": [ { "name": "chatId", @@ -4650,21 +4828,39 @@ "type": "string", "format": "uuid" } + }, + { + "name": "X-Authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } } ], "requestBody": { "content": { - "application/json": { + "text/plain": { "schema": { - "$ref": "#/components/schemas/JsonNode" + "type": "string" } } }, "required": true }, "responses": { - "204": { - "description": "No Content" + "200": { + "description": "OK", + "content": { + "text/event-stream": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ServerSentEventString" + } + } + } + } }, "400": { "description": "Bad Request", @@ -4677,7 +4873,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -4797,16 +4993,1483 @@ ] } }, - "/api/ai/chats/{chatId}/messages": { + "/api/ai/chats/{chatType}": { "get": { "tags": [ "ai-chat-controller" ], - "summary": "getChatMessages", - "operationId": "getChatMessages", + "summary": "listChats", + "operationId": "listChats", "parameters": [ { - "name": "chatId", + "name": "chatType", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/ChatType" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/model": { + "get": { + "tags": [ + "ai-model-controller" + ], + "summary": "Get AI models (getAiModels)", + "description": "Returns a page of AI models. 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": "getAiModels", + "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 AI model name, provider and model ID.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "provider", + "modelId" + ] + } + }, + { + "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/PageDataAiModel" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + }, + "post": { + "tags": [ + "ai-model-controller" + ], + "summary": "Create or update AI model (saveAiModel)", + "description": "Creates or updates an AI model record.\n\n• **Create:** Omit the `id` to create a new record. The platform assigns a UUID to the new record and returns it in the `id` field of the response.\n\n• **Update:** Include an existing `id` to modify that record. If no matching record exists, the API responds with **404 Not Found**.\n\nTenant ID for the AI model will be taken from the authenticated user making the request, regardless of any value provided in the request body.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveAiModel", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiModel" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiModel" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/model/chat": { + "post": { + "tags": [ + "ai-model-controller" + ], + "summary": "Send request to AI chat model (sendChatRequest)", + "description": "Submits a single prompt - made up of an optional system message and a required user message - to the specified AI chat model and returns either the generated answer or an error envelope.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "sendChatRequest", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TbChatRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TbChatResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/model/{modelUuid}": { + "get": { + "tags": [ + "ai-model-controller" + ], + "summary": "Get AI model by ID (getAiModelById)", + "description": "Fetches an AI model record by its `id`.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAiModelById", + "parameters": [ + { + "name": "modelUuid", + "in": "path", + "description": "ID of the AI model record", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + }, + "example": "de7900d4-30e2-11f0-9cd2-0242ac120002" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AiModel" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + }, + "delete": { + "tags": [ + "ai-model-controller" + ], + "summary": "Delete AI model by ID (deleteAiModelById)", + "description": "Deletes the AI model record by its `id`. If a record with the specified `id` exists, the record is deleted and the endpoint returns `true`. If no such record exists, the endpoint returns `false`.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteAiModelById", + "parameters": [ + { + "name": "modelUuid", + "in": "path", + "description": "ID of the AI model record", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + }, + "example": "de7900d4-30e2-11f0-9cd2-0242ac120002" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/solution/import": { + "post": { + "tags": [ + "ai-solution-controller" + ], + "summary": "importSolution", + "operationId": "importSolution", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/solution/infos": { + "get": { + "tags": [ + "ai-solution-controller" + ], + "summary": "getSolutions", + "operationId": "getSolutions", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/solution/start": { + "post": { + "tags": [ + "ai-solution-controller" + ], + "summary": "startNew", + "operationId": "startNew", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/solution/{solutionId}": { + "get": { + "tags": [ + "ai-solution-controller" + ], + "summary": "getSolution", + "operationId": "getSolution", + "parameters": [ + { + "name": "solutionId", "in": "path", "required": true, "schema": { @@ -4956,51 +6619,183 @@ } ] }, - "post": { + "delete": { "tags": [ - "ai-chat-controller" + "ai-solution-controller" ], - "summary": "sendChatMessage", - "operationId": "sendChatMessage", + "summary": "deleteSolution", + "operationId": "deleteSolution", "parameters": [ { - "name": "chatId", + "name": "solutionId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ { - "name": "X-Authorization", - "in": "header", + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/solution/{solutionId}/create": { + "post": { + "tags": [ + "ai-solution-controller" + ], + "summary": "createSolution", + "operationId": "createSolution", + "parameters": [ + { + "name": "solutionId", + "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], - "requestBody": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { - "text/event-stream": { + "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ServerSentEventString" - } + "$ref": "#/components/schemas/JsonNode" } } } @@ -5136,70 +6931,21 @@ ] } }, - "/api/ai/model": { + "/api/ai/solution/{solutionId}/export": { "get": { "tags": [ - "ai-model-controller" + "ai-solution-controller" ], - "summary": "Get AI models (getAiModels)", - "description": "Returns a page of AI models. 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": "getAiModels", + "summary": "exportSolution", + "operationId": "exportSolution", "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": "solutionId", + "in": "path", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the AI model name, provider and model ID.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "provider", - "modelId" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, "schema": { "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "format": "uuid" } } ], @@ -5209,7 +6955,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataAiModel" + "$ref": "#/components/schemas/JsonNode" } } } @@ -5343,31 +7089,41 @@ "ApiKeyForm": [] } ] - }, + } + }, + "/api/ai/solution/{solutionId}/install": { "post": { "tags": [ - "ai-model-controller" + "ai-solution-controller" ], - "summary": "Create or update AI model (saveAiModel)", - "description": "Creates or updates an AI model record.\n\n• **Create:** Omit the `id` to create a new record. The platform assigns a UUID to the new record and returns it in the `id` field of the response.\n\n• **Update:** Include an existing `id` to modify that record. If no matching record exists, the API responds with **404 Not Found**.\n\nTenant ID for the AI model will be taken from the authenticated user making the request, regardless of any value provided in the request body.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveAiModel", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiModel" - } + "summary": "installSolution", + "operationId": "installSolution", + "parameters": [ + { + "name": "solutionId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" } }, - "required": true - }, + { + "name": "X-Authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AiModel" + "$ref": "#/components/schemas/JsonNode" } } } @@ -5503,31 +7259,39 @@ ] } }, - "/api/ai/model/chat": { - "post": { + "/api/ai/solution/{solutionId}/uninstall": { + "delete": { "tags": [ - "ai-model-controller" + "ai-solution-controller" ], - "summary": "Send request to AI chat model (sendChatRequest)", - "description": "Submits a single prompt - made up of an optional system message and a required user message - to the specified AI chat model and returns either the generated answer or an error envelope.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "sendChatRequest", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TbChatRequest" - } + "summary": "uninstallSolution", + "operationId": "uninstallSolution", + "parameters": [ + { + "name": "solutionId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" } }, - "required": true - }, + { + "name": "X-Authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbChatResponse" + "$ref": "#/components/schemas/JsonNode" } } } @@ -5543,7 +7307,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -5663,34 +7427,49 @@ ] } }, - "/api/ai/model/{modelUuid}": { - "get": { + "/api/ai/solution/{solutionId}/{dataKey}": { + "put": { "tags": [ - "ai-model-controller" + "ai-solution-controller" ], - "summary": "Get AI model by ID (getAiModelById)", - "description": "Fetches an AI model record by its `id`.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getAiModelById", + "summary": "updateData", + "operationId": "updateData", "parameters": [ { - "name": "modelUuid", + "name": "solutionId", "in": "path", - "description": "ID of the AI model record", "required": true, "schema": { "type": "string", "format": "uuid" - }, - "example": "de7900d4-30e2-11f0-9cd2-0242ac120002" + } + }, + { + "name": "dataKey", + "in": "path", + "required": true, + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AiModel" + "$ref": "#/components/schemas/JsonNode" } } } @@ -5824,38 +7603,216 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/ai/solution/{solutionId}/{step}/chat": { + "post": { "tags": [ - "ai-model-controller" + "ai-solution-controller" ], - "summary": "Delete AI model by ID (deleteAiModelById)", - "description": "Deletes the AI model record by its `id`. If a record with the specified `id` exists, the record is deleted and the endpoint returns `true`. If no such record exists, the endpoint returns `false`.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteAiModelById", + "summary": "chat", + "operationId": "chat", "parameters": [ { - "name": "modelUuid", + "name": "solutionId", "in": "path", - "description": "ID of the AI model record", "required": true, "schema": { "type": "string", "format": "uuid" - }, - "example": "de7900d4-30e2-11f0-9cd2-0242ac120002" + } + }, + { + "name": "step", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/SolutionStep" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/JsonNode" } } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/ai/solution/{solutionId}/{step}/clear": { + "delete": { + "tags": [ + "ai-solution-controller" + ], + "summary": "clearStep", + "operationId": "clearStep", + "parameters": [ + { + "name": "solutionId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "step", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/SolutionStep" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, "400": { "description": "Bad Request", "content": { @@ -134769,9 +136726,6 @@ }, "output": { "$ref": "#/components/schemas/Output" - }, - "aiGenerated": { - "type": "boolean" } }, "required": [ @@ -135208,6 +137162,13 @@ "none" ] }, + "ChatType": { + "type": "string", + "enum": [ + "GENERIC", + "SOLUTION_BUILDER" + ] + }, "CheckPreProvisionedDevicesDeviceProfileProvisionConfiguration": { "allOf": [ { @@ -150770,7 +152731,7 @@ "REPORT_TEMPLATE", "REPORT", "AI_MODEL", - "AI_SOLUTION_CREATOR", + "AI", "API_KEY" ] }, @@ -151315,6 +153276,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": [ @@ -151325,6 +153293,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": { @@ -152362,7 +154384,7 @@ "type": "string", "description": "Title of the customer." }, - "isPublic": { + "public": { "type": "boolean", "description": "Indicates special 'Public' customer used to embed dashboards on public websites." } @@ -153023,6 +155045,13 @@ } } }, + "SolutionStep": { + "type": "string", + "enum": [ + "INITIAL_CONFIGURATION", + "DASHBOARDS_CONFIGURATION" + ] + }, "SolutionTemplateLevel": { "type": "string", "enum": [ diff --git a/paas/src/main/java/org/thingsboard/client/Configuration.java b/paas/src/main/java/org/thingsboard/client/Configuration.java index b4f33f2f..4641961a 100644 --- a/paas/src/main/java/org/thingsboard/client/Configuration.java +++ b/paas/src/main/java/org/thingsboard/client/Configuration.java @@ -22,7 +22,7 @@ @Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") public class Configuration { - public static final String VERSION = "4.4.0PE-SNAPSHOT"; + public static final String VERSION = "4.4.0PAAS"; private static final AtomicReference defaultApiClient = new AtomicReference<>(); private static volatile Supplier apiClientFactory = ApiClient::new; diff --git a/paas/src/main/java/org/thingsboard/client/api/ThingsboardApi.java b/paas/src/main/java/org/thingsboard/client/api/ThingsboardApi.java index c5c0fdf4..425d5974 100644 --- a/paas/src/main/java/org/thingsboard/client/api/ThingsboardApi.java +++ b/paas/src/main/java/org/thingsboard/client/api/ThingsboardApi.java @@ -59,6 +59,7 @@ import org.thingsboard.client.model.CaptchaClientParams; import org.thingsboard.client.model.CfReprocessingValidationResult; import org.thingsboard.client.model.ChangePasswordRequest; +import org.thingsboard.client.model.ChatType; import org.thingsboard.client.model.ClaimRequest; import org.thingsboard.client.model.ComponentDescriptor; import org.thingsboard.client.model.Converter; @@ -259,6 +260,7 @@ import org.thingsboard.client.model.SlackConversation; import org.thingsboard.client.model.SlackConversationType; import org.thingsboard.client.model.SolutionInstallResponse; +import org.thingsboard.client.model.SolutionStep; import org.thingsboard.client.model.SubscriptionDetails; import org.thingsboard.client.model.SubscriptionUsage; import org.thingsboard.client.model.SystemInfo; @@ -2415,6 +2417,97 @@ private HttpRequest.Builder changePasswordRequestBuilder(@Nonnull ChangePassword return localVarRequestBuilder; } + /** + * chat + * + * @param solutionId (required) + * @param step (required) + * @param body (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode chat(@Nonnull UUID solutionId, @Nonnull SolutionStep step, @Nonnull String body) throws ApiException { + ApiResponse localVarResponse = chatWithHttpInfo(solutionId, step, body, null); + return localVarResponse.getData(); + } + + /** + * chat + * + * @param solutionId (required) + * @param step (required) + * @param body (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 chatWithHttpInfo(@Nonnull UUID solutionId, @Nonnull SolutionStep step, @Nonnull String body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = chatRequestBuilder(solutionId, step, 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("chat", 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 chatRequestBuilder(@Nonnull UUID solutionId, @Nonnull SolutionStep step, @Nonnull String body, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling chat"); + } + // verify the required parameter 'step' is set + if (step == null) { + throw new ApiException(400, "Missing the required parameter 'step' when calling chat"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling chat"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/{solutionId}/{step}/chat" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.toString())) + .replace("{step}", ApiClient.urlEncode(step.toString())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** * Check Activate User Token (checkActivateToken) * 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. @@ -3435,6 +3528,86 @@ private HttpRequest.Builder clearEventsRequestBuilder(@Nonnull String entityType return localVarRequestBuilder; } + /** + * clearStep + * + * @param solutionId (required) + * @param step (required) + * @throws ApiException if fails to make API call + */ + public void clearStep(@Nonnull UUID solutionId, @Nonnull SolutionStep step) throws ApiException { + clearStepWithHttpInfo(solutionId, step, null); + } + + /** + * clearStep + * + * @param solutionId (required) + * @param step (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse clearStepWithHttpInfo(@Nonnull UUID solutionId, @Nonnull SolutionStep step, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = clearStepRequestBuilder(solutionId, step, 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("clearStep", 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 clearStepRequestBuilder(@Nonnull UUID solutionId, @Nonnull SolutionStep step, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling clearStep"); + } + // verify the required parameter 'step' is set + if (step == null) { + throw new ApiException(400, "Missing the required parameter 'step' when calling clearStep"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/{solutionId}/{step}/clear" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.toString())) + .replace("{step}", ApiClient.urlEncode(step.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; + } + /** * Cloud mobile Login redirect (cloudMobileLogin) * This method generates redirect to the special link that is handled by mobile application. Useful for email verification flow on cloud mobile app. @@ -4386,6 +4559,83 @@ private HttpRequest.Builder createReportRequestBuilder(@Nullable CreateReportReq return localVarRequestBuilder; } + /** + * createSolution + * + * @param solutionId (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode createSolution(@Nonnull UUID solutionId) throws ApiException { + ApiResponse localVarResponse = createSolutionWithHttpInfo(solutionId, null); + return localVarResponse.getData(); + } + + /** + * createSolution + * + * @param solutionId (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 createSolutionWithHttpInfo(@Nonnull UUID solutionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createSolutionRequestBuilder(solutionId, 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("createSolution", 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 createSolutionRequestBuilder(@Nonnull UUID solutionId, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling createSolution"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/{solutionId}/create" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.toString())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("POST", 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 AI model by ID (deleteAiModelById) * Deletes the AI model record by its `id`. If a record with the specified `id` exists, the record is deleted and the endpoint returns `true`. If no such record exists, the endpoint returns `false`. Available for users with 'TENANT_ADMIN' authority. @@ -8693,98 +8943,25 @@ private HttpRequest.Builder deleteSecretRequestBuilder(@Nonnull UUID id, Map deleteTenantWithHttpInfo(@Nonnull String tenantId, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteTenantRequestBuilder(tenantId, 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("deleteTenant", 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 deleteTenantRequestBuilder(@Nonnull String tenantId, Map headers) throws ApiException { - // verify the required parameter 'tenantId' is set - if (tenantId == null) { - throw new ApiException(400, "Missing the required parameter 'tenantId' when calling deleteTenant"); - } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/api/tenant/{tenantId}" - .replace("{tenantId}", ApiClient.urlEncode(tenantId.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; - } - - /** - * deleteTenantAccount + * deleteSolution * - * @param deleteTenantRequest (optional) + * @param solutionId (required) * @throws ApiException if fails to make API call */ - public void deleteTenantAccount(@Nullable DeleteTenantRequest deleteTenantRequest) throws ApiException { - deleteTenantAccountWithHttpInfo(deleteTenantRequest, null); + public void deleteSolution(@Nonnull UUID solutionId) throws ApiException { + deleteSolutionWithHttpInfo(solutionId, null); } /** - * deleteTenantAccount + * deleteSolution * - * @param deleteTenantRequest (optional) + * @param solutionId (required) * @param headers Optional headers to include in the request * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse deleteTenantAccountWithHttpInfo(@Nullable DeleteTenantRequest deleteTenantRequest, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteTenantAccountRequestBuilder(deleteTenantRequest, headers); + public ApiResponse deleteSolutionWithHttpInfo(@Nonnull UUID solutionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteSolutionRequestBuilder(solutionId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -8795,7 +8972,7 @@ public ApiResponse deleteTenantAccountWithHttpInfo(@Nullable DeleteTenantR InputStream localVarResponseBody = null; try { if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("deleteTenantAccount", localVarResponse); + throw getApiException("deleteSolution", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); if (localVarResponseBody != null) { @@ -8816,18 +8993,17 @@ public ApiResponse deleteTenantAccountWithHttpInfo(@Nullable DeleteTenantR } } - private HttpRequest.Builder deleteTenantAccountRequestBuilder(@Nullable DeleteTenantRequest deleteTenantRequest, Map headers) throws ApiException { + private HttpRequest.Builder deleteSolutionRequestBuilder(@Nonnull UUID solutionId, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling deleteSolution"); + } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/api/signup/tenantAccount"; + String localVarPath = "/api/ai/solution/{solutionId}" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deleteTenantRequest); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } @@ -8840,25 +9016,25 @@ private HttpRequest.Builder deleteTenantAccountRequestBuilder(@Nullable DeleteTe } /** - * Delete Tenant Profile (deleteTenantProfile) - * Deletes the tenant profile. Referencing non-existing tenant profile Id will cause an error. Referencing profile that is used by the tenants will cause an error. Available for users with 'SYS_ADMIN' authority. - * @param tenantProfileId A string value representing the tenant profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) + * Delete Tenant (deleteTenant) + * Deletes the tenant, it's customers, rule chains, devices and all other related entities. Referencing non-existing tenant Id will cause an error. Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority. + * @param tenantId A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) * @throws ApiException if fails to make API call */ - public void deleteTenantProfile(@Nonnull String tenantProfileId) throws ApiException { - deleteTenantProfileWithHttpInfo(tenantProfileId, null); + public void deleteTenant(@Nonnull String tenantId) throws ApiException { + deleteTenantWithHttpInfo(tenantId, null); } /** - * Delete Tenant Profile (deleteTenantProfile) - * Deletes the tenant profile. Referencing non-existing tenant profile Id will cause an error. Referencing profile that is used by the tenants will cause an error. Available for users with 'SYS_ADMIN' authority. - * @param tenantProfileId A string value representing the tenant profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) + * Delete Tenant (deleteTenant) + * Deletes the tenant, it's customers, rule chains, devices and all other related entities. Referencing non-existing tenant Id will cause an error. Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority. + * @param tenantId A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) * @param headers Optional headers to include in the request * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse deleteTenantProfileWithHttpInfo(@Nonnull String tenantProfileId, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteTenantProfileRequestBuilder(tenantProfileId, headers); + public ApiResponse deleteTenantWithHttpInfo(@Nonnull String tenantId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteTenantRequestBuilder(tenantId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -8869,7 +9045,154 @@ public ApiResponse deleteTenantProfileWithHttpInfo(@Nonnull String tenantP InputStream localVarResponseBody = null; try { if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("deleteTenantProfile", localVarResponse); + throw getApiException("deleteTenant", 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 deleteTenantRequestBuilder(@Nonnull String tenantId, Map headers) throws ApiException { + // verify the required parameter 'tenantId' is set + if (tenantId == null) { + throw new ApiException(400, "Missing the required parameter 'tenantId' when calling deleteTenant"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/tenant/{tenantId}" + .replace("{tenantId}", ApiClient.urlEncode(tenantId.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; + } + + /** + * deleteTenantAccount + * + * @param deleteTenantRequest (optional) + * @throws ApiException if fails to make API call + */ + public void deleteTenantAccount(@Nullable DeleteTenantRequest deleteTenantRequest) throws ApiException { + deleteTenantAccountWithHttpInfo(deleteTenantRequest, null); + } + + /** + * deleteTenantAccount + * + * @param deleteTenantRequest (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteTenantAccountWithHttpInfo(@Nullable DeleteTenantRequest deleteTenantRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteTenantAccountRequestBuilder(deleteTenantRequest, 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("deleteTenantAccount", 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 deleteTenantAccountRequestBuilder(@Nullable DeleteTenantRequest deleteTenantRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/signup/tenantAccount"; + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(deleteTenantRequest); + 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; + } + + /** + * Delete Tenant Profile (deleteTenantProfile) + * Deletes the tenant profile. Referencing non-existing tenant profile Id will cause an error. Referencing profile that is used by the tenants will cause an error. Available for users with 'SYS_ADMIN' authority. + * @param tenantProfileId A string value representing the tenant profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) + * @throws ApiException if fails to make API call + */ + public void deleteTenantProfile(@Nonnull String tenantProfileId) throws ApiException { + deleteTenantProfileWithHttpInfo(tenantProfileId, null); + } + + /** + * Delete Tenant Profile (deleteTenantProfile) + * Deletes the tenant profile. Referencing non-existing tenant profile Id will cause an error. Referencing profile that is used by the tenants will cause an error. Available for users with 'SYS_ADMIN' authority. + * @param tenantProfileId A string value representing the tenant profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteTenantProfileWithHttpInfo(@Nonnull String tenantProfileId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteTenantProfileRequestBuilder(tenantProfileId, 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("deleteTenantProfile", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); if (localVarResponseBody != null) { @@ -11405,6 +11728,83 @@ private HttpRequest.Builder exportRuleChainsRequestBuilder(@Nonnull Integer limi return localVarRequestBuilder; } + /** + * exportSolution + * + * @param solutionId (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode exportSolution(@Nonnull UUID solutionId) throws ApiException { + ApiResponse localVarResponse = exportSolutionWithHttpInfo(solutionId, null); + return localVarResponse.getData(); + } + + /** + * exportSolution + * + * @param solutionId (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 exportSolutionWithHttpInfo(@Nonnull UUID solutionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = exportSolutionRequestBuilder(solutionId, 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("exportSolution", 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 exportSolutionRequestBuilder(@Nonnull UUID solutionId, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling exportSolution"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/{solutionId}/export" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.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; + } + /** * Find Alarms by Query * This method description defines how Alarm Data Query extends the Entity Data Query. See method 'Find Entity Data by Query' first to get the info about 'Entity Data Query'. The platform will first search the entities that match the entity and key filters. Then, the platform will use 'Alarm Page Link' to filter the alarms related to those entities. Finally, platform fetch the properties of alarm that are defined in the **'alarmFields'** and combine them with the other entity, attribute and latest time series fields to return the result. See example of the alarm query below. The query will search first 100 active alarms with type 'Temperature Alarm' or 'Fire Alarm' for any device with current temperature > 0. The query will return combination of the entity fields: name of the device, device model and latest temperature reading and alarms fields: createdTime, type, severity and status: ```json { \"entityFilter\": { \"type\": \"entityType\", \"resolveMultiple\": true, \"entityType\": \"DEVICE\" }, \"pageLink\": { \"page\": 0, \"pageSize\": 100, \"textSearch\": null, \"searchPropagatedAlarms\": false, \"statusList\": [ \"ACTIVE\" ], \"severityList\": [ \"CRITICAL\", \"MAJOR\" ], \"typeList\": [ \"Temperature Alarm\", \"Fire Alarm\" ], \"sortOrder\": { \"key\": { \"key\": \"createdTime\", \"type\": \"ALARM_FIELD\" }, \"direction\": \"DESC\" }, \"timeWindow\": 86400000 }, \"keyFilters\": [ { \"key\": { \"type\": \"TIME_SERIES\", \"key\": \"temperature\" }, \"valueType\": \"NUMERIC\", \"predicate\": { \"operation\": \"GREATER\", \"value\": { \"defaultValue\": 0, \"dynamicValue\": null }, \"type\": \"NUMERIC\" } } ], \"alarmFields\": [ { \"type\": \"ALARM_FIELD\", \"key\": \"createdTime\" }, { \"type\": \"ALARM_FIELD\", \"key\": \"type\" }, { \"type\": \"ALARM_FIELD\", \"key\": \"severity\" }, { \"type\": \"ALARM_FIELD\", \"key\": \"status\" } ], \"entityFields\": [ { \"type\": \"ENTITY_FIELD\", \"key\": \"name\" } ], \"latestValues\": [ { \"type\": \"ATTRIBUTE\", \"key\": \"model\" }, { \"type\": \"TIME_SERIES\", \"key\": \"temperature\" } ] } ``` @@ -40835,6 +41235,83 @@ private HttpRequest.Builder getSignUpSelfRegistrationParamsRequestBuilder(@Nulla return localVarRequestBuilder; } + /** + * getSolution + * + * @param solutionId (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode getSolution(@Nonnull UUID solutionId) throws ApiException { + ApiResponse localVarResponse = getSolutionWithHttpInfo(solutionId, null); + return localVarResponse.getData(); + } + + /** + * getSolution + * + * @param solutionId (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 getSolutionWithHttpInfo(@Nonnull UUID solutionId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSolutionRequestBuilder(solutionId, 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("getSolution", 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 getSolutionRequestBuilder(@Nonnull UUID solutionId, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling getSolution"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/{solutionId}" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.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 Solution template details (getSolutionTemplateDetails) * Get a solution template details based on the provided id Security check is performed to verify that the user has 'READ' permission for the entity (entities). @@ -41059,6 +41536,76 @@ private HttpRequest.Builder getSolutionTemplateInstructionsRequestBuilder(@Nonnu return localVarRequestBuilder; } + /** + * getSolutions + * + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode getSolutions() throws ApiException { + ApiResponse localVarResponse = getSolutionsWithHttpInfo(null); + return localVarResponse.getData(); + } + + /** + * getSolutions + * + * @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 getSolutionsWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getSolutionsRequestBuilder(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("getSolutions", 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 getSolutionsRequestBuilder(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/infos"; + 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 system info (getSystemInfo) * Get main information about system. Available for users with 'SYS_ADMIN' authority. @@ -50264,6 +50811,174 @@ private HttpRequest.Builder importRuleChainsRequestBuilder(@Nonnull RuleChainDat return localVarRequestBuilder; } + /** + * importSolution + * + * @param body (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode importSolution(@Nullable Object body) throws ApiException { + ApiResponse localVarResponse = importSolutionWithHttpInfo(body, null); + return localVarResponse.getData(); + } + + /** + * importSolution + * + * @param body (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 importSolutionWithHttpInfo(@Nullable Object body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = importSolutionRequestBuilder(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("importSolution", 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 importSolutionRequestBuilder(@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 importSolution"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/import"; + 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; + } + + /** + * installSolution + * + * @param solutionId (required) + * @param xAuthorization (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode installSolution(@Nonnull UUID solutionId, @Nonnull String xAuthorization) throws ApiException { + ApiResponse localVarResponse = installSolutionWithHttpInfo(solutionId, xAuthorization, null); + return localVarResponse.getData(); + } + + /** + * installSolution + * + * @param solutionId (required) + * @param xAuthorization (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 installSolutionWithHttpInfo(@Nonnull UUID solutionId, @Nonnull String xAuthorization, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = installSolutionRequestBuilder(solutionId, xAuthorization, 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("installSolution", 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 installSolutionRequestBuilder(@Nonnull UUID solutionId, @Nonnull String xAuthorization, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling installSolution"); + } + // verify the required parameter 'xAuthorization' is set + if (xAuthorization == null) { + throw new ApiException(400, "Missing the required parameter 'xAuthorization' when calling installSolution"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/{solutionId}/install" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.toString())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + if (xAuthorization != null) { + localVarRequestBuilder.header("X-Authorization", xAuthorization.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("POST", 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; + } + /** * Install Solution Template (installSolutionTemplate) * Install solution template based on the provided id Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). @@ -50988,23 +51703,25 @@ private HttpRequest.Builder listBranchesRequestBuilder(Map heade /** * listChats * + * @param chatType (required) * @return com.fasterxml.jackson.databind.JsonNode * @throws ApiException if fails to make API call */ - public com.fasterxml.jackson.databind.JsonNode listChats() throws ApiException { - ApiResponse localVarResponse = listChatsWithHttpInfo(null); + public com.fasterxml.jackson.databind.JsonNode listChats(@Nonnull ChatType chatType) throws ApiException { + ApiResponse localVarResponse = listChatsWithHttpInfo(chatType, null); return localVarResponse.getData(); } /** * listChats * + * @param chatType (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 listChatsWithHttpInfo(Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = listChatsRequestBuilder(headers); + public ApiResponse listChatsWithHttpInfo(@Nonnull ChatType chatType, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = listChatsRequestBuilder(chatType, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -51038,9 +51755,14 @@ public ApiResponse listChatsWithHttpInf } } - private HttpRequest.Builder listChatsRequestBuilder(Map headers) throws ApiException { + private HttpRequest.Builder listChatsRequestBuilder(@Nonnull ChatType chatType, Map headers) throws ApiException { + // verify the required parameter 'chatType' is set + if (chatType == null) { + throw new ApiException(400, "Missing the required parameter 'chatType' when calling listChats"); + } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/api/ai/chats"; + String localVarPath = "/api/ai/chats/{chatType}" + .replace("{chatType}", ApiClient.urlEncode(chatType.toString())); localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Accept", "application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); @@ -63071,6 +63793,76 @@ private HttpRequest.Builder signUpRequestBuilder(@Nonnull SignUpRequest signUpRe return localVarRequestBuilder; } + /** + * startNew + * + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode startNew() throws ApiException { + ApiResponse localVarResponse = startNewWithHttpInfo(null); + return localVarResponse.getData(); + } + + /** + * startNew + * + * @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 startNewWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = startNewRequestBuilder(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("startNew", 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 startNewRequestBuilder(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/start"; + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.method("POST", 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; + } + /** * Submit 2FA account config (submitTwoFaAccountConfig) * Submit 2FA account config to prepare for a future verification. Basically, this method will send a verification code for a given account config, if this has sense for a chosen 2FA provider. This code is needed to then verify and save the account config. Example of EMAIL 2FA account config: ``` { \"providerType\": \"EMAIL\", \"useByDefault\": true, \"email\": \"separate-email-for-2fa@thingsboard.org\" } ``` Example of SMS 2FA account config: ``` { \"providerType\": \"SMS\", \"useByDefault\": false, \"phoneNumber\": \"+38012312321\" } ``` For TOTP this method does nothing. Will throw an error (Bad Request) if submitted account config is not valid, or if the provider is not configured for usage. Available for any authorized user. @@ -64659,6 +65451,92 @@ private HttpRequest.Builder unassignSchedulerEventFromEdgeRequestBuilder(@Nonnul return localVarRequestBuilder; } + /** + * uninstallSolution + * + * @param solutionId (required) + * @param xAuthorization (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode uninstallSolution(@Nonnull UUID solutionId, @Nonnull String xAuthorization) throws ApiException { + ApiResponse localVarResponse = uninstallSolutionWithHttpInfo(solutionId, xAuthorization, null); + return localVarResponse.getData(); + } + + /** + * uninstallSolution + * + * @param solutionId (required) + * @param xAuthorization (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 uninstallSolutionWithHttpInfo(@Nonnull UUID solutionId, @Nonnull String xAuthorization, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uninstallSolutionRequestBuilder(solutionId, xAuthorization, 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("uninstallSolution", 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 uninstallSolutionRequestBuilder(@Nonnull UUID solutionId, @Nonnull String xAuthorization, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling uninstallSolution"); + } + // verify the required parameter 'xAuthorization' is set + if (xAuthorization == null) { + throw new ApiException(400, "Missing the required parameter 'xAuthorization' when calling uninstallSolution"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/{solutionId}/uninstall" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.toString())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + if (xAuthorization != null) { + localVarRequestBuilder.header("X-Authorization", xAuthorization.toString()); + } + 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; + } + /** * Uninstall Solution Template (uninstallSolutionTemplate) * Uninstall solution template based on the provided id Security check is performed to verify that the user has 'DELETE' permission for the entity (entities). @@ -65336,6 +66214,102 @@ private HttpRequest.Builder updateCustomMenuNameRequestBuilder(@Nonnull UUID cus return localVarRequestBuilder; } + /** + * updateData + * + * @param solutionId (required) + * @param dataKey (required) + * @param body (required) + * @return com.fasterxml.jackson.databind.JsonNode + * @throws ApiException if fails to make API call + */ + public com.fasterxml.jackson.databind.JsonNode updateData(@Nonnull UUID solutionId, @Nonnull String dataKey, @Nullable Object body) throws ApiException { + ApiResponse localVarResponse = updateDataWithHttpInfo(solutionId, dataKey, body, null); + return localVarResponse.getData(); + } + + /** + * updateData + * + * @param solutionId (required) + * @param dataKey (required) + * @param body (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 updateDataWithHttpInfo(@Nonnull UUID solutionId, @Nonnull String dataKey, @Nullable Object body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateDataRequestBuilder(solutionId, dataKey, 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("updateData", 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 updateDataRequestBuilder(@Nonnull UUID solutionId, @Nonnull String dataKey, @Nullable Object body, Map headers) throws ApiException { + // verify the required parameter 'solutionId' is set + if (solutionId == null) { + throw new ApiException(400, "Missing the required parameter 'solutionId' when calling updateData"); + } + // verify the required parameter 'dataKey' is set + if (dataKey == null) { + throw new ApiException(400, "Missing the required parameter 'dataKey' when calling updateData"); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateData"); + } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/ai/solution/{solutionId}/{dataKey}" + .replace("{solutionId}", ApiClient.urlEncode(solutionId.toString())) + .replace("{dataKey}", ApiClient.urlEncode(dataKey.toString())); + 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("PUT", 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; + } + /** * Update device credentials (updateDeviceCredentials) * During device creation, platform generates random 'ACCESS_TOKEN' credentials. Use this method to update the device credentials. First use 'getDeviceCredentialsByDeviceId' to get the credentials id and value. Then use current method to update the credentials type and value. It is not possible to create multiple device credentials for the same device. The structure of device credentials id and value is simple for the 'ACCESS_TOKEN' but is much more complex for the 'MQTT_BASIC' or 'LWM2M_CREDENTIALS'. You may find the example of device with different type of credentials below: - Credentials type: **\"Access token\"** with **device ID** and with **device ID** below: ```json { \"id\": { \"id\":\"c886a090-168d-11ee-87c9-6f157dbc816a\" }, \"deviceId\": { \"id\":\"c5fb3ac0-168d-11ee-87c9-6f157dbc816a\", \"entityType\":\"DEVICE\" }, \"credentialsType\": \"ACCESS_TOKEN\", \"credentialsId\": \"6hmxew8pmmzng4e3une4\" } ``` - Credentials type: **\"X509\"** with **device profile ID** below: Note: **credentialsId** - format **Sha3Hash**, **certificateValue** - format **PEM** (with \"--BEGIN CERTIFICATE----\" and -\"----END CERTIFICATE-\"). ```json { \"id\": { \"id\":\"309bd9c0-14f4-11ee-9fc9-d9b7463abb63\" }, \"deviceId\": { \"id\":\"3092b200-14f4-11ee-9fc9-d9b7463abb63\", \"entityType\":\"DEVICE\" }, \"credentialsType\": \"X509_CERTIFICATE\", \"credentialsId\": \"6b8adb49015500e51a527acd332b51684ab9b49b4ade03a9582a44c455e2e9b6\", \"credentialsValue\": \"-----BEGIN CERTIFICATE----- MIICMTCCAdegAwIBAgIUUEKxS9hTz4l+oLUMF0LV6TC/gCIwCgYIKoZIzj0EAwIwbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlUHJvZmlsZUNlcnRAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MB4XDTIzMDMyOTE0NTczNloXDTI0MDMyODE0NTczNlowbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlUHJvZmlsZUNlcnRAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECMlWO72krDoUL9FQjUmSCetkhaEGJUfQkdSfkLSNa0GyAEIMbfmzI4zITeapunu4rGet3EMyLydQzuQanBicp6NTMFEwHQYDVR0OBBYEFHpZ78tPnztNii4Da/yCw6mhEIL3MB8GA1UdIwQYMBaAFHpZ78tPnztNii4Da/yCw6mhEIL3MA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIgJ7qyMFqNcwSYkH6o+UlQXzLWfwZbNjVk+aR7foAZNGsCIQDsd7v3WQIGHiArfZeDs1DLEDuV/2h6L+ZNoGNhEKL+1A== -----END CERTIFICATE-----\" } ``` - Credentials type: **\"MQTT_BASIC\"** with **device profile ID** below: ```json { \"id\": { \"id\":\"d877ffb0-14f5-11ee-9fc9-d9b7463abb63\" }, \"deviceId\": { \"id\":\"d875dcd0-14f5-11ee-9fc9-d9b7463abb63\", \"entityType\":\"DEVICE\" }, \"credentialsType\": \"MQTT_BASIC\", \"credentialsValue\": \"{\\\"clientId\\\":\\\"juy03yv4owqxcmqhqtvk\\\",\\\"userName\\\":\\\"ov19fxca0cyjn7lm7w7u\\\",\\\"password\\\":\\\"twy94he114dfi9usyk1o\\\"}\" } ``` - You may find the example of **LwM2M** device and **RPK** credentials below: Note: LwM2M device - only existing device profile ID (Transport configuration -> Transport type: \"LWM2M\". ```json { \"id\": { \"id\":\"e238d4d0-1689-11ee-98c6-1713c1be5a8e\" }, \"deviceId\": { \"id\":\"e232e160-1689-11ee-98c6-1713c1be5a8e\", \"entityType\":\"DEVICE\" }, \"credentialsType\": \"LWM2M_CREDENTIALS\", \"credentialsId\": \"LwRpk00000000\", \"credentialsValue\": \"{\\\"client\\\":{ \\\"endpoint\\\":\\\"LwRpk00000000\\\", \\\"securityConfigClientMode\\\":\\\"RPK\\\", \\\"key\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdvBZZ2vQRK9wgDhctj6B1c7bxR3Z0wYg1+YdoYFnVUKWb+rIfTTyYK9tmQJx5Vlb5fxdLnVv1RJOPiwsLIQbAA==\\\" }, \\\"bootstrap\\\":{ \\\"bootstrapServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}, \\\"lwm2mServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}} }\" } ``` Update to real value: - 'id' (this is id of Device Credentials -> \"Get Device Credentials (getDeviceCredentialsByDeviceId)\", - 'deviceId.id' (this is id of Device). Remove 'tenantId' and optionally 'customerId' from the request body example (below) to create new Device entity. Available for users with 'TENANT_ADMIN' authority. diff --git a/paas/src/main/java/org/thingsboard/client/model/AlarmCalculatedFieldConfiguration.java b/paas/src/main/java/org/thingsboard/client/model/AlarmCalculatedFieldConfiguration.java index dec51f7d..60e5d716 100644 --- a/paas/src/main/java/org/thingsboard/client/model/AlarmCalculatedFieldConfiguration.java +++ b/paas/src/main/java/org/thingsboard/client/model/AlarmCalculatedFieldConfiguration.java @@ -324,12 +324,6 @@ public AlarmCalculatedFieldConfiguration output(@Nullable Output output) { return this; } - @Override - public AlarmCalculatedFieldConfiguration aiGenerated(@Nullable Boolean aiGenerated) { - this.setAiGenerated(aiGenerated); - return this; - } - /** * Return true if this AlarmCalculatedFieldConfiguration object is equal to o. */ @@ -428,11 +422,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getOutput().toUrlQueryString(prefix + "output" + suffix)); } - // add `aiGenerated` to the URL query string - if (getAiGenerated() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%saiGenerated%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAiGenerated())))); - } - // add `arguments` to the URL query string if (getArguments() != null) { for (String _key : getArguments().keySet()) { diff --git a/paas/src/main/java/org/thingsboard/client/model/CalculatedFieldConfiguration.java b/paas/src/main/java/org/thingsboard/client/model/CalculatedFieldConfiguration.java index 0cfe1f41..1ea363e6 100644 --- a/paas/src/main/java/org/thingsboard/client/model/CalculatedFieldConfiguration.java +++ b/paas/src/main/java/org/thingsboard/client/model/CalculatedFieldConfiguration.java @@ -44,8 +44,7 @@ */ @JsonPropertyOrder({ CalculatedFieldConfiguration.JSON_PROPERTY_TYPE, - CalculatedFieldConfiguration.JSON_PROPERTY_OUTPUT, - CalculatedFieldConfiguration.JSON_PROPERTY_AI_GENERATED + CalculatedFieldConfiguration.JSON_PROPERTY_OUTPUT }) @Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") @JsonIgnoreProperties( @@ -72,10 +71,6 @@ public class CalculatedFieldConfiguration { @Nullable private Output output; - public static final String JSON_PROPERTY_AI_GENERATED = "aiGenerated"; - @Nullable - private Boolean aiGenerated; - public CalculatedFieldConfiguration() { } @@ -127,30 +122,6 @@ public void setOutput(@Nullable Output output) { } - public CalculatedFieldConfiguration aiGenerated(@Nullable Boolean aiGenerated) { - this.aiGenerated = aiGenerated; - return this; - } - - /** - * Get aiGenerated - * @return aiGenerated - */ - @Nullable - @JsonProperty(value = JSON_PROPERTY_AI_GENERATED, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAiGenerated() { - return aiGenerated; - } - - - @JsonProperty(value = JSON_PROPERTY_AI_GENERATED, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAiGenerated(@Nullable Boolean aiGenerated) { - this.aiGenerated = aiGenerated; - } - - /** * Return true if this CalculatedFieldConfiguration object is equal to o. */ @@ -164,13 +135,12 @@ public boolean equals(Object o) { } CalculatedFieldConfiguration calculatedFieldConfiguration = (CalculatedFieldConfiguration) o; return Objects.equals(this.type, calculatedFieldConfiguration.type) && - Objects.equals(this.output, calculatedFieldConfiguration.output) && - Objects.equals(this.aiGenerated, calculatedFieldConfiguration.aiGenerated); + Objects.equals(this.output, calculatedFieldConfiguration.output); } @Override public int hashCode() { - return Objects.hash(type, output, aiGenerated); + return Objects.hash(type, output); } @Override @@ -179,7 +149,6 @@ public String toString() { sb.append("class CalculatedFieldConfiguration {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" output: ").append(toIndentedString(output)).append("\n"); - sb.append(" aiGenerated: ").append(toIndentedString(aiGenerated)).append("\n"); sb.append("}"); return sb.toString(); } @@ -237,11 +206,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getOutput().toUrlQueryString(prefix + "output" + suffix)); } - // add `aiGenerated` to the URL query string - if (getAiGenerated() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%saiGenerated%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAiGenerated())))); - } - return joiner.toString(); } static { diff --git a/paas/src/main/java/org/thingsboard/client/model/ChatType.java b/paas/src/main/java/org/thingsboard/client/model/ChatType.java new file mode 100644 index 00000000..d207f22f --- /dev/null +++ b/paas/src/main/java/org/thingsboard/client/model/ChatType.java @@ -0,0 +1,80 @@ +/** + * 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 ChatType + */ +public enum ChatType { + + GENERIC("GENERIC"), + + SOLUTION_BUILDER("SOLUTION_BUILDER"); + + private String value; + + ChatType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ChatType fromValue(String value) { + for (ChatType b : ChatType.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/paas/src/main/java/org/thingsboard/client/model/EntityAggregationCalculatedFieldConfiguration.java b/paas/src/main/java/org/thingsboard/client/model/EntityAggregationCalculatedFieldConfiguration.java index ac80db75..477cab07 100644 --- a/paas/src/main/java/org/thingsboard/client/model/EntityAggregationCalculatedFieldConfiguration.java +++ b/paas/src/main/java/org/thingsboard/client/model/EntityAggregationCalculatedFieldConfiguration.java @@ -229,12 +229,6 @@ public EntityAggregationCalculatedFieldConfiguration output(@Nonnull Output outp return this; } - @Override - public EntityAggregationCalculatedFieldConfiguration aiGenerated(@Nullable Boolean aiGenerated) { - this.setAiGenerated(aiGenerated); - return this; - } - /** * Return true if this EntityAggregationCalculatedFieldConfiguration object is equal to o. */ @@ -327,11 +321,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getOutput().toUrlQueryString(prefix + "output" + suffix)); } - // add `aiGenerated` to the URL query string - if (getAiGenerated() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%saiGenerated%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAiGenerated())))); - } - // add `arguments` to the URL query string if (getArguments() != null) { for (String _key : getArguments().keySet()) { diff --git a/paas/src/main/java/org/thingsboard/client/model/GeofencingCalculatedFieldConfiguration.java b/paas/src/main/java/org/thingsboard/client/model/GeofencingCalculatedFieldConfiguration.java index 01cb44e8..0ecab5ed 100644 --- a/paas/src/main/java/org/thingsboard/client/model/GeofencingCalculatedFieldConfiguration.java +++ b/paas/src/main/java/org/thingsboard/client/model/GeofencingCalculatedFieldConfiguration.java @@ -190,12 +190,6 @@ public GeofencingCalculatedFieldConfiguration output(@Nonnull Output output) { return this; } - @Override - public GeofencingCalculatedFieldConfiguration aiGenerated(@Nullable Boolean aiGenerated) { - this.setAiGenerated(aiGenerated); - return this; - } - /** * Return true if this GeofencingCalculatedFieldConfiguration object is equal to o. */ @@ -286,11 +280,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getOutput().toUrlQueryString(prefix + "output" + suffix)); } - // add `aiGenerated` to the URL query string - if (getAiGenerated() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%saiGenerated%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAiGenerated())))); - } - // add `entityCoordinates` to the URL query string if (getEntityCoordinates() != null) { joiner.add(getEntityCoordinates().toUrlQueryString(prefix + "entityCoordinates" + suffix)); diff --git a/paas/src/main/java/org/thingsboard/client/model/PropagationCalculatedFieldConfiguration.java b/paas/src/main/java/org/thingsboard/client/model/PropagationCalculatedFieldConfiguration.java index dc150ce4..e1c0b8dd 100644 --- a/paas/src/main/java/org/thingsboard/client/model/PropagationCalculatedFieldConfiguration.java +++ b/paas/src/main/java/org/thingsboard/client/model/PropagationCalculatedFieldConfiguration.java @@ -190,12 +190,6 @@ public PropagationCalculatedFieldConfiguration output(@Nullable Output output) { return this; } - @Override - public PropagationCalculatedFieldConfiguration aiGenerated(@Nullable Boolean aiGenerated) { - this.setAiGenerated(aiGenerated); - return this; - } - /** * Return true if this PropagationCalculatedFieldConfiguration object is equal to o. */ @@ -286,11 +280,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getOutput().toUrlQueryString(prefix + "output" + suffix)); } - // add `aiGenerated` to the URL query string - if (getAiGenerated() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%saiGenerated%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAiGenerated())))); - } - // add `applyExpressionToResolvedArguments` to the URL query string if (getApplyExpressionToResolvedArguments() != null) { joiner.add(String.format(java.util.Locale.ROOT, "%sapplyExpressionToResolvedArguments%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getApplyExpressionToResolvedArguments())))); diff --git a/paas/src/main/java/org/thingsboard/client/model/RelatedEntitiesAggregationCalculatedFieldConfiguration.java b/paas/src/main/java/org/thingsboard/client/model/RelatedEntitiesAggregationCalculatedFieldConfiguration.java index 8ddefd64..41655860 100644 --- a/paas/src/main/java/org/thingsboard/client/model/RelatedEntitiesAggregationCalculatedFieldConfiguration.java +++ b/paas/src/main/java/org/thingsboard/client/model/RelatedEntitiesAggregationCalculatedFieldConfiguration.java @@ -286,12 +286,6 @@ public RelatedEntitiesAggregationCalculatedFieldConfiguration output(@Nonnull Ou return this; } - @Override - public RelatedEntitiesAggregationCalculatedFieldConfiguration aiGenerated(@Nullable Boolean aiGenerated) { - this.setAiGenerated(aiGenerated); - return this; - } - /** * Return true if this RelatedEntitiesAggregationCalculatedFieldConfiguration object is equal to o. */ @@ -388,11 +382,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getOutput().toUrlQueryString(prefix + "output" + suffix)); } - // add `aiGenerated` to the URL query string - if (getAiGenerated() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%saiGenerated%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAiGenerated())))); - } - // add `arguments` to the URL query string if (getArguments() != null) { for (String _key : getArguments().keySet()) { diff --git a/paas/src/main/java/org/thingsboard/client/model/Resource.java b/paas/src/main/java/org/thingsboard/client/model/Resource.java index 24f83274..c9351b48 100644 --- a/paas/src/main/java/org/thingsboard/client/model/Resource.java +++ b/paas/src/main/java/org/thingsboard/client/model/Resource.java @@ -138,7 +138,7 @@ public enum Resource { AI_MODEL("AI_MODEL"), - AI_SOLUTION_CREATOR("AI_SOLUTION_CREATOR"), + AI("AI"), API_KEY("API_KEY"); diff --git a/paas/src/main/java/org/thingsboard/client/model/RuleChainMetaData.java b/paas/src/main/java/org/thingsboard/client/model/RuleChainMetaData.java index 5356f0f7..17ba1d11 100644 --- a/paas/src/main/java/org/thingsboard/client/model/RuleChainMetaData.java +++ b/paas/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/paas/src/main/java/org/thingsboard/client/model/RuleChainNote.java b/paas/src/main/java/org/thingsboard/client/model/RuleChainNote.java new file mode 100644 index 00000000..13dd34b3 --- /dev/null +++ b/paas/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/paas/src/main/java/org/thingsboard/client/model/ScriptCalculatedFieldConfiguration.java b/paas/src/main/java/org/thingsboard/client/model/ScriptCalculatedFieldConfiguration.java index 63e57e6a..9f0c92cf 100644 --- a/paas/src/main/java/org/thingsboard/client/model/ScriptCalculatedFieldConfiguration.java +++ b/paas/src/main/java/org/thingsboard/client/model/ScriptCalculatedFieldConfiguration.java @@ -131,12 +131,6 @@ public ScriptCalculatedFieldConfiguration output(@Nullable Output output) { return this; } - @Override - public ScriptCalculatedFieldConfiguration aiGenerated(@Nullable Boolean aiGenerated) { - this.setAiGenerated(aiGenerated); - return this; - } - /** * Return true if this ScriptCalculatedFieldConfiguration object is equal to o. */ @@ -223,11 +217,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getOutput().toUrlQueryString(prefix + "output" + suffix)); } - // add `aiGenerated` to the URL query string - if (getAiGenerated() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%saiGenerated%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAiGenerated())))); - } - // add `arguments` to the URL query string if (getArguments() != null) { for (String _key : getArguments().keySet()) { diff --git a/paas/src/main/java/org/thingsboard/client/model/ShortCustomerInfo.java b/paas/src/main/java/org/thingsboard/client/model/ShortCustomerInfo.java index f0063304..c7e32212 100644 --- a/paas/src/main/java/org/thingsboard/client/model/ShortCustomerInfo.java +++ b/paas/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/paas/src/main/java/org/thingsboard/client/model/SimpleCalculatedFieldConfiguration.java b/paas/src/main/java/org/thingsboard/client/model/SimpleCalculatedFieldConfiguration.java index 24cd7fec..4af62471 100644 --- a/paas/src/main/java/org/thingsboard/client/model/SimpleCalculatedFieldConfiguration.java +++ b/paas/src/main/java/org/thingsboard/client/model/SimpleCalculatedFieldConfiguration.java @@ -160,12 +160,6 @@ public SimpleCalculatedFieldConfiguration output(@Nullable Output output) { return this; } - @Override - public SimpleCalculatedFieldConfiguration aiGenerated(@Nullable Boolean aiGenerated) { - this.setAiGenerated(aiGenerated); - return this; - } - /** * Return true if this SimpleCalculatedFieldConfiguration object is equal to o. */ @@ -254,11 +248,6 @@ public String toUrlQueryString(String prefix) { joiner.add(getOutput().toUrlQueryString(prefix + "output" + suffix)); } - // add `aiGenerated` to the URL query string - if (getAiGenerated() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%saiGenerated%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAiGenerated())))); - } - // add `arguments` to the URL query string if (getArguments() != null) { for (String _key : getArguments().keySet()) { diff --git a/paas/src/main/java/org/thingsboard/client/model/SolutionStep.java b/paas/src/main/java/org/thingsboard/client/model/SolutionStep.java new file mode 100644 index 00000000..d2ed177b --- /dev/null +++ b/paas/src/main/java/org/thingsboard/client/model/SolutionStep.java @@ -0,0 +1,80 @@ +/** + * 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 SolutionStep + */ +public enum SolutionStep { + + INITIAL_CONFIGURATION("INITIAL_CONFIGURATION"), + + DASHBOARDS_CONFIGURATION("DASHBOARDS_CONFIGURATION"); + + private String value; + + SolutionStep(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SolutionStep fromValue(String value) { + for (SolutionStep b : SolutionStep.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()); + } + +} +