PUT | /RestApi/sitefinity/related-data/relations |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class RelationChangeMessage
{
public String ItemId = null;
public String ItemType = null;
public String ItemProvider = null;
public ArrayList<ContentLinkChange> RelationChanges = null;
public String getItemId() { return ItemId; }
public RelationChangeMessage setItemId(String value) { this.ItemId = value; return this; }
public String getItemType() { return ItemType; }
public RelationChangeMessage setItemType(String value) { this.ItemType = value; return this; }
public String getItemProvider() { return ItemProvider; }
public RelationChangeMessage setItemProvider(String value) { this.ItemProvider = value; return this; }
public ArrayList<ContentLinkChange> getRelationChanges() { return RelationChanges; }
public RelationChangeMessage setRelationChanges(ArrayList<ContentLinkChange> value) { this.RelationChanges = value; return this; }
}
@DataContract
public static class ContentLinkChange
{
@DataMember
public ContentLinkChangeState State = null;
@DataMember
public UUID ChildItemId = null;
@DataMember
public String ChildItemProviderName = null;
@DataMember
public String ChildItemType = null;
@DataMember
public String ChildItemAdditionalInfo = null;
@DataMember
public Float Ordinal = null;
@DataMember
public String ComponentPropertyName = null;
public ContentLinkChangeState getState() { return State; }
public ContentLinkChange setState(ContentLinkChangeState value) { this.State = value; return this; }
public UUID getChildItemId() { return ChildItemId; }
public ContentLinkChange setChildItemId(UUID value) { this.ChildItemId = value; return this; }
public String getChildItemProviderName() { return ChildItemProviderName; }
public ContentLinkChange setChildItemProviderName(String value) { this.ChildItemProviderName = value; return this; }
public String getChildItemType() { return ChildItemType; }
public ContentLinkChange setChildItemType(String value) { this.ChildItemType = value; return this; }
public String getChildItemAdditionalInfo() { return ChildItemAdditionalInfo; }
public ContentLinkChange setChildItemAdditionalInfo(String value) { this.ChildItemAdditionalInfo = value; return this; }
public Float getOrdinal() { return Ordinal; }
public ContentLinkChange setOrdinal(Float value) { this.Ordinal = value; return this; }
public String getComponentPropertyName() { return ComponentPropertyName; }
public ContentLinkChange setComponentPropertyName(String value) { this.ComponentPropertyName = value; return this; }
}
@DataContract
public static enum ContentLinkChangeState
{
Added,
Removed,
Updated;
}
}
Java RelationChangeMessage DTOs
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 /RestApi/sitefinity/related-data/relations HTTP/1.1
Host: www.asg.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ItemId":"String","ItemType":"String","ItemProvider":"String","RelationChanges":[{"State":"Added","ChildItemProviderName":"String","ChildItemType":"String","ChildItemAdditionalInfo":"String","Ordinal":0,"ComponentPropertyName":"String","IsChildDeleted":false}]}