| GET | /api/object/{ObjectId}/reads |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* Get reads (object access) for the specified object.
*/
@Api(Description="Get reads (object access) for the specified object.")
public static class GetObjectReads
{
/**
* Object Id to get object access reads for
*/
@ApiMember(DataType="Guid", Description="Object Id to get object access reads for", IsRequired=true, Name="ObjectId")
public UUID ObjectId = null;
public UUID getObjectId() { return ObjectId; }
public GetObjectReads setObjectId(UUID value) { this.ObjectId = value; return this; }
}
@ApiResponse(Description="Returns the reads (object access) to the specified object.")
public static class GetObjectReadsResponse
{
public ArrayList<ObjectAccessModel> ObjectReads = null;
public ResponseStatus ResponseStatus = null;
public ArrayList<ObjectAccessModel> getObjectReads() { return ObjectReads; }
public GetObjectReadsResponse setObjectReads(ArrayList<ObjectAccessModel> value) { this.ObjectReads = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public GetObjectReadsResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class ObjectAccessModel
{
/**
* Object Access Read Id.
*/
@ApiMember(Description="Object Access Read Id.", Name="ObjectReadId")
public UUID ObjectReadId = null;
/**
* Object Id viewing the specified Object.
*/
@ApiMember(Description="Object Id viewing the specified Object.", IsRequired=true, Name="ViewingObjectId")
public UUID ViewingObjectId = null;
/**
* Name of the object viewing the specified Object.
*/
@ApiMember(Description="Name of the object viewing the specified Object.", Name="ViewingObjectName")
public String ViewingObjectName = null;
/**
* Name of the object viewing the specified Object.
*/
@ApiMember(Description="Name of the object viewing the specified Object.", Name="ViewingObjectPrimaryImageUrl")
public String ViewingObjectPrimaryImageUrl = null;
/**
* Id of the object being viewed.
*/
@ApiMember(Description="Id of the object being viewed.", IsRequired=true, Name="ViewedObjectId")
public UUID ViewedObjectId = null;
/**
* Name of the object being viewed.
*/
@ApiMember(Description="Name of the object being viewed.", Name="ViewedObjectName")
public String ViewedObjectName = null;
/**
* Date and Time of object read
*/
@ApiMember(Description="Date and Time of object read", Name="TimeRead")
public Date TimeRead = null;
/**
* Date and Time object started watching the specified object.
*/
@ApiMember(Description="Date and Time object started watching the specified object.", Name="TimeStartWatching")
public Date TimeStartWatching = null;
/**
* Date and Time of object being flagged.
*/
@ApiMember(Description="Date and Time of object being flagged.", Name="Flagged")
public Date Flagged = null;
public UUID getObjectReadId() { return ObjectReadId; }
public ObjectAccessModel setObjectReadId(UUID value) { this.ObjectReadId = value; return this; }
public UUID getViewingObjectId() { return ViewingObjectId; }
public ObjectAccessModel setViewingObjectId(UUID value) { this.ViewingObjectId = value; return this; }
public String getViewingObjectName() { return ViewingObjectName; }
public ObjectAccessModel setViewingObjectName(String value) { this.ViewingObjectName = value; return this; }
public String getViewingObjectPrimaryImageUrl() { return ViewingObjectPrimaryImageUrl; }
public ObjectAccessModel setViewingObjectPrimaryImageUrl(String value) { this.ViewingObjectPrimaryImageUrl = value; return this; }
public UUID getViewedObjectId() { return ViewedObjectId; }
public ObjectAccessModel setViewedObjectId(UUID value) { this.ViewedObjectId = value; return this; }
public String getViewedObjectName() { return ViewedObjectName; }
public ObjectAccessModel setViewedObjectName(String value) { this.ViewedObjectName = value; return this; }
public Date getTimeRead() { return TimeRead; }
public ObjectAccessModel setTimeRead(Date value) { this.TimeRead = value; return this; }
public Date getTimeStartWatching() { return TimeStartWatching; }
public ObjectAccessModel setTimeStartWatching(Date value) { this.TimeStartWatching = value; return this; }
public Date getFlagged() { return Flagged; }
public ObjectAccessModel setFlagged(Date value) { this.Flagged = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/object/{ObjectId}/reads HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ObjectReads":[{"ObjectReadId":"00000000-0000-0000-0000-000000000000","ViewingObjectId":"00000000-0000-0000-0000-000000000000","ViewingObjectName":"String","ViewingObjectPrimaryImageUrl":"String","ViewedObjectId":"00000000-0000-0000-0000-000000000000","ViewedObjectName":"String","TimeRead":"0001-01-01T00:00:00.0000000","TimeStartWatching":"0001-01-01T00:00:00.0000000","Flagged":"0001-01-01T00:00:00.0000000"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}