diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ab847dee..bcd08d38 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -40,6 +40,7 @@ src/main/java/org/bonitasoft/web/client/api/HumanTaskApi.java src/main/java/org/bonitasoft/web/client/api/I18nlocaleApi.java src/main/java/org/bonitasoft/web/client/api/I18ntranslationApi.java src/main/java/org/bonitasoft/web/client/api/InformationApi.java +src/main/java/org/bonitasoft/web/client/api/LogApi.java src/main/java/org/bonitasoft/web/client/api/MaintenanceApi.java src/main/java/org/bonitasoft/web/client/api/ManualTaskApi.java src/main/java/org/bonitasoft/web/client/api/MembershipApi.java @@ -156,6 +157,8 @@ src/main/java/org/bonitasoft/web/client/model/I18nlocale.java src/main/java/org/bonitasoft/web/client/model/InstanciateProcess429Response.java src/main/java/org/bonitasoft/web/client/model/LegacyApplication.java src/main/java/org/bonitasoft/web/client/model/License.java +src/main/java/org/bonitasoft/web/client/model/Log.java +src/main/java/org/bonitasoft/web/client/model/LogSeverityLevel.java src/main/java/org/bonitasoft/web/client/model/MaintenanceDetails.java src/main/java/org/bonitasoft/web/client/model/ManualTask.java src/main/java/org/bonitasoft/web/client/model/ManualTaskCreateRequest.java diff --git a/.openapi-generator/openapi.yaml-default.sha256 b/.openapi-generator/openapi.yaml-default.sha256 index c4ee5c59..1186c0e0 100644 --- a/.openapi-generator/openapi.yaml-default.sha256 +++ b/.openapi-generator/openapi.yaml-default.sha256 @@ -1 +1 @@ -ee2f8f46b23e98ee1afe0c8d882e20daa068e92aa3460337dd773337642cf318 \ No newline at end of file +55a8b70f9b7644799b505b97917111f9e41bf403c1b63dd95b0f6088caead64a \ No newline at end of file diff --git a/api/openapi.yaml b/api/openapi.yaml index 341d343b..281b646a 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -104,7 +104,7 @@ info: name: GPL-v2.0 url: http://www.gnu.org/licenses/gpl-2.0.txt title: Bonita API - version: 1.0.6 + version: 1.0.7 x-logo: url: images/bonitasoft-logo.svg backgroundColor: '#19465f' @@ -343,6 +343,11 @@ tags: - description: Role name: Role x-displayName: Role +- description: | + Access log entries recorded by the Bonita Engine during execution. Logs capture actions performed on the platform such as process deployments, task executions, or configuration changes. + This Web REST API is available in **Enterprise editions only**. + name: Log + x-displayName: Log - description: Session name: Session x-displayName: Session @@ -16719,6 +16724,213 @@ paths: x-content-type: application/json x-accepts: - application/json + /API/system/log: + get: + description: | + Finds Logs with pagination params and filters. The search returns an array of log entries. + This Web REST API is available in **Enterprise editions only**. + + - can filter on `action_scope`, `action_type`, `createdBy`, `message`, `severity` value + - can search by text on `action_scope`, `action_type`, `createdBy`, `message`, `severity` + - can order on `action_scope`, `action_type`, `creation_date`, `createdBy`, `message`, `severity` + operationId: searchLogs + parameters: + - description: index of the page to display + example: "0" + explode: true + in: query + name: p + required: true + schema: + default: 0 + format: int32 + minimum: 0 + type: integer + style: form + - description: maximum number of elements to retrieve + example: "10" + explode: true + in: query + name: c + required: true + schema: + default: 20 + format: int32 + minimum: 1 + type: integer + style: form + - description: "can filter on attributes with the format f={filter\\_name}={filter\\\ + _value} with the name/value pair as url encoded string." + example: abc%3d123 + explode: true + in: query + name: f + required: false + schema: + items: + maxLength: 250 + pattern: "^[A-Za-z0-9%]{0,250}$" + type: string + type: array + style: form + - description: can order on attributes + example: myProp%20ASC + explode: true + in: query + name: o + required: false + schema: + maxLength: 250 + pattern: "^[A-Za-z0-9%]{0,250}$" + type: string + style: form + - description: can search on attributes + explode: true + in: query + name: s + required: false + schema: + maxLength: 250 + pattern: "^[A-Za-z0-9%]{0,250}$" + type: string + style: form + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/Log' + type: array + description: 'Success ' + headers: + Content-Range: + description: The total number of matching items + explode: false + schema: + format: int64 + type: integer + style: simple + "400": + content: + application/json: + example: + message: Bad request + schema: + $ref: '#/components/schemas/Error' + description: Bad request. + "401": + content: + application/json: + example: + message: Unauthorized + schema: + $ref: '#/components/schemas/Error' + description: Authorization information is missing or invalid. + "403": + content: + application/json: + example: + message: "Forbidden, The request contained valid data and was understood\ + \ by the server, but the server is refusing action." + schema: + $ref: '#/components/schemas/Error' + description: "Forbidden, The request contained valid data and was understood\ + \ by the server, but the server is refusing action." + "5XX": + content: + application/json: + example: + message: An unexpected error occured. + schema: + $ref: '#/components/schemas/Error' + description: Unexpected error. + summary: Finds Logs + tags: + - Log + x-codeSamples: + - lang: Shell + label: Curl + source: | + curl -b saved_cookies.txt -X GET --url 'http://localhost:8080/bonita/API/system/log?p=0&c=10&o=creation_date+DESC' + x-accepts: + - application/json + /API/system/log/{id}: + get: + description: | + Returns the single Log for the given ID. + This Web REST API is available in **Enterprise editions only**. + operationId: getLogById + parameters: + - description: ID of the Log to return + explode: false + in: path + name: id + required: true + schema: + maxLength: 250 + pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Log' + description: 'Success ' + "400": + content: + application/json: + example: + message: Bad request + schema: + $ref: '#/components/schemas/Error' + description: Bad request. + "401": + content: + application/json: + example: + message: Unauthorized + schema: + $ref: '#/components/schemas/Error' + description: Authorization information is missing or invalid. + "403": + content: + application/json: + example: + message: "Forbidden, The request contained valid data and was understood\ + \ by the server, but the server is refusing action." + schema: + $ref: '#/components/schemas/Error' + description: "Forbidden, The request contained valid data and was understood\ + \ by the server, but the server is refusing action." + "404": + content: + application/json: + example: + message: Resource not found. + schema: + $ref: '#/components/schemas/Error' + description: The resource for the specified ID was not found. + "5XX": + content: + application/json: + example: + message: An unexpected error occured. + schema: + $ref: '#/components/schemas/Error' + description: Unexpected error. + summary: Finds the Log by ID + tags: + - Log + x-codeSamples: + - lang: Shell + label: Curl + source: | + curl -b saved_cookies.txt -X GET --url 'http://localhost:8080/bonita/API/system/log/1024' + x-accepts: + - application/json /API/system/i18nlocale: get: description: | @@ -22134,6 +22346,51 @@ components: - mobile type: string type: object + LogSeverityLevel: + description: the severity level of the log + enum: + - BUSINESS + - INTERNAL + type: string + Log: + description: | + A log entry recorded by the Bonita Engine during execution. Logs capture actions performed on the platform such as process deployments, task executions, or configuration changes. + This Web REST API is available in **Enterprise editions only**. + example: + id: "1024" + creation_date: 2024-10-17T16:05:42.626Z + createdBy: walter.bates + severity: INTERNAL + message: Creating a new Process definition + action_scope: "7714320429509736190" + action_type: PROCESS_DEFINITION_CREATED + icon: /default/log.png + properties: + id: + description: the log id + maxLength: 250 + pattern: "^[A-Za-z0-9\\_\\-\\.]{0,250}$" + type: string + creation_date: + description: "the UTC date and time in ISO-8601 format ('yyyy-MM-ddTHH:mm:ss.SSSZ')\ + \ when this log was created, for example '2024-10-17T16:05:42.626Z'" + format: date-time + type: string + createdBy: + description: the name of the user who triggered the logged action + type: string + severity: + $ref: '#/components/schemas/LogSeverityLevel' + message: + description: the log message describing the action + type: string + action_scope: + description: the scope of the logged action + type: string + icon: + description: the icon path for this log entry + type: string + type: object I18nlocale: description: "" example: @@ -22687,6 +22944,7 @@ x-tagGroups: tags: - I18nlocale - I18ntranslation + - Log - Session - Maintenance - name: Other diff --git a/pom.xml b/pom.xml index 982756c8..312a58e0 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ UTF-8 UTF-8 - 1.0.6 + 1.0.7 1.6.15 3.0.0 3.0.2 diff --git a/src/main/java/org/bonitasoft/web/client/api/LogApi.java b/src/main/java/org/bonitasoft/web/client/api/LogApi.java new file mode 100644 index 00000000..27db6b6d --- /dev/null +++ b/src/main/java/org/bonitasoft/web/client/api/LogApi.java @@ -0,0 +1,190 @@ +/** + * Copyright (C) 2026 BonitaSoft S.A. + * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2.0 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.bonitasoft.web.client.api; + +import java.util.HashMap; +import java.util.List; + +import org.bonitasoft.web.client.invoker.ApiClient; +import org.bonitasoft.web.client.invoker.EncodingUtils; +import org.bonitasoft.web.client.model.ApiResponse; +import org.bonitasoft.web.client.model.Log; + +import feign.*; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +public interface LogApi extends ApiClient.Api { + + /** + * Finds the Log by ID + * Returns the single Log for the given ID. This Web REST API is available in **Enterprise editions only**. + * + * @param id ID of the Log to return (required) + * @return Log + */ + @RequestLine("GET /API/system/log/{id}") + @Headers({ + "Accept: application/json", + }) + Log getLogById(@Param("id") String id); + + /** + * Finds the Log by ID + * Similar to getLogById but it also returns the http response headers . + * Returns the single Log for the given ID. This Web REST API is available in **Enterprise editions only**. + * + * @param id ID of the Log to return (required) + * @return A ApiResponse that wraps the response boyd and the http headers. + */ + @RequestLine("GET /API/system/log/{id}") + @Headers({ + "Accept: application/json", + }) + ApiResponse getLogByIdWithHttpInfo(@Param("id") String id); + + /** + * Finds Logs + * Finds Logs with pagination params and filters. The search returns an array of log entries. This Web REST API is available in **Enterprise editions only**. - + * can filter on `action_scope`, `action_type`, `createdBy`, `message`, `severity` value - can search by text + * on `action_scope`, `action_type`, `createdBy`, `message`, `severity` - can order on + * `action_scope`, `action_type`, `creation_date`, `createdBy`, `message`, `severity` + * + * @param p index of the page to display (required) + * @param c maximum number of elements to retrieve (required) + * @param f can filter on attributes with the format f={filter\\_name}={filter\\_value} with the name/value pair as url encoded string. (optional) + * @param o can order on attributes (optional) + * @param s can search on attributes (optional) + * @return List<Log> + */ + @RequestLine("GET /API/system/log?p={p}&c={c}&f={f}&o={o}&s={s}") + @Headers({ + "Accept: application/json", + }) + List searchLogs(@Param("p") Integer p, @Param("c") Integer c, @Param("f") List f, @Param("o") String o, + @Param("s") String s); + + /** + * Finds Logs + * Similar to searchLogs but it also returns the http response headers . + * Finds Logs with pagination params and filters. The search returns an array of log entries. This Web REST API is available in **Enterprise editions only**. - + * can filter on `action_scope`, `action_type`, `createdBy`, `message`, `severity` value - can search by text + * on `action_scope`, `action_type`, `createdBy`, `message`, `severity` - can order on + * `action_scope`, `action_type`, `creation_date`, `createdBy`, `message`, `severity` + * + * @param p index of the page to display (required) + * @param c maximum number of elements to retrieve (required) + * @param f can filter on attributes with the format f={filter\\_name}={filter\\_value} with the name/value pair as url encoded string. (optional) + * @param o can order on attributes (optional) + * @param s can search on attributes (optional) + * @return A ApiResponse that wraps the response boyd and the http headers. + */ + @RequestLine("GET /API/system/log?p={p}&c={c}&f={f}&o={o}&s={s}") + @Headers({ + "Accept: application/json", + }) + ApiResponse> searchLogsWithHttpInfo(@Param("p") Integer p, @Param("c") Integer c, + @Param("f") List f, @Param("o") String o, @Param("s") String s); + + /** + * Finds Logs + * Finds Logs with pagination params and filters. The search returns an array of log entries. This Web REST API is available in **Enterprise editions only**. - + * can filter on `action_scope`, `action_type`, `createdBy`, `message`, `severity` value - can search by text + * on `action_scope`, `action_type`, `createdBy`, `message`, `severity` - can order on + * `action_scope`, `action_type`, `creation_date`, `createdBy`, `message`, `severity` + * Note, this is equivalent to the other searchLogs method, + * but with the query parameters collected into a single Map parameter. This + * is convenient for services with optional query parameters, especially when + * used with the {@link SearchLogsQueryParams} class that allows for + * building up this map in a fluent style. + * + * @param queryParams Map of query parameters as name-value pairs + *

The following elements may be specified in the query map:

+ *
    + *
  • p - index of the page to display (required)
  • + *
  • c - maximum number of elements to retrieve (required)
  • + *
  • f - can filter on attributes with the format f={filter\\_name}={filter\\_value} with the name/value pair as url encoded string. + * (optional)
  • + *
  • o - can order on attributes (optional)
  • + *
  • s - can search on attributes (optional)
  • + *
+ * @return List<Log> + */ + @RequestLine("GET /API/system/log?p={p}&c={c}&f={f}&o={o}&s={s}") + @Headers({ + "Accept: application/json", + }) + List searchLogs(@QueryMap(encoded = true) SearchLogsQueryParams queryParams); + + /** + * Finds Logs + * Finds Logs with pagination params and filters. The search returns an array of log entries. This Web REST API is available in **Enterprise editions only**. - + * can filter on `action_scope`, `action_type`, `createdBy`, `message`, `severity` value - can search by text + * on `action_scope`, `action_type`, `createdBy`, `message`, `severity` - can order on + * `action_scope`, `action_type`, `creation_date`, `createdBy`, `message`, `severity` + * Note, this is equivalent to the other searchLogs that receives the query parameters as a map, + * but this one also exposes the Http response headers + * + * @param queryParams Map of query parameters as name-value pairs + *

The following elements may be specified in the query map:

+ *
    + *
  • p - index of the page to display (required)
  • + *
  • c - maximum number of elements to retrieve (required)
  • + *
  • f - can filter on attributes with the format f={filter\\_name}={filter\\_value} with the name/value pair as url encoded string. + * (optional)
  • + *
  • o - can order on attributes (optional)
  • + *
  • s - can search on attributes (optional)
  • + *
+ * @return List<Log> + */ + @RequestLine("GET /API/system/log?p={p}&c={c}&f={f}&o={o}&s={s}") + @Headers({ + "Accept: application/json", + }) + ApiResponse> searchLogsWithHttpInfo(@QueryMap(encoded = true) SearchLogsQueryParams queryParams); + + /** + * A convenience class for generating query parameters for the + * searchLogs method in a fluent style. + */ + public static class SearchLogsQueryParams extends HashMap { + + public SearchLogsQueryParams p(final Integer value) { + put("p", EncodingUtils.encode(value)); + return this; + } + + public SearchLogsQueryParams c(final Integer value) { + put("c", EncodingUtils.encode(value)); + return this; + } + + public SearchLogsQueryParams f(final List value) { + put("f", EncodingUtils.encodeCollection(value, "multi")); + return this; + } + + public SearchLogsQueryParams o(final String value) { + put("o", EncodingUtils.encode(value)); + return this; + } + + public SearchLogsQueryParams s(final String value) { + put("s", EncodingUtils.encode(value)); + return this; + } + } +} diff --git a/src/main/java/org/bonitasoft/web/client/model/Log.java b/src/main/java/org/bonitasoft/web/client/model/Log.java new file mode 100644 index 00000000..5f2652c4 --- /dev/null +++ b/src/main/java/org/bonitasoft/web/client/model/Log.java @@ -0,0 +1,300 @@ +/** + * Copyright (C) 2024-2023 BonitaSoft S.A. + * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2.0 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.bonitasoft.web.client.model; + +import java.io.Serializable; +import java.time.OffsetDateTime; +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * A log entry recorded by the Bonita Engine during execution. Logs capture actions performed on the platform such as process deployments, task executions, or + * configuration changes. This Web REST API is available in **Enterprise editions only**. + */ +@JsonPropertyOrder({ + Log.JSON_PROPERTY_ID, + Log.JSON_PROPERTY_CREATION_DATE, + Log.JSON_PROPERTY_CREATED_BY, + Log.JSON_PROPERTY_SEVERITY, + Log.JSON_PROPERTY_MESSAGE, + Log.JSON_PROPERTY_ACTION_SCOPE, + Log.JSON_PROPERTY_ICON +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +public class Log implements Serializable { + + private static final long serialVersionUID = 1L; + + public static final String JSON_PROPERTY_ID = "id"; + @jakarta.annotation.Nullable + private String id; + + public static final String JSON_PROPERTY_CREATION_DATE = "creation_date"; + @jakarta.annotation.Nullable + private OffsetDateTime creationDate; + + public static final String JSON_PROPERTY_CREATED_BY = "createdBy"; + @jakarta.annotation.Nullable + private String createdBy; + + public static final String JSON_PROPERTY_SEVERITY = "severity"; + @jakarta.annotation.Nullable + private LogSeverityLevel severity; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_ACTION_SCOPE = "action_scope"; + @jakarta.annotation.Nullable + private String actionScope; + + public static final String JSON_PROPERTY_ICON = "icon"; + @jakarta.annotation.Nullable + private String icon; + + public Log() { + } + + public Log id(@jakarta.annotation.Nullable String id) { + + this.id = id; + return this; + } + + /** + * the log id + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@jakarta.annotation.Nullable String id) { + this.id = id; + } + + public Log creationDate(@jakarta.annotation.Nullable OffsetDateTime creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * the UTC date and time in ISO-8601 format ('yyyy-MM-ddTHH:mm:ss.SSSZ') when this log was created, for example '2024-10-17T16:05:42.626Z' + * + * @return creationDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getCreationDate() { + return creationDate; + } + + @JsonProperty(JSON_PROPERTY_CREATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreationDate(@jakarta.annotation.Nullable OffsetDateTime creationDate) { + this.creationDate = creationDate; + } + + public Log createdBy(@jakarta.annotation.Nullable String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * the name of the user who triggered the logged action + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCreatedBy() { + return createdBy; + } + + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedBy(@jakarta.annotation.Nullable String createdBy) { + this.createdBy = createdBy; + } + + public Log severity(@jakarta.annotation.Nullable LogSeverityLevel severity) { + + this.severity = severity; + return this; + } + + /** + * Get severity + * + * @return severity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LogSeverityLevel getSeverity() { + return severity; + } + + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSeverity(@jakarta.annotation.Nullable LogSeverityLevel severity) { + this.severity = severity; + } + + public Log message(@jakarta.annotation.Nullable String message) { + + this.message = message; + return this; + } + + /** + * the log message describing the action + * + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + public Log actionScope(@jakarta.annotation.Nullable String actionScope) { + + this.actionScope = actionScope; + return this; + } + + /** + * the scope of the logged action + * + * @return actionScope + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getActionScope() { + return actionScope; + } + + @JsonProperty(JSON_PROPERTY_ACTION_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActionScope(@jakarta.annotation.Nullable String actionScope) { + this.actionScope = actionScope; + } + + public Log icon(@jakarta.annotation.Nullable String icon) { + + this.icon = icon; + return this; + } + + /** + * the icon path for this log entry + * + * @return icon + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIcon() { + return icon; + } + + @JsonProperty(JSON_PROPERTY_ICON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIcon(@jakarta.annotation.Nullable String icon) { + this.icon = icon; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Log log = (Log) o; + return Objects.equals(this.id, log.id) && + Objects.equals(this.creationDate, log.creationDate) && + Objects.equals(this.createdBy, log.createdBy) && + Objects.equals(this.severity, log.severity) && + Objects.equals(this.message, log.message) && + Objects.equals(this.actionScope, log.actionScope) && + Objects.equals(this.icon, log.icon); + } + + @Override + public int hashCode() { + return Objects.hash(id, creationDate, createdBy, severity, message, actionScope, icon); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Log {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" actionScope: ").append(toIndentedString(actionScope)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).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 "); + } + +} diff --git a/src/main/java/org/bonitasoft/web/client/model/LogSeverityLevel.java b/src/main/java/org/bonitasoft/web/client/model/LogSeverityLevel.java new file mode 100644 index 00000000..c4737b75 --- /dev/null +++ b/src/main/java/org/bonitasoft/web/client/model/LogSeverityLevel.java @@ -0,0 +1,56 @@ +/** + * Copyright (C) 2024-2023 BonitaSoft S.A. + * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2.0 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.bonitasoft.web.client.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * the severity level of the log + */ +public enum LogSeverityLevel { + + BUSINESS("BUSINESS"), + + INTERNAL("INTERNAL"); + + private String value; + + LogSeverityLevel(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LogSeverityLevel fromValue(String value) { + for (LogSeverityLevel b : LogSeverityLevel.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +}