<back to all web services

RelationChangeMessage

The following routes are available for this service:
PUT/RestApi/sitefinity/related-data/relations
import 'package:servicestack/servicestack.dart';

class RelationChangeMessage implements IConvertible
{
    String? ItemId;
    String? ItemType;
    String? ItemProvider;
    List<ContentLinkChange>? RelationChanges;

    RelationChangeMessage({this.ItemId,this.ItemType,this.ItemProvider,this.RelationChanges});
    RelationChangeMessage.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ItemId = json['ItemId'];
        ItemType = json['ItemType'];
        ItemProvider = json['ItemProvider'];
        RelationChanges = JsonConverters.fromJson(json['RelationChanges'],'List<ContentLinkChange>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ItemId': ItemId,
        'ItemType': ItemType,
        'ItemProvider': ItemProvider,
        'RelationChanges': JsonConverters.toJson(RelationChanges,'List<ContentLinkChange>',context!)
    };

    getTypeName() => "RelationChangeMessage";
    TypeContext? context = _ctx;
}

// @DataContract
enum ContentLinkChangeState
{
    Added,
    Removed,
    Updated,
}

// @DataContract
class ContentLinkChange implements IConvertible
{
    // @DataMember
    ContentLinkChangeState? State;

    // @DataMember
    String? ChildItemId;

    // @DataMember
    String? ChildItemProviderName;

    // @DataMember
    String? ChildItemType;

    // @DataMember
    String? ChildItemAdditionalInfo;

    // @DataMember
    double? Ordinal;

    // @DataMember
    String? ComponentPropertyName;

    ContentLinkChange({this.State,this.ChildItemId,this.ChildItemProviderName,this.ChildItemType,this.ChildItemAdditionalInfo,this.Ordinal,this.ComponentPropertyName});
    ContentLinkChange.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        State = JsonConverters.fromJson(json['State'],'ContentLinkChangeState',context!);
        ChildItemId = json['ChildItemId'];
        ChildItemProviderName = json['ChildItemProviderName'];
        ChildItemType = json['ChildItemType'];
        ChildItemAdditionalInfo = json['ChildItemAdditionalInfo'];
        Ordinal = JsonConverters.toDouble(json['Ordinal']);
        ComponentPropertyName = json['ComponentPropertyName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'State': JsonConverters.toJson(State,'ContentLinkChangeState',context!),
        'ChildItemId': ChildItemId,
        'ChildItemProviderName': ChildItemProviderName,
        'ChildItemType': ChildItemType,
        'ChildItemAdditionalInfo': ChildItemAdditionalInfo,
        'Ordinal': Ordinal,
        'ComponentPropertyName': ComponentPropertyName
    };

    getTypeName() => "ContentLinkChange";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'www.asg.com.au', types: <String, TypeInfo> {
    'RelationChangeMessage': TypeInfo(TypeOf.Class, create:() => RelationChangeMessage()),
    'List<ContentLinkChange>': TypeInfo(TypeOf.Class, create:() => <ContentLinkChange>[]),
    'ContentLinkChange': TypeInfo(TypeOf.Class, create:() => ContentLinkChange()),
    'ContentLinkChangeState': TypeInfo(TypeOf.Enum, enumValues:ContentLinkChangeState.values),
});

Dart RelationChangeMessage DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

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: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"ItemId":"String","ItemType":"String","ItemProvider":"String","RelationChanges":[{"State":"Added","ChildItemProviderName":"String","ChildItemType":"String","ChildItemAdditionalInfo":"String","Ordinal":0,"ComponentPropertyName":"String","IsChildDeleted":false}]}