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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<CustomerNotificationsSaveRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Audience>String</Audience>
  <Items>
    <NotificationPrefInput>
      <IsOn>false</IsOn>
      <Key>String</Key>
    </NotificationPrefInput>
  </Items>
</CustomerNotificationsSaveRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerNotificationsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Audience>String</Audience>
  <Devices>0</Devices>
  <Items>
    <NotificationPrefView>
      <IsOn>false</IsOn>
      <Key>String</Key>
      <Label>String</Label>
      <Sub>String</Sub>
    </NotificationPrefView>
  </Items>
  <PushConfigured>false</PushConfigured>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</CustomerNotificationsResponse>