Skip to content

Commit

Permalink
Merge pull request #4124 from Agnul97/feature-appId_deviceManagementO…
Browse files Browse the repository at this point in the history
…perations_query

🎉 Capability to search operations by their appId in API 'GET /{scopeId}/devices/{deviceId}/operations'
  • Loading branch information
Coduz authored Oct 31, 2024
2 parents 2e475a1 + d9ee177 commit 6eba56b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public DeviceManagementOperationListResult simpleQuery(
@PathParam("scopeId") ScopeId scopeId,
@PathParam("deviceId") EntityId deviceId,
@QueryParam("resource") String resource,
@QueryParam("appId") String appId,
@QueryParam("status") DeviceManagementOperationStatus operationStatus,
@QueryParam("askTotalCount") boolean askTotalCount,
@QueryParam("sortParam") String sortParam,
Expand All @@ -89,6 +90,10 @@ public DeviceManagementOperationListResult simpleQuery(
andPredicate.and(query.attributePredicate(DeviceManagementOperationAttributes.STATUS, operationStatus));
}

if (!Strings.isNullOrEmpty(appId)) {
andPredicate.and(query.attributePredicate(DeviceManagementOperationAttributes.APP_ID, appId));
}

if (!Strings.isNullOrEmpty(sortParam)) {
query.setSortCriteria(query.fieldSortCriteria(sortParam, sortDir));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ paths:
description: The resource of the DeviceManagementOperation in which to search results
schema:
type: string
- name: appId
in: query
description: The appId of the DeviceManagementOperation in which to search results
schema:
type: string
- $ref: '../deviceOperation/deviceOperation.yaml#/components/parameters/status'
- $ref: '../openapi.yaml#/components/parameters/askTotalCount'
- $ref: '../openapi.yaml#/components/parameters/sortParam'
Expand Down

0 comments on commit 6eba56b

Please sign in to comment.