1
- package com.ctrlhub.core.governance.schemes.workorders. operations
1
+ package com.ctrlhub.core.governance.operations
2
2
3
3
import com.ctrlhub.core.Api
4
4
import com.ctrlhub.core.api.response.PaginatedList
5
- import com.ctrlhub.core.governance.schemes. workorders.WorkOrdersRouter
6
- import com.ctrlhub.core.governance.schemes.workorders. operations.response.Operation
5
+ import com.ctrlhub.core.governance.workorders.WorkOrdersRouter
6
+ import com.ctrlhub.core.governance.operations.response.Operation
7
7
import com.ctrlhub.core.iam.response.User
8
8
import com.ctrlhub.core.router.Router
9
+ import com.ctrlhub.core.router.request.AbstractRequestParameters
10
+ import com.ctrlhub.core.router.request.FilterOption
11
+ import com.ctrlhub.core.router.request.RequestParameters
9
12
import io.ktor.client.HttpClient
10
13
11
14
class OperationsRouter (httpClient : HttpClient ) : Router(httpClient) {
@@ -14,13 +17,11 @@ class OperationsRouter(httpClient: HttpClient) : Router(httpClient) {
14
17
* Retrieve a list of all operations
15
18
*
16
19
* @param organisationId String The organisation ID to retrieve all operations for
17
- * @param schemeId String The scheme ID to retrieve all operations for
18
- * @param workOrderId String The work order ID to retreive all operations for
19
20
*
20
21
* @return A list of all operations
21
22
*/
22
- suspend fun all (organisationId : String , schemeId : String , workOrderId : String ): PaginatedList <Operation > {
23
- val endpoint = " /v3/orgs/$organisationId /governance/schemes/ $schemeId /work-orders/ $workOrderId /operations"
23
+ suspend fun all (organisationId : String , requestParameters : RequestParameters = RequestParameters () ): PaginatedList <Operation > {
24
+ val endpoint = " /v3/orgs/$organisationId /projects /operations"
24
25
25
26
return fetchPaginatedJsonApiResources(endpoint, emptyMap(), Operation ::class .java, User ::class .java)
26
27
}
@@ -29,14 +30,12 @@ class OperationsRouter(httpClient: HttpClient) : Router(httpClient) {
29
30
* Retrieve a single operation
30
31
*
31
32
* @param organisationId String The organisation ID to retrieve all operations for
32
- * @param schemeId String The scheme ID to retrieve all operations for
33
- * @param workOrderId String The work order ID to retrieve all operations for
34
33
* @param operationId String The operation ID to retrieve data for
35
34
*
36
35
* @return A list of all operations
37
36
*/
38
- suspend fun one (organisationId : String , schemeId : String , workOrderId : String , operationId : String ): Operation {
39
- val endpoint = " /v3/orgs/$organisationId /governance/schemes/ $schemeId /work-orders/ $workOrderId /operations/$operationId "
37
+ suspend fun one (organisationId : String , operationId : String ): Operation {
38
+ val endpoint = " /v3/orgs/$organisationId /projects /operations/$operationId "
40
39
41
40
return fetchJsonApiResource(endpoint, emptyMap(), Operation ::class .java, User ::class .java)
42
41
}
0 commit comments