code: public String resource_to_string(base_resource resources[], options option)
  	{
  		String objecttype = resources[0].get_object_type();
  		String request = "{";
  
  		if (option != null && option.get_action() != null)
  			request = request + "\"params\": {\"action\": \"" + option.get_action() + "\"},";
  
  		request = request + "\"" + objecttype + "\":[";
  		for (int i = 0; i < resources.length ; i++)
  		{
  			String str = this.resource_to_string(resources[i]);
  			request = request + str + ",";
  		}
  		request = request + "]}";
  		return request;
  	}
docs: Converts NetScaler SDX resources to Json string.
  @param resources API resources.
  @param option options class object.
  @return returns a String