I'm trying to extract the json response to a case class in my project, but I'm getting an error stating:
Error Message is : No usable value for httpCode Did not find value which can be converted into int
This happens If I call to the API and extract that, but when I explicitly set the json response to a json parser and when I extracted them, they did work well.
My json response is:
{
"httpCode": 200,
"statusCode": "S_QUERY_1000",
"description": "Operation successful",
"data": [
{
"id": "5de0e1b3b2613f221986ff79",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "DOOR_OPEN",
"deviceLabel": "Door Sensor 2",
"locationLabel": "Support",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575018930989-6611da04-e2fa-4402-b16a-09c8ad8be2d5"
},
{
"type": "IVR",
"id": "48eb911aa838b54a96e6402947c48db4"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T09:15:31.027Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": "2020-01-21T12:16:21.445+08:00",
"updatedDateTime": "2020-01-21T12:16:21.923+08:00",
"status": "PROCESSING"
},
{
"id": "5de0dcf7b2613f221986ff78",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "MOTION_DETECTED",
"deviceLabel": "Tri-Sensor 1",
"locationLabel": "Lunch Room",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017719760-53662549-d482-4759-94d7-5ec7fdb29309"
},
{
"type": "IVR",
"id": "a76d9424328efc7084add0cc46bcaa28"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:55:19.807Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:58:23.775Z",
"status": "PROCESSING"
},
{
"id": "5de0dc4bb2613f221986ff77",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "DOOR_OPEN",
"deviceLabel": "Door Sensor 3",
"locationLabel": "Home",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017547742-d018d984-ed70-4fda-9458-8d84288fca00"
},
{
"type": "IVR",
"id": "8896fee125ed12d9cfbc3de07d3dbc6a"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:52:27.803Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:55:29.705Z",
"status": "PROCESSING"
},
{
"id": "5de0dc36b2613f221986ff76",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "DOOR_OPEN",
"deviceLabel": "Door Sensor 2",
"locationLabel": "Support",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017526822-87d03515-21ca-45d4-b3f9-f12988a4a5b5"
},
{
"type": "IVR",
"id": "d10ab1e5cc802e6367989b9e29840e32"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:52:06.857Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:55:08.682Z",
"status": "PROCESSING"
},
{
"id": "5de0dbdab2613f221986ff75",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "MOTION_DETECTED",
"deviceLabel": "Tri-Sensor 1",
"locationLabel": "Lunch Room",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017434604-19461ead-3b17-4648-bc70-d01ec8c113a5"
},
{
"type": "IVR",
"id": "289d0495bcc937ab30000a8c0c2253f3"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:50:34.635Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:53:35.641Z",
"status": "PROCESSING"
},
{
"id": "5de0db0cb2613f221986ff74",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "MOTION_DETECTED",
"deviceLabel": "Tri-Sensor 5",
"locationLabel": "Lobby",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017228218-85607147-9414-40d7-b7dc-e4e7acd717db"
},
{
"type": "IVR",
"id": "6cef5f5fde5f3209d845390db04bc402"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:47:08.284Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:50:11.561Z",
"status": "PROCESSING"
},
{
"id": "5de0db09b2613f221986ff73",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "DOOR_OPEN",
"deviceLabel": "Door Sensor 2",
"locationLabel": "Support",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017225719-cd828cfb-2570-4e9d-a60e-e0714a14830b"
},
{
"type": "IVR",
"id": "9c30bf0ea2ed111788f72fdef8b3e295"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:47:05.755Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:50:08.541Z",
"status": "PROCESSING"
},
{
"id": "5de0da9bb2613f221986ff72",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "DOOR_OPEN",
"deviceLabel": "Door Sensor 2",
"locationLabel": "Support",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017115516-15600a8b-f387-46c7-8aa8-6c2575c0ab42"
},
{
"type": "IVR",
"id": "41e45e6f791bee847e73ff083fce43c5"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:45:15.547Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:48:17.485Z",
"status": "PROCESSING"
},
{
"id": "5de0da5ab2613f221986ff71",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "DOOR_OPEN",
"deviceLabel": "Door Sensor 2",
"locationLabel": "Support",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017050570-97586921-28d7-447d-b237-53e62e2f9c2c"
},
{
"type": "IVR",
"id": "1aa425cb42031e9f2eb028cb8ec16aed"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:44:10.655Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:47:14.454Z",
"status": "PROCESSING"
},
{
"id": "5de0da4bb2613f221986ff70",
"serial": "36c51161f820c2bc5c5bb83ee08881bb",
"type": "DOOR_OPEN",
"deviceLabel": "Door Sensor 2",
"locationLabel": "Support",
"notificationIds": [
{
"type": "FIREBASE",
"id": "1575017035919-35b2b84f-f11d-4bd3-9ce1-0a094cb57c8c"
},
{
"type": "IVR",
"id": "89c98b5781bd3e8df415230fc9ce19c5"
}
],
"acknowledgedBy": null,
"acknowledgmentType": null,
"acknowledgedDeviceLabel": null,
"reason": null,
"description": null,
"processor": "alt_p_01",
"initiatedDateTime": "2019-11-29T08:43:55.956Z",
"acknowledgedDateTime": null,
"sirenOnTime": null,
"sirenOffTime": null,
"updatedDateTime": "2019-11-29T08:46:59.435Z",
"status": "PROCESSING"
}
],
"meta": {
"currentPage": 1,
"nextPage": 2,
"numOfPages": 244,
"previousPage": 0
}
}
My case classes to handle this json response are:
case class Alerts(httpCode: String, statusCode: String, description: String, data: List[Data])
case class Data(id: String, serial: String, `type`: String, deviceLabel: String, locationLabel: String, notificationIds: List[NotificationIds]
, acknowledgedBy: String, acknowledgmentType: String, acknowledgedDeviceLabel: String, reason: String, description: String
, processor: String, initiatedDateTime: String, acknowledgedDateTime: String, sirenOnTime: String, sirenOffTime: String,
updatedDateTime: String, status: String)
case class NotificationIds(`type`: String, id: String)
The way I extract this is:
implicit val format = DefaultFormats
//this api cal returns the response I stated above
val url = ServerConfigs.thingHttpHost+ServerConfigs.thingPathForActiveAlerts+serial
val jsonResponse = scala.io.Source.fromURL(url).mkString
val resData = jsonResponse.extract[Alerts]
Please assist.
I would say that you have inconsistency there. As error message tells you, you are sending integer "httpCode": 200, but in case class, you expect String httpCode:String. Just change it to httpCode:Int and you are good to go.
Related
I have a DataResponseDto.json
{
"data": [
{
"customRule": {
"code": null,
"executionType": "ON_SUCCESS",
"description": "Description",
"owners": null,
"type": "TWO",
"enabled": true,
"objectType": "TEST",
"syncObjectKPIs": null,
"inactive": false,
"responsible": null,
"id": "0AB58A47D3A64B56A6B74DA0E66935DD",
"embedded": true,
"value": null,
"variables": [],
"kafkaEventName": null,
"lastChanged": 1530091858490,
"createPerson": null,
"externalId": null,
"groups": null,
"eventType": "UPDATE",
"branches": null,
"executionOrder": null,
"createDateTime": null,
"cronExpression": null,
"udfMetaGroups": null,
"name": "Sample1",
"location": null,
"permissionsType": "USER",
"udfValues": null,
"conditions": null,
"actions": [
{
"name": "ChecklistInstance",
"parameters": {
"templateName": "checklist"
}
}
],
"syncStatus": "IN_CLOUD",
"executionLog": []
},
"customRule": {
"code": null,
"executionType": "ON_SUCCESS",
"description": "Description",
"owners": null,
"type": "TWO",
"enabled": true,
"objectType": "TEST",
"syncObjectKPIs": null,
"inactive": false,
"responsible": null,
"id": "5033296D138C45C385AC141E1157B4FE",
"embedded": true,
"value": null,
"variables": [],
"kafkaEventName": null,
"lastChanged": 1530091858490,
"createPerson": null,
"externalId": null,
"groups": null,
"eventType": "UPDATE",
"branches": null,
"executionOrder": null,
"createDateTime": null,
"cronExpression": null,
"udfMetaGroups": null,
"name": "Sample2",
"location": null,
"permissionsType": "USER",
"udfValues": null,
"conditions": null,
"actions": [
{
"name": "ChecklistInstance",
"parameters": {
"templateName": "checklist"
}
}
],
"syncStatus": "IN_CLOUD",
"executionLog": []
}
}],
"pageSize": 1,
"currentPage": 0,
"lastPage": 0,
"totalObjectCount": 1,
"truncated": false
}
And I have a class to map this JSON file.
public class DataResponseDto {
private List<Map> data;
private Integer pageSize;
private Integer currentPage;
private Integer lastPage;
private Long totalObjectCount;
private Boolean truncated;
// getter setter
...
}
Now I am using ObjectMapper to parse this JSON into a java class. It retrieved DataResponseDto with only 1 map in data. It should be 2 maps in data.
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
File file = new File(classLoader.getResource("mock/DataResponseDto.json").getFile());
ObjectMapper mapper = new ObjectMapper();
DataResponseDto dataResponseDto = mapper.readValue(file, DataResponseDto.class);
List<RuleDto> rules = dataResponseDto.getData().stream().map(m -> mapper.convertValue(m.get("customRule"), RuleDto.class)).collect(Collectors.toList());
I am getting rules.size() = 1, it should be 2
Your problem is with the private List<Map> data;
Map cannot have duplicate keys, consider using something else such as MultiKeyMap from apache commons (org.apache.commons.collections.map.MultiKeyMap).
You have duplicate keys customRule. Try to make customRules an array with the rules and re-run the code.
{
"parentWinnerInactivePartyID": "",
"childMergeLoserPartyID": "",
"eventType": "M&A",
"startData": "2020-01-03",
"endDate": null,
"eventDate": "01-03-2020 08:09:14",
"status": null,
"mnaID": "1",
"newMNAendDate": null,
"createdBy": "abcd"
}
I have another field called transactionKey and I want to send only for certain eventTypes. How do I modify the request accordingly. What do I need to define in my POJO class?
My POST request would be something like,
{
"parentWinnerInactivePartyID": "",
"childMergeLoserPartyID": "",
"eventType": "M&A Redo",
"startData": "2020-01-03",
"endDate": null,
"eventDate": "01-03-2020 08:09:14",
"status": null,
"mnaID": "1",
"newMNAendDate": null,
"createdBy": "abcd",
"transactionKey": "Andsf1234"
}
I would like to merge all the below objects as a single object recursively. Every time I run the code for every iteration I receive a string object, I am storing them in a list. List looks like below:
bean [String1, String2, String3]. These three strings are to be merged as a single string object.
String1:
[code=100,
response=
{
"testObjects": [
{
"updated": [
{
"attributes": {},
"id": "123"
},
{
"attributes": {},
"id": "456"
}
],
"timeCheckQuery": null,
"query": null,
"message": null,
"error": null,
"deleted": null,
"agentId": null,
"added": null
}
],
"message": null,
"error": null
}
]
String2:
[code=100,
response=
{
"testObjects": [
{
"updated": [
{
"attributes": {},
"id": "789"
},
{
"attributes": {},
"id": "759"
}
],
"timeCheckQuery": null,
"query": null,
"message": null,
"error": null,
"deleted": null,
"agentId": null,
"added": null
}
],
"message": null,
"error": null
}
]
String3:
[code=100,
response=
{
"testObjects": [
{
"updated": [
{
"attributes": {},
"id": "242"
},
{
"attributes": {},
"id": "951"
}
],
"timeCheckQuery": null,
"query": null,
"message": null,
"error": null,
"deleted": null,
"agentId": null,
"added": null
}
],
"message": null,
"error": null
}
]
output:
[code=300,
response=
{
"testObjects": [
{
"updated": [
{
"attributes": {},
"id": "123"
},
{
"attributes": {},
"id": "456"
},
{
"attributes": {},
"id": "789"
},
{
"attributes": {},
"id": "759"
},
{
"attributes": {},
"id": "242"
},
{
"attributes": {},
"id": "951"
}
],
"timeCheckQuery": null,
"query": null,
"message": null,
"error": null,
"deleted": null,
"agentId": null,
"added": null
}
],
"message": null,
"error": null
}
]
You could serialize the first object as a json string, then append that string with next object serialized and so on.
The value of the 'updated' field seems to be a JsonArray Structure.
What you have to do is have a Global Array that adds the values(value of the 'updated' field) from all the responses into a single JsonArray.
Using Gson Library you can do it as follows
JsonArray jsonarray = new JsonArray();
jsonarray.addAll(jsonObject1.get("updated").getAsJsonArray());
jsonarray.addAll(jsonObject2.get("updated").getAsJsonArray());
jsonarray.addAll(jsonObject2.get("updated").getAsJsonArray());
Now you can use this JsonArray inside any object as you need as your requirement needs.
I am trying to implement REST API for Fortify Software Security Center using Java. I am able to obtain
1)token by using following url
http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/auth/obtain_token
response for above URL as below
{
"data": {
"token": "NDIxMjE0NjUtOGIwNy00ZjFiLWEzMTUtZjZkYTg0MWY1Zjgz",
"creationDate": "2016-09-14T05:49:34.000+0000",
"terminalDate": "2016-09-15T05:49:34.000+0000"
},
"responseCode": 200
}
and
2)get list of reports using following URL
http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports
response for above URL as below
{
"data": [
{
"note": "",
"_href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/17",
"formatDefaultText": "PDF",
"projects": [
{
"id": 16,
"name": "Project 1",
"versions": [
{
"id": 30,
"name": "1.0",
"developmentPhase": "New"
}
]
}
],
"authEntity": {
"id": 2,
"userName": "AAA",
"firstName": "AAA",
"lastName": "AAA"
},
"isPublished": false,
"format": "PDF",
"generationDate": "2016-08-03T10:56:46.000+0000",
"statusDefaultText": "Processing Complete",
"reportDefinitionId": null,
"type": "ISSUE",
"typeDefaultText": "Issue Reports",
"inputReportParameters": null,
"name": "Project 1",
"id": 17,
"status": "PROCESS_COMPLETE"
},
{
"note": "",
"_href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/22",
"formatDefaultText": "PDF",
"projects": [
{
"id": 16,
"name": "Project 2",
"versions": [
{
"id": 30,
"name": "1.0",
"developmentPhase": "New"
}
]
}
],
"authEntity": {
"id": 10,
"userName": "BBB",
"firstName": "BBB",
"lastName": "BBB"
},
"isPublished": false,
"format": "PDF",
"generationDate": "2016-08-24T13:45:30.000+0000",
"statusDefaultText": "Processing Complete",
"reportDefinitionId": null,
"type": "ISSUE",
"typeDefaultText": "Issue Reports",
"inputReportParameters": null,
"name": "Project 2",
"id": 22,
"status": "PROCESS_COMPLETE"
},
{
"note": "",
"_href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/41",
"formatDefaultText": "PDF",
"projects": [
{
"id": 2,
"name": "Project 3",
"versions": [
{
"id": 3,
"name": "1.0",
"developmentPhase": "Active Development"
}
]
}
],
"authEntity": {
"id": 10,
"userName": "CCC",
"firstName": "CCC",
"lastName": "CCC"
},
"isPublished": false,
"format": "PDF",
"generationDate": "2016-08-25T16:56:22.000+0000",
"statusDefaultText": "Processing Complete",
"reportDefinitionId": null,
"type": "ISSUE",
"typeDefaultText": "Issue Reports",
"inputReportParameters": null,
"name": "Project 3",
"id": 41,
"status": "PROCESS_COMPLETE"
},
{
"note": "",
"_href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/57",
"formatDefaultText": "XLS",
"projects": [
{
"id": 2,
"name": "Project 4",
"versions": [
{
"id": 3,
"name": "1.0",
"developmentPhase": "Active Development"
}
]
}
],
"authEntity": {
"id": 11,
"userName": "DDD",
"firstName": "DDD",
"lastName": "DDD"
},
"isPublished": false,
"format": "XLS",
"generationDate": "2016-09-09T15:46:22.000+0000",
"statusDefaultText": "Processing Complete",
"reportDefinitionId": null,
"type": "ISSUE",
"typeDefaultText": "Issue Reports",
"inputReportParameters": null,
"name": "Project 4",
"id": 57,
"status": "PROCESS_COMPLETE"
}
],
"count": 4,
"responseCode": 200,
"links": {
"last": {
"href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/?start=0"
},
"first": {
"href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/?start=0"
}
}
}
But I didn't find any end point URL to download the saved reports. Can you please help me to get the end point URL or provide reference API document for HP fortify Software Security Center.
I know this is kind of an old post but just ran into the issue myself and found the solution.
First you have to request a file token as a HTTPPost:
http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/fileTokens
with:
{"fileTokenType": "REPORT_FILE"}
in the request body.
This will return a unique id that you will use to fetch your report.
Next you will make another get request like such:
http://xxx.xxx.xxx.xxx:8080/ssc/transfer/reportDownload.html?mat=[file_token]&id=[project_id]
you will replace the [file_token] with the token returned from the above post and [project_id] with the project you want to download the report for.
so for example:
http://xxx.xxx.xxx.xxx:8080/ssc/transfer/reportDownload.html?mat=7e8d912e-2432-6496-3232-709b05513bf2&id=1
This will return the binary data that you can then save to a file. The file type is specified in the report data as "format"
I'm using Atlassian Confluence REST API. I need to get Space permissions. I couldn't find any info on it in the documentation.
Does anyone know how to get these permissions?
I can see virtually no documentation about this, however having looked at the Confluence REST API Browser, I've got a working example below. You have to be a Confluence admin, or space admin for the space...
POST: http://localhost:1990/confluence/rpc/json-rpc/confluenceservice-v2/getSpacePermissionSets
BODY: [ "ds" ]
RESPONSE:
[
{
"type": "SETSPACEPERMISSIONS",
"spacePermissions": [
{
"type": "SETSPACEPERMISSIONS",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "EXPORTSPACE",
"spacePermissions": [
{
"type": "EXPORTSPACE",
"userName": null,
"groupName": null
},
{
"type": "EXPORTSPACE",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "EXPORTSPACE",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "SETPAGEPERMISSIONS",
"spacePermissions": [
{
"type": "SETPAGEPERMISSIONS",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "SETPAGEPERMISSIONS",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "REMOVEMAIL",
"spacePermissions": [
{
"type": "REMOVEMAIL",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "REMOVEMAIL",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "REMOVEMAIL",
"userName": null,
"groupName": null
}
]
},
{
"type": "REMOVEBLOG",
"spacePermissions": [
{
"type": "REMOVEBLOG",
"userName": null,
"groupName": null
},
{
"type": "REMOVEBLOG",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "REMOVEBLOG",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "EXPORTPAGE",
"spacePermissions": [
{
"type": "EXPORTPAGE",
"userName": null,
"groupName": null
},
{
"type": "EXPORTPAGE",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "EXPORTPAGE",
"userName": null,
"groupName": "confluence-users"
}
]
},
{
"type": "REMOVEATTACHMENT",
"spacePermissions": [
{
"type": "REMOVEATTACHMENT",
"userName": null,
"groupName": null
},
{
"type": "REMOVEATTACHMENT",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "REMOVEATTACHMENT",
"userName": null,
"groupName": "confluence-users"
}
]
},
{
"type": "CREATEATTACHMENT",
"spacePermissions": [
{
"type": "CREATEATTACHMENT",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "CREATEATTACHMENT",
"userName": null,
"groupName": null
},
{
"type": "CREATEATTACHMENT",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "VIEWSPACE",
"spacePermissions": [
{
"type": "VIEWSPACE",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "VIEWSPACE",
"userName": null,
"groupName": null
},
{
"type": "VIEWSPACE",
"userName": null,
"groupName": "confluence-users"
}
]
},
{
"type": "EDITBLOG",
"spacePermissions": [
{
"type": "EDITBLOG",
"userName": null,
"groupName": null
},
{
"type": "EDITBLOG",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "EDITBLOG",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "REMOVEPAGE",
"spacePermissions": [
{
"type": "REMOVEPAGE",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "REMOVEPAGE",
"userName": null,
"groupName": null
},
{
"type": "REMOVEPAGE",
"userName": null,
"groupName": "confluence-users"
}
]
},
{
"type": "REMOVECOMMENT",
"spacePermissions": [
{
"type": "REMOVECOMMENT",
"userName": null,
"groupName": null
},
{
"type": "REMOVECOMMENT",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "REMOVECOMMENT",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "EDITSPACE",
"spacePermissions": [
{
"type": "EDITSPACE",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "EDITSPACE",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "EDITSPACE",
"userName": null,
"groupName": null
}
]
},
{
"type": "COMMENT",
"spacePermissions": [
{
"type": "COMMENT",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "COMMENT",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "COMMENT",
"userName": null,
"groupName": null
}
]
}
]
It's using the old JSON-RPC REST APIs which have been deprecated and will eventually be replaced. But when they are replaced, you can refactor, right?