class NetsparkerAdapterV1 extends AbstractAdapter<NetsparkerAdapterContext, NetsparkerAdapterConfig> implements NetsparkerAdapter {

	String buildJsonForCreateNewScan(JSONAdapterSupport jsonAdapterSupport, NetsparkerAdapterConfig config) throws AdapterException {
		Map<String, Object> map = new TreeMap<>();
		map.put(TARGET_URI, config.getTargetAsString());
		if (config.hasAgentGroup()) {
			map.put(AGENT_GROUP_NAME, config.getAgentGroupName());
		} else {
			map.put(AGENT_NAME, config.getAgentName());
		}
		map.put(POLICY_ID, config.getPolicyId());

		webLoginSupport.addAuthorizationInfo(config, map);

		String jsonAsString = jsonAdapterSupport.toJSON(map);
		return jsonAsString;
	}

}