Trendsic Platform Service

<back to all web services

CustomerNotificationsSaveRequest

The following routes are available for this service:
PUT/v1/c/notifications
import 'package:servicestack/servicestack.dart';

class NotificationPrefView implements IConvertible
{
    String? Key;
    String? Label;
    String? Sub;
    bool? IsOn;

    NotificationPrefView({this.Key,this.Label,this.Sub,this.IsOn});
    NotificationPrefView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Key = json['Key'];
        Label = json['Label'];
        Sub = json['Sub'];
        IsOn = json['IsOn'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'Label': Label,
        'Sub': Sub,
        'IsOn': IsOn
    };

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

class CustomerNotificationsResponse implements IConvertible
{
    String? Audience;
    List<NotificationPrefView>? Items = [];
    int? Devices;
    bool? PushConfigured;
    ResponseStatus? ResponseStatus;

    CustomerNotificationsResponse({this.Audience,this.Items,this.Devices,this.PushConfigured,this.ResponseStatus});
    CustomerNotificationsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Audience = json['Audience'];
        Items = JsonConverters.fromJson(json['Items'],'List<NotificationPrefView>',context!);
        Devices = json['Devices'];
        PushConfigured = json['PushConfigured'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Audience': Audience,
        'Items': JsonConverters.toJson(Items,'List<NotificationPrefView>',context!),
        'Devices': Devices,
        'PushConfigured': PushConfigured,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class NotificationPrefInput implements IConvertible
{
    String? Key;
    bool? IsOn;

    NotificationPrefInput({this.Key,this.IsOn});
    NotificationPrefInput.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Key = json['Key'];
        IsOn = json['IsOn'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'IsOn': IsOn
    };

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

class CustomerNotificationsSaveRequest implements IConvertible
{
    String? Audience;
    List<NotificationPrefInput>? Items = [];

    CustomerNotificationsSaveRequest({this.Audience,this.Items});
    CustomerNotificationsSaveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Audience = json['Audience'];
        Items = JsonConverters.fromJson(json['Items'],'List<NotificationPrefInput>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Audience': Audience,
        'Items': JsonConverters.toJson(Items,'List<NotificationPrefInput>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'NotificationPrefView': TypeInfo(TypeOf.Class, create:() => NotificationPrefView()),
    'CustomerNotificationsResponse': TypeInfo(TypeOf.Class, create:() => CustomerNotificationsResponse()),
    'List<NotificationPrefView>': TypeInfo(TypeOf.Class, create:() => <NotificationPrefView>[]),
    'NotificationPrefInput': TypeInfo(TypeOf.Class, create:() => NotificationPrefInput()),
    'CustomerNotificationsSaveRequest': TypeInfo(TypeOf.Class, create:() => CustomerNotificationsSaveRequest()),
    'List<NotificationPrefInput>': TypeInfo(TypeOf.Class, create:() => <NotificationPrefInput>[]),
});

Dart CustomerNotificationsSaveRequest DTOs

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

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /v1/c/notifications HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Audience":"String","Items":[{"Key":"String","IsOn":false}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Audience":"String","Items":[{"Key":"String","Label":"String","Sub":"String","IsOn":false}],"Devices":0,"PushConfigured":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}