| POST | /v4/collections |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
@DataContract
public static class PostCollectionRequest extends V4BaseRequest implements IPostCollectionRequest
{
@DataMember(Name="title")
@SerializedName("title")
public String title = null;
@DataMember(Name="linkIds")
@SerializedName("linkIds")
public ArrayList<String> linkIds = null;
@DataMember(Name="collectionSettingsId")
@SerializedName("collectionSettingsId")
public String collectionSettingsId = null;
public String getTitle() { return title; }
public PostCollectionRequest setTitle(String value) { this.title = value; return this; }
public ArrayList<String> getLinkIds() { return linkIds; }
public PostCollectionRequest setLinkIds(ArrayList<String> value) { this.linkIds = value; return this; }
public String getCollectionSettingsId() { return collectionSettingsId; }
public PostCollectionRequest setCollectionSettingsId(String value) { this.collectionSettingsId = value; return this; }
}
@DataContract
public static class V4BaseRequest
{
}
@DataContract
public static class PostCollectionResponse extends V4BaseResponse implements IPostCollectionResponse
{
@DataMember(Name="data")
@SerializedName("data")
public IPostCollectionResponseData data = null;
public IPostCollectionResponseData getData() { return data; }
public PostCollectionResponse setData(IPostCollectionResponseData value) { this.data = value; return this; }
}
@DataContract
public static class V4BaseResponse
{
@DataMember(Name="status")
@SerializedName("status")
public ResponseStatus responseStatus = null;
public ResponseStatus getResponseStatus() { return responseStatus; }
public V4BaseResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
public static interface IPostCollectionResponseData
{
public String id = null;
}
}
Java PostCollectionRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v4/collections HTTP/1.1
Host: collections-api-zane.dev.platform.georiot.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
title: String,
collectionSettingsId: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
status:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}