Browse Source

Merge branch 'master' of github.com:thingsboard/thingsboard

pull/10555/head
Igor Kulikov 2 years ago
parent
commit
d62875db98
  1. 2
      application/src/main/java/org/thingsboard/server/controller/ComponentDescriptorController.java
  2. 4
      application/src/main/java/org/thingsboard/server/controller/QueueController.java
  3. 6
      application/src/main/java/org/thingsboard/server/controller/TbResourceController.java
  4. 8
      application/src/main/java/org/thingsboard/server/controller/TelemetryController.java
  5. 2
      application/src/main/java/org/thingsboard/server/controller/TwoFactorAuthConfigController.java
  6. 4
      application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginRequest.java
  7. 4
      application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginResponse.java
  8. 4
      common/data/src/main/java/org/thingsboard/server/common/data/Customer.java
  9. 2
      common/data/src/main/java/org/thingsboard/server/common/data/DashboardInfo.java
  10. 4
      common/data/src/main/java/org/thingsboard/server/common/data/Device.java
  11. 6
      common/data/src/main/java/org/thingsboard/server/common/data/EntityView.java
  12. 4
      common/data/src/main/java/org/thingsboard/server/common/data/SaveDeviceWithCredentialsRequest.java
  13. 4
      common/data/src/main/java/org/thingsboard/server/common/data/Tenant.java
  14. 4
      common/data/src/main/java/org/thingsboard/server/common/data/User.java
  15. 14
      common/data/src/main/java/org/thingsboard/server/common/data/alarm/Alarm.java
  16. 6
      common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmCreateOrUpdateActiveRequest.java
  17. 2
      common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmUpdateRequest.java
  18. 2
      common/data/src/main/java/org/thingsboard/server/common/data/asset/Asset.java
  19. 8
      common/data/src/main/java/org/thingsboard/server/common/data/edge/Edge.java
  20. 2
      common/data/src/main/java/org/thingsboard/server/common/data/event/EventFilter.java
  21. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/AlarmId.java
  22. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/ApiUsageStateId.java
  23. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/AssetId.java
  24. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/AssetProfileId.java
  25. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/CustomerId.java
  26. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/DashboardId.java
  27. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java
  28. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceProfileId.java
  29. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/EdgeId.java
  30. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/EntityViewId.java
  31. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationId.java
  32. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationRequestId.java
  33. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationRuleId.java
  34. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationTargetId.java
  35. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationTemplateId.java
  36. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/OtaPackageId.java
  37. 4
      common/data/src/main/java/org/thingsboard/server/common/data/id/QueueId.java
  38. 4
      common/data/src/main/java/org/thingsboard/server/common/data/id/QueueStatsId.java
  39. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/RpcId.java
  40. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/RuleChainId.java
  41. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/RuleNodeId.java
  42. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/TbResourceId.java
  43. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/TenantId.java
  44. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/TenantProfileId.java
  45. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/UUIDBased.java
  46. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetTypeId.java
  47. 2
      common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetsBundleId.java
  48. 2
      common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2BasicMapperConfig.java
  49. 2
      common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2ClientRegistrationTemplate.java
  50. 4
      common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2DomainInfo.java
  51. 2
      common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2Info.java
  52. 2
      common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2MapperConfig.java
  53. 4
      common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2MobileInfo.java
  54. 6
      common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2ParamsInfo.java
  55. 18
      common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2RegistrationInfo.java
  56. 6
      common/data/src/main/java/org/thingsboard/server/common/data/objects/AttributesEntityView.java
  57. 4
      common/data/src/main/java/org/thingsboard/server/common/data/objects/TelemetryEntityView.java
  58. 2
      common/data/src/main/java/org/thingsboard/server/common/data/rule/DefaultRuleChainCreateRequest.java
  59. 6
      common/data/src/main/java/org/thingsboard/server/common/data/rule/NodeConnectionInfo.java
  60. 4
      common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChain.java
  61. 8
      common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainConnectionInfo.java
  62. 4
      common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainData.java
  63. 10
      common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainMetaData.java
  64. 10
      common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainOutputLabelsUsage.java
  65. 6
      common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentials.java
  66. 30
      common/data/src/main/java/org/thingsboard/server/common/data/sms/config/SmppSmsProviderConfiguration.java

2
application/src/main/java/org/thingsboard/server/controller/ComponentDescriptorController.java

@ -68,7 +68,7 @@ public class ComponentDescriptorController extends BaseController {
@RequestMapping(value = "/components/{componentType}", method = RequestMethod.GET)
@ResponseBody
public List<ComponentDescriptor> getComponentDescriptorsByType(
@Parameter(description = "Type of the Rule Node", schema = @Schema(allowableValues = "ENRICHMENT,FILTER,TRANSFORMATION,ACTION,EXTERNAL", required = true))
@Parameter(description = "Type of the Rule Node", schema = @Schema(allowableValues = "ENRICHMENT,FILTER,TRANSFORMATION,ACTION,EXTERNAL", requiredMode = Schema.RequiredMode.REQUIRED))
@PathVariable("componentType") String strComponentType,
@Parameter(description = "Type of the Rule Chain", schema = @Schema(allowableValues = "CORE,EDGE"))
@RequestParam(value = "ruleChainType", required = false) String strRuleChainType) throws ThingsboardException {

4
application/src/main/java/org/thingsboard/server/controller/QueueController.java

@ -67,7 +67,7 @@ public class QueueController extends BaseController {
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
@RequestMapping(value = "/queues", params = {"serviceType", "pageSize", "page"}, method = RequestMethod.GET)
@ResponseBody
public PageData<Queue> getTenantQueuesByServiceType(@Parameter(description = QUEUE_SERVICE_TYPE_DESCRIPTION, schema = @Schema(allowableValues = {"TB-RULE-ENGINE", "TB-CORE", "TB-TRANSPORT", "JS-EXECUTOR"}, required = true))
public PageData<Queue> getTenantQueuesByServiceType(@Parameter(description = QUEUE_SERVICE_TYPE_DESCRIPTION, schema = @Schema(allowableValues = {"TB-RULE-ENGINE", "TB-CORE", "TB-TRANSPORT", "JS-EXECUTOR"}, requiredMode = Schema.RequiredMode.REQUIRED))
@RequestParam String serviceType,
@Parameter(description = PAGE_SIZE_DESCRIPTION, required = true)
@RequestParam int pageSize,
@ -126,7 +126,7 @@ public class QueueController extends BaseController {
@ResponseBody
public Queue saveQueue(@Parameter(description = "A JSON value representing the queue.")
@RequestBody Queue queue,
@Parameter(description = QUEUE_SERVICE_TYPE_DESCRIPTION, schema = @Schema(allowableValues = {"TB-RULE-ENGINE", "TB-CORE", "TB-TRANSPORT", "JS-EXECUTOR"}, required = true))
@Parameter(description = QUEUE_SERVICE_TYPE_DESCRIPTION, schema = @Schema(allowableValues = {"TB-RULE-ENGINE", "TB-CORE", "TB-TRANSPORT", "JS-EXECUTOR"}, requiredMode = Schema.RequiredMode.REQUIRED))
@RequestParam String serviceType) throws ThingsboardException {
checkParameter("serviceType", serviceType);
queue.setTenantId(getCurrentUser().getTenantId());

6
application/src/main/java/org/thingsboard/server/controller/TbResourceController.java

@ -268,9 +268,9 @@ public class TbResourceController extends BaseController {
"You can specify parameters to filter the results. " + LWM2M_OBJECT_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH)
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
@GetMapping(value = "/resource/lwm2m")
public List<LwM2mObject> getLwm2mListObjects(@Parameter(description = SORT_ORDER_DESCRIPTION, schema = @Schema(allowableValues = {"ASC", "DESC"}, required = true))
public List<LwM2mObject> getLwm2mListObjects(@Parameter(description = SORT_ORDER_DESCRIPTION, schema = @Schema(allowableValues = {"ASC", "DESC"}, requiredMode = Schema.RequiredMode.REQUIRED))
@RequestParam String sortOrder,
@Parameter(description = SORT_PROPERTY_DESCRIPTION, schema = @Schema(allowableValues = {"id", "name"}, required = true))
@Parameter(description = SORT_PROPERTY_DESCRIPTION, schema = @Schema(allowableValues = {"id", "name"}, requiredMode = Schema.RequiredMode.REQUIRED))
@RequestParam String sortProperty,
@Parameter(description = "LwM2M Object ids.", required = true)
@RequestParam(required = false) String[] objectIds) throws ThingsboardException {
@ -315,4 +315,4 @@ public class TbResourceController extends BaseController {
.body(resource);
}
}
}

8
application/src/main/java/org/thingsboard/server/controller/TelemetryController.java

@ -236,7 +236,7 @@ public class TelemetryController extends BaseController {
public DeferredResult<ResponseEntity> getAttributesByScope(
@Parameter(description = ENTITY_TYPE_PARAM_DESCRIPTION, required = true, schema = @Schema(defaultValue = "DEVICE")) @PathVariable("entityType") String entityType,
@Parameter(description = ENTITY_ID_PARAM_DESCRIPTION, required = true) @PathVariable("entityId") String entityIdStr,
@Parameter(description = ATTRIBUTES_SCOPE_DESCRIPTION, schema = @Schema(allowableValues = {"SERVER_SCOPE", "SHARED_SCOPE", "CLIENT_SCOPE"}, required = true)) @PathVariable("scope") AttributeScope scope,
@Parameter(description = ATTRIBUTES_SCOPE_DESCRIPTION, schema = @Schema(allowableValues = {"SERVER_SCOPE", "SHARED_SCOPE", "CLIENT_SCOPE"}, requiredMode = Schema.RequiredMode.REQUIRED)) @PathVariable("scope") AttributeScope scope,
@Parameter(description = ATTRIBUTES_KEYS_DESCRIPTION) @RequestParam(name = "keys", required = false) String keysStr) throws ThingsboardException {
SecurityUser user = getCurrentUser();
return accessValidator.validateEntityAndCallback(getCurrentUser(), Operation.READ_ATTRIBUTES, entityType, entityIdStr,
@ -353,7 +353,7 @@ public class TelemetryController extends BaseController {
@ResponseBody
public DeferredResult<ResponseEntity> saveDeviceAttributes(
@Parameter(description = DEVICE_ID_PARAM_DESCRIPTION, required = true) @PathVariable("deviceId") String deviceIdStr,
@Parameter(description = ATTRIBUTES_SCOPE_DESCRIPTION, schema = @Schema(allowableValues = {"SERVER_SCOPE", "SHARED_SCOPE"}, required = true)) @PathVariable("scope") AttributeScope scope,
@Parameter(description = ATTRIBUTES_SCOPE_DESCRIPTION, schema = @Schema(allowableValues = {"SERVER_SCOPE", "SHARED_SCOPE"}, requiredMode = Schema.RequiredMode.REQUIRED)) @PathVariable("scope") AttributeScope scope,
@io.swagger.v3.oas.annotations.parameters.RequestBody(description = ATTRIBUTES_JSON_REQUEST_DESCRIPTION, required = true) @RequestBody JsonNode request) throws ThingsboardException {
EntityId entityId = EntityIdFactory.getByTypeAndUuid(EntityType.DEVICE, deviceIdStr);
return saveAttributes(getTenantId(), entityId, scope, request);
@ -399,7 +399,7 @@ public class TelemetryController extends BaseController {
public DeferredResult<ResponseEntity> saveEntityAttributesV2(
@Parameter(description = ENTITY_TYPE_PARAM_DESCRIPTION, required = true, schema = @Schema(defaultValue = "DEVICE")) @PathVariable("entityType") String entityType,
@Parameter(description = ENTITY_ID_PARAM_DESCRIPTION, required = true) @PathVariable("entityId") String entityIdStr,
@Parameter(description = ATTRIBUTES_SCOPE_DESCRIPTION, schema = @Schema(allowableValues = {"SERVER_SCOPE", "SHARED_SCOPE"}, required = true)) @PathVariable("scope")AttributeScope scope,
@Parameter(description = ATTRIBUTES_SCOPE_DESCRIPTION, schema = @Schema(allowableValues = {"SERVER_SCOPE", "SHARED_SCOPE"}, requiredMode = Schema.RequiredMode.REQUIRED)) @PathVariable("scope")AttributeScope scope,
@io.swagger.v3.oas.annotations.parameters.RequestBody(description = ATTRIBUTES_JSON_REQUEST_DESCRIPTION, required = true) @RequestBody JsonNode request) throws ThingsboardException {
EntityId entityId = EntityIdFactory.getByTypeAndId(entityType, entityIdStr);
return saveAttributes(getTenantId(), entityId, scope, request);
@ -550,7 +550,7 @@ public class TelemetryController extends BaseController {
@ResponseBody
public DeferredResult<ResponseEntity> deleteDeviceAttributes(
@Parameter(description = DEVICE_ID_PARAM_DESCRIPTION, required = true) @PathVariable(DEVICE_ID) String deviceIdStr,
@Parameter(description = ATTRIBUTES_SCOPE_DESCRIPTION, schema = @Schema(allowableValues = {"SERVER_SCOPE", "SHARED_SCOPE", "CLIENT_SCOPE"}, required = true)) @PathVariable("scope")AttributeScope scope,
@Parameter(description = ATTRIBUTES_SCOPE_DESCRIPTION, schema = @Schema(allowableValues = {"SERVER_SCOPE", "SHARED_SCOPE", "CLIENT_SCOPE"}, requiredMode = Schema.RequiredMode.REQUIRED)) @PathVariable("scope")AttributeScope scope,
@Parameter(description = ATTRIBUTES_KEYS_DESCRIPTION, required = true)@RequestParam(name = "keys")String keysStr) throws ThingsboardException {
EntityId entityId = EntityIdFactory.getByTypeAndUuid(EntityType.DEVICE, deviceIdStr);
return deleteAttributes(entityId, scope, keysStr);

2
application/src/main/java/org/thingsboard/server/controller/TwoFactorAuthConfigController.java

@ -100,7 +100,7 @@ public class TwoFactorAuthConfigController extends BaseController {
ControllerConstants.AVAILABLE_FOR_ANY_AUTHORIZED_USER)
@PostMapping("/account/config/generate")
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
public TwoFaAccountConfig generateTwoFaAccountConfig(@Parameter(description = "2FA provider type to generate new account config for", schema = @Schema(defaultValue = "TOTP", required = true))
public TwoFaAccountConfig generateTwoFaAccountConfig(@Parameter(description = "2FA provider type to generate new account config for", schema = @Schema(defaultValue = "TOTP", requiredMode = Schema.RequiredMode.REQUIRED))
@RequestParam TwoFaProviderType providerType) throws Exception {
SecurityUser user = getCurrentUser();
return twoFactorAuthService.generateNewAccountConfig(user, providerType);

4
application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginRequest.java

@ -32,12 +32,12 @@ public class LoginRequest {
this.password = password;
}
@Schema(required = true, description = "User email", example = "tenant@thingsboard.org")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "User email", example = "tenant@thingsboard.org")
public String getUsername() {
return username;
}
@Schema(required = true, description = "User password", example = "tenant")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "User password", example = "tenant")
public String getPassword() {
return password;
}

4
application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginResponse.java

@ -22,11 +22,11 @@ import lombok.Data;
@Data
public class LoginResponse {
@Schema(required = true, description = "JWT token",
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JWT token",
example = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZW5hbnRAdGhpbmdzYm9hcmQub3JnIi...")
private String token;
@Schema(required = true, description = "Refresh token",
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Refresh token",
example = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZW5hbnRAdGhpbmdzYm9hcmQub3JnIi...")
private String refreshToken;

4
common/data/src/main/java/org/thingsboard/server/common/data/Customer.java

@ -36,7 +36,7 @@ public class Customer extends ContactBased<CustomerId> implements HasTenantId, E
@NoXss
@Length(fieldName = "title")
@Schema(required = true, description = "Title of the customer", example = "Company A")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Title of the customer", example = "Company A")
private String title;
@Schema(description = "JSON object with Tenant Id")
private TenantId tenantId;
@ -132,7 +132,7 @@ public class Customer extends ContactBased<CustomerId> implements HasTenantId, E
return super.getPhone();
}
@Schema(required = true, description = "Email", example = "example@company.com")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Email", example = "example@company.com")
@Override
public String getEmail() {
return super.getEmail();

2
common/data/src/main/java/org/thingsboard/server/common/data/DashboardInfo.java

@ -85,7 +85,7 @@ public class DashboardInfo extends BaseData<DashboardId> implements HasName, Has
this.tenantId = tenantId;
}
@Schema(required = true, description = "Title of the dashboard.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Title of the dashboard.")
public String getTitle() {
return title;
}

4
common/data/src/main/java/org/thingsboard/server/common/data/Device.java

@ -136,7 +136,7 @@ public class Device extends BaseDataWithAdditionalInfo<DeviceId> implements HasL
this.customerId = customerId;
}
@Schema(required = true, description = "Unique Device Name in scope of Tenant", example = "A4B72CCDFF33")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Unique Device Name in scope of Tenant", example = "A4B72CCDFF33")
@Override
public String getName() {
return name;
@ -164,7 +164,7 @@ public class Device extends BaseDataWithAdditionalInfo<DeviceId> implements HasL
this.label = label;
}
@Schema(required = true, description = "JSON object with Device Profile Id.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with Device Profile Id.")
public DeviceProfileId getDeviceProfileId() {
return deviceProfileId;
}

6
common/data/src/main/java/org/thingsboard/server/common/data/EntityView.java

@ -40,17 +40,17 @@ public class EntityView extends BaseDataWithAdditionalInfo<EntityViewId>
private static final long serialVersionUID = 5582010124562018986L;
@Schema(required = true, description = "JSON object with the referenced Entity Id (Device or Asset).")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with the referenced Entity Id (Device or Asset).")
private EntityId entityId;
private TenantId tenantId;
private CustomerId customerId;
@NoXss
@Length(fieldName = "name")
@Schema(required = true, description = "Entity View name", example = "A4B72CCDFF33")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Entity View name", example = "A4B72CCDFF33")
private String name;
@NoXss
@Length(fieldName = "type")
@Schema(required = true, description = "Device Profile Name", example = "Temperature Sensor")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Device Profile Name", example = "Temperature Sensor")
private String type;
@Schema(description = "Set of telemetry and attribute keys to expose via Entity View.")
private TelemetryEntityView keys;

4
common/data/src/main/java/org/thingsboard/server/common/data/SaveDeviceWithCredentialsRequest.java

@ -25,10 +25,10 @@ import jakarta.validation.constraints.NotNull;;
@Data
public class SaveDeviceWithCredentialsRequest {
@Schema(description = "The JSON with device entity.", required = true)
@Schema(description = "The JSON with device entity.", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull
private final Device device;
@Schema(description = "The JSON with credentials entity.", required = true)
@Schema(description = "The JSON with credentials entity.", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull
private final DeviceCredentials credentials;

4
common/data/src/main/java/org/thingsboard/server/common/data/Tenant.java

@ -33,7 +33,7 @@ public class Tenant extends ContactBased<TenantId> implements HasTenantId, HasTi
@Length(fieldName = "title")
@NoXss
@Schema(required = true, description = "Title of the tenant", example = "Company A")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Title of the tenant", example = "Company A")
private String title;
@NoXss
@Length(fieldName = "region")
@ -152,7 +152,7 @@ public class Tenant extends ContactBased<TenantId> implements HasTenantId, HasTi
return super.getPhone();
}
@Schema(required = true, description = "Email", example = "example@company.com")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Email", example = "example@company.com")
@Override
public String getEmail() {
return super.getEmail();

4
common/data/src/main/java/org/thingsboard/server/common/data/User.java

@ -103,7 +103,7 @@ public class User extends BaseDataWithAdditionalInfo<UserId> implements HasName,
this.customerId = customerId;
}
@Schema(required = true, description = "Email of the user", example = "user@example.com")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Email of the user", example = "user@example.com")
public String getEmail() {
return email;
}
@ -119,7 +119,7 @@ public class User extends BaseDataWithAdditionalInfo<UserId> implements HasName,
return email;
}
@Schema(required = true, description = "Authority", example = "SYS_ADMIN, TENANT_ADMIN or CUSTOMER_USER")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Authority", example = "SYS_ADMIN, TENANT_ADMIN or CUSTOMER_USER")
public Authority getAuthority() {
return authority;
}

14
common/data/src/main/java/org/thingsboard/server/common/data/alarm/Alarm.java

@ -59,16 +59,16 @@ public class Alarm extends BaseData<AlarmId> implements HasName, HasTenantId, Ha
private CustomerId customerId;
@NoXss
@Schema(required = true, description = "representing type of the Alarm", example = "High Temperature Alarm")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "representing type of the Alarm", example = "High Temperature Alarm")
@Length(fieldName = "type")
private String type;
@Schema(required = true, description = "JSON object with alarm originator id")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with alarm originator id")
private EntityId originator;
@Schema(required = true, description = "Alarm severity", example = "CRITICAL")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Alarm severity", example = "CRITICAL")
private AlarmSeverity severity;
@Schema(required = true, description = "Acknowledged", example = "true")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Acknowledged", example = "true")
private boolean acknowledged;
@Schema(required = true, description = "Cleared", example = "false")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Cleared", example = "false")
private boolean cleared;
@Schema(description = "Alarm assignee user id")
private UserId assigneeId;
@ -128,7 +128,7 @@ public class Alarm extends BaseData<AlarmId> implements HasName, HasTenantId, Ha
@Override
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@Schema(required = true, description = "representing type of the Alarm", example = "High Temperature Alarm")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "representing type of the Alarm", example = "High Temperature Alarm")
public String getName() {
return type;
}
@ -150,7 +150,7 @@ public class Alarm extends BaseData<AlarmId> implements HasName, HasTenantId, Ha
}
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@Schema(required = true, description = "status of the Alarm", example = "ACTIVE_UNACK", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "status of the Alarm", example = "ACTIVE_UNACK", accessMode = Schema.AccessMode.READ_ONLY)
public AlarmStatus getStatus() {
return toStatus(cleared, acknowledged);
}

6
common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmCreateOrUpdateActiveRequest.java

@ -40,14 +40,14 @@ public class AlarmCreateOrUpdateActiveRequest implements AlarmModificationReques
@Schema(description = "JSON object with Customer Id", accessMode = Schema.AccessMode.READ_ONLY)
private CustomerId customerId;
@NotNull
@Schema(required = true, description = "representing type of the Alarm", example = "High Temperature Alarm")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "representing type of the Alarm", example = "High Temperature Alarm")
@Length(fieldName = "type")
private String type;
@NotNull
@Schema(required = true, description = "JSON object with alarm originator id")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with alarm originator id")
private EntityId originator;
@NotNull
@Schema(required = true, description = "Alarm severity", example = "CRITICAL")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Alarm severity", example = "CRITICAL")
private AlarmSeverity severity;
@Schema(description = "Timestamp of the alarm start time, in milliseconds", example = "1634058704565")
private long startTs;

2
common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmUpdateRequest.java

@ -41,7 +41,7 @@ public class AlarmUpdateRequest implements AlarmModificationRequest {
"Omit this field to create new alarm.")
private AlarmId alarmId;
@NotNull
@Schema(required = true, description = "Alarm severity", example = "CRITICAL")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Alarm severity", example = "CRITICAL")
private AlarmSeverity severity;
@Schema(description = "Timestamp of the alarm start time, in milliseconds", example = "1634058704565")
private long startTs;

2
common/data/src/main/java/org/thingsboard/server/common/data/asset/Asset.java

@ -120,7 +120,7 @@ public class Asset extends BaseDataWithAdditionalInfo<AssetId> implements HasLab
this.customerId = customerId;
}
@Schema(required = true, description = "Unique Asset Name in scope of Tenant", example = "Empire State Building")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Unique Asset Name in scope of Tenant", example = "Empire State Building")
@Override
public String getName() {
return name;

8
common/data/src/main/java/org/thingsboard/server/common/data/edge/Edge.java

@ -120,13 +120,13 @@ public class Edge extends BaseDataWithAdditionalInfo<EdgeId> implements HasLabel
return this.rootRuleChainId;
}
@Schema(required = true, description = "Unique Edge Name in scope of Tenant", example = "Silo_A_Edge")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Unique Edge Name in scope of Tenant", example = "Silo_A_Edge")
@Override
public String getName() {
return this.name;
}
@Schema(required = true, description = "Edge type", example = "Silos")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Edge type", example = "Silos")
public String getType() {
return this.type;
}
@ -136,12 +136,12 @@ public class Edge extends BaseDataWithAdditionalInfo<EdgeId> implements HasLabel
return this.label;
}
@Schema(required = true, description = "Edge routing key ('username') to authorize on cloud")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Edge routing key ('username') to authorize on cloud")
public String getRoutingKey() {
return this.routingKey;
}
@Schema(required = true, description = "Edge secret ('password') to authorize on cloud")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Edge secret ('password') to authorize on cloud")
public String getSecret() {
return this.secret;
}

2
common/data/src/main/java/org/thingsboard/server/common/data/event/EventFilter.java

@ -33,7 +33,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
})
public interface EventFilter {
@Schema(required = true, description = "String value representing the event type", example = "STATS")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "String value representing the event type", example = "STATS")
EventType getEventType();
boolean isNotEmpty();

2
common/data/src/main/java/org/thingsboard/server/common/data/id/AlarmId.java

@ -36,7 +36,7 @@ public class AlarmId extends UUIDBased implements EntityId {
return new AlarmId(UUID.fromString(alarmId));
}
@Schema(required = true, description = "string", example = "ALARM", allowableValues = "ALARM")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "ALARM", allowableValues = "ALARM")
@Override
public EntityType getEntityType() {
return EntityType.ALARM;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/ApiUsageStateId.java

@ -34,7 +34,7 @@ public class ApiUsageStateId extends UUIDBased implements EntityId {
return new ApiUsageStateId(UUID.fromString(userId));
}
@Schema(required = true, description = "string", example = "API_USAGE_STATE", allowableValues = "API_USAGE_STATE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "API_USAGE_STATE", allowableValues = "API_USAGE_STATE")
@Override
public EntityType getEntityType() {
return EntityType.API_USAGE_STATE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/AssetId.java

@ -36,7 +36,7 @@ public class AssetId extends UUIDBased implements EntityId {
return new AssetId(UUID.fromString(assetId));
}
@Schema(required = true, description = "string", example = "ASSET", allowableValues = "ASSET")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "ASSET", allowableValues = "ASSET")
@Override
public EntityType getEntityType() {
return EntityType.ASSET;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/AssetProfileId.java

@ -35,7 +35,7 @@ public class AssetProfileId extends UUIDBased implements EntityId {
return new AssetProfileId(UUID.fromString(assetProfileId));
}
@Schema(required = true, description = "string", example = "ASSET_PROFILE", allowableValues = "ASSET_PROFILE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "ASSET_PROFILE", allowableValues = "ASSET_PROFILE")
@Override
public EntityType getEntityType() {
return EntityType.ASSET_PROFILE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/CustomerId.java

@ -32,7 +32,7 @@ public final class CustomerId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "CUSTOMER", allowableValues = "CUSTOMER")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "CUSTOMER", allowableValues = "CUSTOMER")
@Override
public EntityType getEntityType() {
return EntityType.CUSTOMER;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/DashboardId.java

@ -34,7 +34,7 @@ public class DashboardId extends UUIDBased implements EntityId {
return new DashboardId(UUID.fromString(dashboardId));
}
@Schema(required = true, description = "string", example = "DASHBOARD", allowableValues = "DASHBOARD")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "DASHBOARD", allowableValues = "DASHBOARD")
@Override
public EntityType getEntityType() {
return EntityType.DASHBOARD;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java

@ -37,7 +37,7 @@ public class DeviceId extends UUIDBased implements EntityId {
}
@Override
@Schema(required = true, description = "string", example = "DEVICE", allowableValues = "DEVICE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "DEVICE", allowableValues = "DEVICE")
public EntityType getEntityType() {
return EntityType.DEVICE;
}

2
common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceProfileId.java

@ -35,7 +35,7 @@ public class DeviceProfileId extends UUIDBased implements EntityId {
return new DeviceProfileId(UUID.fromString(deviceProfileId));
}
@Schema(required = true, description = "string", example = "DEVICE_PROFILE", allowableValues = "DEVICE_PROFILE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "DEVICE_PROFILE", allowableValues = "DEVICE_PROFILE")
@Override
public EntityType getEntityType() {
return EntityType.DEVICE_PROFILE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/EdgeId.java

@ -41,7 +41,7 @@ public class EdgeId extends UUIDBased implements EntityId {
return new EdgeId(UUID.fromString(edgeId));
}
@Schema(required = true, description = "string", example = "EDGE", allowableValues = "EDGE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "EDGE", allowableValues = "EDGE")
@Override
public EntityType getEntityType() {
return EntityType.EDGE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/EntityViewId.java

@ -38,7 +38,7 @@ public class EntityViewId extends UUIDBased implements EntityId {
return new EntityViewId(UUID.fromString(entityViewID));
}
@Schema(required = true, description = "string", example = "ENTITY_VIEW", allowableValues = "ENTITY_VIEW")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "ENTITY_VIEW", allowableValues = "ENTITY_VIEW")
@Override
public EntityType getEntityType() {
return EntityType.ENTITY_VIEW;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationId.java

@ -29,7 +29,7 @@ public class NotificationId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "NOTIFICATION", allowableValues = "NOTIFICATION")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "NOTIFICATION", allowableValues = "NOTIFICATION")
@Override
public EntityType getEntityType() {
return EntityType.NOTIFICATION;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationRequestId.java

@ -29,7 +29,7 @@ public class NotificationRequestId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "NOTIFICATION_REQUEST", allowableValues = "NOTIFICATION_REQUEST")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "NOTIFICATION_REQUEST", allowableValues = "NOTIFICATION_REQUEST")
@Override
public EntityType getEntityType() {
return EntityType.NOTIFICATION_REQUEST;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationRuleId.java

@ -29,7 +29,7 @@ public class NotificationRuleId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "NOTIFICATION_RULE", allowableValues = "NOTIFICATION_RULE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "NOTIFICATION_RULE", allowableValues = "NOTIFICATION_RULE")
@Override
public EntityType getEntityType() {
return EntityType.NOTIFICATION_RULE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationTargetId.java

@ -29,7 +29,7 @@ public class NotificationTargetId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "NOTIFICATION_TARGET", allowableValues = "NOTIFICATION_TARGET")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "NOTIFICATION_TARGET", allowableValues = "NOTIFICATION_TARGET")
@Override
public EntityType getEntityType() {
return EntityType.NOTIFICATION_TARGET;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationTemplateId.java

@ -29,7 +29,7 @@ public class NotificationTemplateId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "NOTIFICATION_TEMPLATE", allowableValues = "NOTIFICATION_TEMPLATE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "NOTIFICATION_TEMPLATE", allowableValues = "NOTIFICATION_TEMPLATE")
@Override
public EntityType getEntityType() {
return EntityType.NOTIFICATION_TEMPLATE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/OtaPackageId.java

@ -35,7 +35,7 @@ public class OtaPackageId extends UUIDBased implements EntityId {
return new OtaPackageId(UUID.fromString(firmwareId));
}
@Schema(required = true, description = "string", example = "OTA_PACKAGE", allowableValues = "OTA_PACKAGE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "OTA_PACKAGE", allowableValues = "OTA_PACKAGE")
@Override
public EntityType getEntityType() {
return EntityType.OTA_PACKAGE;

4
common/data/src/main/java/org/thingsboard/server/common/data/id/QueueId.java

@ -35,9 +35,9 @@ public class QueueId extends UUIDBased implements EntityId {
return new QueueId(UUID.fromString(queueId));
}
@Schema(required = true, description = "string", example = "QUEUE", allowableValues = "QUEUE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "QUEUE", allowableValues = "QUEUE")
@Override
public EntityType getEntityType() {
return EntityType.QUEUE;
}
}
}

4
common/data/src/main/java/org/thingsboard/server/common/data/id/QueueStatsId.java

@ -35,9 +35,9 @@ public class QueueStatsId extends UUIDBased implements EntityId {
return new QueueStatsId(UUID.fromString(queueId));
}
@Schema(required = true, description = "string", example = "QUEUE_STATS", allowableValues = "QUEUE_STATS")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "QUEUE_STATS", allowableValues = "QUEUE_STATS")
@Override
public EntityType getEntityType() {
return EntityType.QUEUE_STATS;
}
}
}

2
common/data/src/main/java/org/thingsboard/server/common/data/id/RpcId.java

@ -31,7 +31,7 @@ public final class RpcId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "RPC", allowableValues = "RPC")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "RPC", allowableValues = "RPC")
@Override
public EntityType getEntityType() {
return EntityType.RPC;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/RuleChainId.java

@ -29,7 +29,7 @@ public class RuleChainId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "RULE_CHAIN", allowableValues = "RULE_CHAIN")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "RULE_CHAIN", allowableValues = "RULE_CHAIN")
@Override
public EntityType getEntityType() {
return EntityType.RULE_CHAIN;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/RuleNodeId.java

@ -29,7 +29,7 @@ public class RuleNodeId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "RULE_NODE", allowableValues = "RULE_NODE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "RULE_NODE", allowableValues = "RULE_NODE")
@Override
public EntityType getEntityType() {
return EntityType.RULE_NODE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/TbResourceId.java

@ -31,7 +31,7 @@ public class TbResourceId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "TB_RESOURCE", allowableValues = "TB_RESOURCE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "TB_RESOURCE", allowableValues = "TB_RESOURCE")
@Override
public EntityType getEntityType() {
return EntityType.TB_RESOURCE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/TenantId.java

@ -50,7 +50,7 @@ public final class TenantId extends UUIDBased implements EntityId {
return this.equals(SYS_TENANT_ID);
}
@Schema(required = true, description = "string", example = "TENANT", allowableValues = "TENANT")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "TENANT", allowableValues = "TENANT")
@Override
public EntityType getEntityType() {
return EntityType.TENANT;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/TenantProfileId.java

@ -35,7 +35,7 @@ public class TenantProfileId extends UUIDBased implements EntityId {
return new TenantProfileId(UUID.fromString(tenantProfileId));
}
@Schema(required = true, description = "string", example = "TENANT_PROFILE", allowableValues = "TENANT_PROFILE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "TENANT_PROFILE", allowableValues = "TENANT_PROFILE")
@Override
public EntityType getEntityType() {
return EntityType.TENANT_PROFILE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/UUIDBased.java

@ -36,7 +36,7 @@ public abstract class UUIDBased implements HasUUID, Serializable {
this.id = id;
}
@Schema(required = true, description = "string", example = "784f394c-42b6-435a-983c-b7beff2784f9")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "784f394c-42b6-435a-983c-b7beff2784f9")
public UUID getId() {
return id;
}

2
common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetTypeId.java

@ -31,7 +31,7 @@ public final class WidgetTypeId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "WIDGET_TYPE", allowableValues = "WIDGET_TYPE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "WIDGET_TYPE", allowableValues = "WIDGET_TYPE")
@Override
public EntityType getEntityType() {
return EntityType.WIDGET_TYPE;

2
common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetsBundleId.java

@ -31,7 +31,7 @@ public final class WidgetsBundleId extends UUIDBased implements EntityId {
super(id);
}
@Schema(required = true, description = "string", example = "WIDGETS_BUNDLE", allowableValues = "WIDGETS_BUNDLE")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "string", example = "WIDGETS_BUNDLE", allowableValues = "WIDGETS_BUNDLE")
@Override
public EntityType getEntityType() {
return EntityType.WIDGETS_BUNDLE;

2
common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2BasicMapperConfig.java

@ -38,7 +38,7 @@ public class OAuth2BasicMapperConfig {
@Length(fieldName = "lastNameAttributeKey", max = 31)
@Schema(description = "Last name attribute key")
private final String lastNameAttributeKey;
@Schema(description = "Tenant naming strategy. For DOMAIN type, domain for tenant name will be taken from the email (substring before '@')", required = true)
@Schema(description = "Tenant naming strategy. For DOMAIN type, domain for tenant name will be taken from the email (substring before '@')", requiredMode = Schema.RequiredMode.REQUIRED)
private final TenantNameStrategyType tenantNameStrategy;
@Length(fieldName = "tenantNamePattern")
@Schema(description = "Tenant name pattern for CUSTOM naming strategy. " +

2
common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2ClientRegistrationTemplate.java

@ -36,7 +36,7 @@ import java.util.List;
public class OAuth2ClientRegistrationTemplate extends BaseDataWithAdditionalInfo<OAuth2ClientRegistrationTemplateId> implements HasName {
@Length(fieldName = "providerId")
@Schema(description = "OAuth2 provider identifier (e.g. its name)", required = true)
@Schema(description = "OAuth2 provider identifier (e.g. its name)", requiredMode = Schema.RequiredMode.REQUIRED)
private String providerId;
@Valid
@Schema(description = "Default config for mapping OAuth2 log in response to platform entities")

4
common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2DomainInfo.java

@ -31,8 +31,8 @@ import lombok.ToString;
@Builder
@Schema
public class OAuth2DomainInfo {
@Schema(description = "Domain scheme. Mixed scheme means than both HTTP and HTTPS are going to be used", required = true)
@Schema(description = "Domain scheme. Mixed scheme means than both HTTP and HTTPS are going to be used", requiredMode = Schema.RequiredMode.REQUIRED)
private SchemeType scheme;
@Schema(description = "Domain name. Cannot be empty", required = true)
@Schema(description = "Domain name. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private String name;
}

2
common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2Info.java

@ -37,6 +37,6 @@ public class OAuth2Info {
private boolean enabled;
@Schema(description = "Whether OAuth2 settings are enabled on Edge or not")
private boolean edgeEnabled;
@Schema(description = "List of configured OAuth2 clients. Cannot contain null values", required = true)
@Schema(description = "List of configured OAuth2 clients. Cannot contain null values", requiredMode = Schema.RequiredMode.REQUIRED)
private List<OAuth2ParamsInfo> oauth2ParamsInfos;
}

2
common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2MapperConfig.java

@ -32,7 +32,7 @@ public class OAuth2MapperConfig {
private boolean allowUserCreation;
@Schema(description = "Whether user credentials should be activated when user is created after successful authentication")
private boolean activateUser;
@Schema(description = "Type of OAuth2 mapper. Depending on this param, different mapper config fields must be specified", required = true)
@Schema(description = "Type of OAuth2 mapper. Depending on this param, different mapper config fields must be specified", requiredMode = Schema.RequiredMode.REQUIRED)
private MapperType type;
@Valid
@Schema(description = "Mapper config for BASIC and GITHUB mapper types")

4
common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2MobileInfo.java

@ -31,8 +31,8 @@ import lombok.ToString;
@Builder
@Schema
public class OAuth2MobileInfo {
@Schema(description = "Application package name. Cannot be empty", required = true)
@Schema(description = "Application package name. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private String pkgName;
@Schema(description = "Application secret. The length must be at least 16 characters", required = true)
@Schema(description = "Application secret. The length must be at least 16 characters", requiredMode = Schema.RequiredMode.REQUIRED)
private String appSecret;
}

6
common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2ParamsInfo.java

@ -36,11 +36,11 @@ public class OAuth2ParamsInfo {
@Schema(description = "List of configured domains where OAuth2 platform will redirect a user after successful " +
"authentication. Cannot be empty. There have to be only one domain with specific name with scheme type 'MIXED'. " +
"Configured domains with the same name must have different scheme types", required = true)
"Configured domains with the same name must have different scheme types", requiredMode = Schema.RequiredMode.REQUIRED)
private List<OAuth2DomainInfo> domainInfos;
@Schema(description = "Mobile applications settings. Application package name must be unique within the list", required = true)
@Schema(description = "Mobile applications settings. Application package name must be unique within the list", requiredMode = Schema.RequiredMode.REQUIRED)
private List<OAuth2MobileInfo> mobileInfos;
@Schema(description = "List of OAuth2 provider settings. Cannot be empty", required = true)
@Schema(description = "List of OAuth2 provider settings. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private List<OAuth2RegistrationInfo> clientRegistrations;
}

18
common/data/src/main/java/org/thingsboard/server/common/data/oauth2/OAuth2RegistrationInfo.java

@ -34,17 +34,17 @@ import java.util.List;
@Builder
@Schema
public class OAuth2RegistrationInfo {
@Schema(description = "Config for mapping OAuth2 log in response to platform entities", required = true)
@Schema(description = "Config for mapping OAuth2 log in response to platform entities", requiredMode = Schema.RequiredMode.REQUIRED)
private OAuth2MapperConfig mapperConfig;
@Schema(description = "OAuth2 client ID. Cannot be empty", required = true)
@Schema(description = "OAuth2 client ID. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private String clientId;
@Schema(description = "OAuth2 client secret. Cannot be empty", required = true)
@Schema(description = "OAuth2 client secret. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private String clientSecret;
@Schema(description = "Authorization URI of the OAuth2 provider. Cannot be empty", required = true)
@Schema(description = "Authorization URI of the OAuth2 provider. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private String authorizationUri;
@Schema(description = "Access token URI of the OAuth2 provider. Cannot be empty", required = true)
@Schema(description = "Access token URI of the OAuth2 provider. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private String accessTokenUri;
@Schema(description = "OAuth scopes that will be requested from OAuth2 platform. Cannot be empty", required = true)
@Schema(description = "OAuth scopes that will be requested from OAuth2 platform. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private List<String> scope;
@Schema(description = "User info URI of the OAuth2 provider")
private String userInfoUri;
@ -52,14 +52,14 @@ public class OAuth2RegistrationInfo {
private String userNameAttributeName;
@Schema(description = "JSON Web Key URI of the OAuth2 provider")
private String jwkSetUri;
@Schema(description = "Client authentication method to use: 'BASIC' or 'POST'. Cannot be empty", required = true)
@Schema(description = "Client authentication method to use: 'BASIC' or 'POST'. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private String clientAuthenticationMethod;
@Schema(description = "OAuth2 provider label. Cannot be empty", required = true)
@Schema(description = "OAuth2 provider label. Cannot be empty", requiredMode = Schema.RequiredMode.REQUIRED)
private String loginButtonLabel;
@Schema(description = "Log in button icon for OAuth2 provider")
private String loginButtonIcon;
@Schema(description = "List of platforms for which usage of the OAuth2 client is allowed (empty for all allowed)")
private List<PlatformType> platforms;
@Schema(description = "Additional info of OAuth2 client (e.g. providerName)", required = true)
@Schema(description = "Additional info of OAuth2 client (e.g. providerName)", requiredMode = Schema.RequiredMode.REQUIRED)
private JsonNode additionalInfo;
}

6
common/data/src/main/java/org/thingsboard/server/common/data/objects/AttributesEntityView.java

@ -31,11 +31,11 @@ import java.util.List;
@NoArgsConstructor
public class AttributesEntityView implements Serializable {
@Schema(required = true, description = "List of client-side attribute keys to expose", example = "currentConfiguration")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of client-side attribute keys to expose", example = "currentConfiguration")
private List<String> cs = new ArrayList<>();
@Schema(required = true, description = "List of server-side attribute keys to expose", example = "model")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of server-side attribute keys to expose", example = "model")
private List<String> ss = new ArrayList<>();
@Schema(required = true, description = "List of shared attribute keys to expose", example = "targetConfiguration")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of shared attribute keys to expose", example = "targetConfiguration")
private List<String> sh = new ArrayList<>();
public AttributesEntityView(List<String> cs,

4
common/data/src/main/java/org/thingsboard/server/common/data/objects/TelemetryEntityView.java

@ -31,9 +31,9 @@ import java.util.List;
@NoArgsConstructor
public class TelemetryEntityView implements Serializable {
@Schema(required = true, description = "List of time-series data keys to expose", example = "temperature, humidity")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of time-series data keys to expose", example = "temperature, humidity")
private List<String> timeseries;
@Schema(required = true, description = "JSON object with attributes to expose")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with attributes to expose")
private AttributesEntityView attributes;
public TelemetryEntityView(List<String> timeseries, AttributesEntityView attributes) {

2
common/data/src/main/java/org/thingsboard/server/common/data/rule/DefaultRuleChainCreateRequest.java

@ -28,7 +28,7 @@ public class DefaultRuleChainCreateRequest implements Serializable {
private static final long serialVersionUID = 5600333716030561537L;
@Schema(required = true, description = "Name of the new rule chain", example = "Root Rule Chain")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Name of the new rule chain", example = "Root Rule Chain")
private String name;
}

6
common/data/src/main/java/org/thingsboard/server/common/data/rule/NodeConnectionInfo.java

@ -24,10 +24,10 @@ import lombok.Data;
@Schema
@Data
public class NodeConnectionInfo {
@Schema(required = true, description = "Index of rule node in the 'nodes' array of the RuleChainMetaData. Indicates the 'from' part of the connection.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Index of rule node in the 'nodes' array of the RuleChainMetaData. Indicates the 'from' part of the connection.")
private int fromIndex;
@Schema(required = true, description = "Index of rule node in the 'nodes' array of the RuleChainMetaData. Indicates the 'to' part of the connection.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Index of rule node in the 'nodes' array of the RuleChainMetaData. Indicates the 'to' part of the connection.")
private int toIndex;
@Schema(required = true, description = "Type of the relation. Typically indicated the result of processing by the 'from' rule node. For example, 'Success' or 'Failure'")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Type of the relation. Typically indicated the result of processing by the 'from' rule node. For example, 'Success' or 'Failure'")
private String type;
}

4
common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChain.java

@ -39,11 +39,11 @@ public class RuleChain extends BaseDataWithAdditionalInfo<RuleChainId> implement
private static final long serialVersionUID = -5656679015121935465L;
@Schema(required = true, description = "JSON object with Tenant Id.", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with Tenant Id.", accessMode = Schema.AccessMode.READ_ONLY)
private TenantId tenantId;
@NoXss
@Length(fieldName = "name")
@Schema(required = true, description = "Rule Chain name", example = "Humidity data processing")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Rule Chain name", example = "Humidity data processing")
private String name;
@Schema(description = "Rule Chain type. 'EDGE' rule chains are processing messages on the edge devices only.", example = "A4B72CCDFF33")
private RuleChainType type;

8
common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainConnectionInfo.java

@ -26,12 +26,12 @@ import org.thingsboard.server.common.data.id.RuleChainId;
@Schema
@Data
public class RuleChainConnectionInfo {
@Schema(required = true, description = "Index of rule node in the 'nodes' array of the RuleChainMetaData. Indicates the 'from' part of the connection.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Index of rule node in the 'nodes' array of the RuleChainMetaData. Indicates the 'from' part of the connection.")
private int fromIndex;
@Schema(required = true, description = "JSON object with the Rule Chain Id.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with the Rule Chain Id.")
private RuleChainId targetRuleChainId;
@Schema(required = true, description = "JSON object with the additional information about the connection.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with the additional information about the connection.")
private JsonNode additionalInfo;
@Schema(required = true, description = "Type of the relation. Typically indicated the result of processing by the 'from' rule node. For example, 'Success' or 'Failure'")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Type of the relation. Typically indicated the result of processing by the 'from' rule node. For example, 'Success' or 'Failure'")
private String type;
}

4
common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainData.java

@ -24,8 +24,8 @@ import java.util.List;
@Data
public class RuleChainData {
@Schema(required = true, description = "List of the Rule Chain objects.", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of the Rule Chain objects.", accessMode = Schema.AccessMode.READ_ONLY)
List<RuleChain> ruleChains;
@Schema(required = true, description = "List of the Rule Chain metadata objects.", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of the Rule Chain metadata objects.", accessMode = Schema.AccessMode.READ_ONLY)
List<RuleChainMetaData> metadata;
}

10
common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainMetaData.java

@ -29,19 +29,19 @@ import java.util.List;
@Data
public class RuleChainMetaData {
@Schema(required = true, description = "JSON object with Rule Chain Id.", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with Rule Chain Id.", accessMode = Schema.AccessMode.READ_ONLY)
private RuleChainId ruleChainId;
@Schema(required = true, description = "Index of the first rule node in the 'nodes' list")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Index of the first rule node in the 'nodes' list")
private Integer firstNodeIndex;
@Schema(required = true, description = "List of rule node JSON objects")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of rule node JSON objects")
private List<RuleNode> nodes;
@Schema(required = true, description = "List of JSON objects that represent connections between rule nodes")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of JSON objects that represent connections between rule nodes")
private List<NodeConnectionInfo> connections;
@Schema(required = true, description = "List of JSON objects that represent connections between rule nodes and other rule chains.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of JSON objects that represent connections between rule nodes and other rule chains.")
private List<RuleChainConnectionInfo> ruleChainConnections;
public void addConnectionInfo(int fromIndex, int toIndex, String type) {

10
common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleChainOutputLabelsUsage.java

@ -28,16 +28,16 @@ import java.util.Set;
@Slf4j
public class RuleChainOutputLabelsUsage {
@Schema(required = true, description = "Rule Chain Id", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Rule Chain Id", accessMode = Schema.AccessMode.READ_ONLY)
private RuleChainId ruleChainId;
@Schema(required = true, description = "Rule Node Id", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Rule Node Id", accessMode = Schema.AccessMode.READ_ONLY)
private RuleNodeId ruleNodeId;
@Schema(required = true, description = "Rule Chain Name", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Rule Chain Name", accessMode = Schema.AccessMode.READ_ONLY)
private String ruleChainName;
@Schema(required = true, description = "Rule Node Name", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Rule Node Name", accessMode = Schema.AccessMode.READ_ONLY)
private String ruleNodeName;
@Schema(required = true, description = "Output labels", accessMode = Schema.AccessMode.READ_ONLY)
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Output labels", accessMode = Schema.AccessMode.READ_ONLY)
private Set<String> labels;
}

6
common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentials.java

@ -47,7 +47,7 @@ public class DeviceCredentials extends BaseData<DeviceCredentialsId> implements
this.credentialsValue = deviceCredentials.getCredentialsValue();
}
@Schema(required = true, accessMode = Schema.AccessMode.READ_ONLY, description = "The Id is automatically generated during device creation. " +
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, accessMode = Schema.AccessMode.READ_ONLY, description = "The Id is automatically generated during device creation. " +
"Use 'getDeviceCredentialsByDeviceId' to obtain the id based on device id. " +
"Use 'updateDeviceCredentials' to update device credentials. ", example = "784f394c-42b6-435a-983c-b7beff2784f9")
@Override
@ -61,7 +61,7 @@ public class DeviceCredentials extends BaseData<DeviceCredentialsId> implements
return super.getCreatedTime();
}
@Schema(required = true, description = "JSON object with the device Id.")
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "JSON object with the device Id.")
public DeviceId getDeviceId() {
return deviceId;
}
@ -80,7 +80,7 @@ public class DeviceCredentials extends BaseData<DeviceCredentialsId> implements
this.credentialsType = credentialsType;
}
@Schema(required = true, description = "Unique Credentials Id per platform instance. " +
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Unique Credentials Id per platform instance. " +
"Used to lookup credentials from the database. " +
"By default, new access token for your device. " +
"Depends on the type of the credentials."

30
common/data/src/main/java/org/thingsboard/server/common/data/sms/config/SmppSmsProviderConfiguration.java

@ -20,27 +20,27 @@ import lombok.Data;
@Data
public class SmppSmsProviderConfiguration implements SmsProviderConfiguration {
@Schema(description = "SMPP version", allowableValues = "3.3, 3.4", required = true)
@Schema(description = "SMPP version", allowableValues = "3.3, 3.4", requiredMode = Schema.RequiredMode.REQUIRED)
private String protocolVersion;
@Schema(description = "SMPP host", required = true)
@Schema(description = "SMPP host", requiredMode = Schema.RequiredMode.REQUIRED)
private String host;
@Schema(description = "SMPP port", required = true)
@Schema(description = "SMPP port", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer port;
@Schema(description = "System ID", required = true)
@Schema(description = "System ID", requiredMode = Schema.RequiredMode.REQUIRED)
private String systemId;
@Schema(description = "Password", required = true)
@Schema(description = "Password", requiredMode = Schema.RequiredMode.REQUIRED)
private String password;
@Schema(description = "System type", required = false)
@Schema(description = "System type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private String systemType;
@Schema(description = "TX - Transmitter, RX - Receiver, TRX - Transciever. By default TX is used", required = false)
@Schema(description = "TX - Transmitter, RX - Receiver, TRX - Transciever. By default TX is used", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private SmppBindType bindType;
@Schema(description = "Service type", required = false)
@Schema(description = "Service type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private String serviceType;
@Schema(description = "Source address", required = false)
@Schema(description = "Source address", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private String sourceAddress;
@Schema(description = "Source TON (Type of Number). Needed is source address is set. 5 by default.\n" +
"0 - Unknown\n" +
@ -49,7 +49,7 @@ public class SmppSmsProviderConfiguration implements SmsProviderConfiguration {
"3 - Network Specific\n" +
"4 - Subscriber Number\n" +
"5 - Alphanumeric\n" +
"6 - Abbreviated", required = false)
"6 - Abbreviated", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private Byte sourceTon;
@Schema(description = "Source NPI (Numbering Plan Identification). Needed is source address is set. 0 by default.\n" +
"0 - Unknown\n" +
@ -61,7 +61,7 @@ public class SmppSmsProviderConfiguration implements SmsProviderConfiguration {
"9 - Private numbering plan\n" +
"10 - ERMES numbering plan (ETSI DE/PS 3 01-3)\n" +
"13 - Internet (IP)\n" +
"18 - WAP Client Id (to be defined by WAP Forum)", required = false)
"18 - WAP Client Id (to be defined by WAP Forum)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private Byte sourceNpi;
@Schema(description = "Destination TON (Type of Number). 5 by default.\n" +
@ -71,7 +71,7 @@ public class SmppSmsProviderConfiguration implements SmsProviderConfiguration {
"3 - Network Specific\n" +
"4 - Subscriber Number\n" +
"5 - Alphanumeric\n" +
"6 - Abbreviated", required = false)
"6 - Abbreviated", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private Byte destinationTon;
@Schema(description = "Destination NPI (Numbering Plan Identification). 0 by default.\n" +
"0 - Unknown\n" +
@ -83,10 +83,10 @@ public class SmppSmsProviderConfiguration implements SmsProviderConfiguration {
"9 - Private numbering plan\n" +
"10 - ERMES numbering plan (ETSI DE/PS 3 01-3)\n" +
"13 - Internet (IP)\n" +
"18 - WAP Client Id (to be defined by WAP Forum)", required = false)
"18 - WAP Client Id (to be defined by WAP Forum)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private Byte destinationNpi;
@Schema(description = "Address range", required = false)
@Schema(description = "Address range", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private String addressRange;
@Schema(allowableValues = "0-10,13-14",
@ -102,7 +102,7 @@ public class SmppSmsProviderConfiguration implements SmsProviderConfiguration {
"9 - Pictogram Encoding\n" +
"10 - Music Codes (ISO-2022-JP)\n" +
"13 - Extended Kanji JIS (X 0212-1990)\n" +
"14 - Korean Graphic Character Set (KS C 5601/KS X 1001)", required = false)
"14 - Korean Graphic Character Set (KS C 5601/KS X 1001)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private Byte codingScheme;
@Override

Loading…
Cancel
Save