| PUT | /api/importdata |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* Import entity data into DigiOffice (v1)
*/
@Api(Description="Import entity data into DigiOffice (v1)")
public static class ImportData
{
/**
* Entityname in which the data will be imported
*/
@ApiMember(Description="Entityname in which the data will be imported", IsRequired=true)
public String EntityType = null;
/**
* Reports errors with a reference to this field (for example ID)
*/
@ApiMember(Description="Reports errors with a reference to this field (for example ID)")
public String ErrorField = null;
/**
* Should import continue on errors? (Default true)
*/
@ApiMember(Description="Should import continue on errors? (Default true)")
public Boolean ContinueOnError = null;
/**
* Rows to be imported
*/
@ApiMember(Description="Rows to be imported", IsRequired=true)
public ArrayList<Row> Rows = new ArrayList<Row>();
/**
* Additional values to be imported on every row
*/
@ApiMember(Description="Additional values to be imported on every row")
public ArrayList<FixedValue> FixedValues = null;
public String getEntityType() { return EntityType; }
public ImportData setEntityType(String value) { this.EntityType = value; return this; }
public String getErrorField() { return ErrorField; }
public ImportData setErrorField(String value) { this.ErrorField = value; return this; }
public Boolean isContinueOnError() { return ContinueOnError; }
public ImportData setContinueOnError(Boolean value) { this.ContinueOnError = value; return this; }
public ArrayList<Row> getRows() { return Rows; }
public ImportData setRows(ArrayList<Row> value) { this.Rows = value; return this; }
public ArrayList<FixedValue> getFixedValues() { return FixedValues; }
public ImportData setFixedValues(ArrayList<FixedValue> value) { this.FixedValues = value; return this; }
}
public static class Row
{
public ArrayList<ImportField> Fields = null;
public ArrayList<ImportField> getFields() { return Fields; }
public Row setFields(ArrayList<ImportField> value) { this.Fields = value; return this; }
}
public static class ImportField
{
public String Name = null;
public String Value = null;
public String getName() { return Name; }
public ImportField setName(String value) { this.Name = value; return this; }
public String getValue() { return Value; }
public ImportField setValue(String value) { this.Value = value; return this; }
}
public static class FixedValue
{
public String Name = null;
public String Value = null;
public String getName() { return Name; }
public FixedValue setName(String value) { this.Name = value; return this; }
public String getValue() { return Value; }
public FixedValue setValue(String value) { this.Value = value; return this; }
}
public static class ImportResult
{
public Integer TotalRows = null;
public Integer TotalAdded = null;
public Integer TotalUpdated = null;
public Integer SuccesfullRows = null;
public Integer ErrorRows = null;
public ArrayList<String> Errors = null;
public Integer getTotalRows() { return TotalRows; }
public ImportResult setTotalRows(Integer value) { this.TotalRows = value; return this; }
public Integer getTotalAdded() { return TotalAdded; }
public ImportResult setTotalAdded(Integer value) { this.TotalAdded = value; return this; }
public Integer getTotalUpdated() { return TotalUpdated; }
public ImportResult setTotalUpdated(Integer value) { this.TotalUpdated = value; return this; }
public Integer getSuccesfullRows() { return SuccesfullRows; }
public ImportResult setSuccesfullRows(Integer value) { this.SuccesfullRows = value; return this; }
public Integer getErrorRows() { return ErrorRows; }
public ImportResult setErrorRows(Integer value) { this.ErrorRows = value; return this; }
public ArrayList<String> getErrors() { return Errors; }
public ImportResult setErrors(ArrayList<String> value) { this.Errors = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /api/importdata HTTP/1.1
Host: test-do-services.klokgroep.nl
Accept: application/json
Content-Type: application/json
Content-Length: length
{"EntityType":"String","ErrorField":"String","ContinueOnError":false,"Rows":[{"Fields":[{"Name":"String","Value":"String"}]}],"FixedValues":[{"Name":"String","Value":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"TotalRows":0,"TotalAdded":0,"TotalUpdated":0,"SuccesfullRows":0,"ErrorRows":0,"Errors":["String"]}