MBFSPreferences

<back to all web services

CustomerPreferencesRequest

The following routes are available for this service:
All Verbs/CustomerPreferences/
import 'package:servicestack/servicestack.dart';

class Response implements IConvertible
{
    String? Code;
    String? Message;

    Response({this.Code,this.Message});
    Response.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Code': Code,
        'Message': Message
    };

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

class MarketingPreference implements IConvertible
{
    String? OptInMail;
    String? OptInTelephone;
    String? OptInEmail;
    String? OptInSMS;
    String? TimeStamp;
    bool? MMF_Portal_Registered;

    MarketingPreference({this.OptInMail,this.OptInTelephone,this.OptInEmail,this.OptInSMS,this.TimeStamp,this.MMF_Portal_Registered});
    MarketingPreference.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        OptInMail = json['OptInMail'];
        OptInTelephone = json['OptInTelephone'];
        OptInEmail = json['OptInEmail'];
        OptInSMS = json['OptInSMS'];
        TimeStamp = json['TimeStamp'];
        MMF_Portal_Registered = json['MMF_Portal_Registered'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'OptInMail': OptInMail,
        'OptInTelephone': OptInTelephone,
        'OptInEmail': OptInEmail,
        'OptInSMS': OptInSMS,
        'TimeStamp': TimeStamp,
        'MMF_Portal_Registered': MMF_Portal_Registered
    };

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

class CustomerPreferencesResponse implements IConvertible
{
    Response? ResponseStatus;
    MarketingPreference? MarketingPreference;

    CustomerPreferencesResponse({this.ResponseStatus,this.MarketingPreference});
    CustomerPreferencesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'Response',context!);
        MarketingPreference = JsonConverters.fromJson(json['MarketingPreference'],'MarketingPreference',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'Response',context!),
        'MarketingPreference': JsonConverters.toJson(MarketingPreference,'MarketingPreference',context!)
    };

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

class CustomerPreferencesRequest implements IConvertible
{
    String? BP_ID;
    String? Username;
    String? Token;
    String? Timestamp;

    CustomerPreferencesRequest({this.BP_ID,this.Username,this.Token,this.Timestamp});
    CustomerPreferencesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        BP_ID = json['BP_ID'];
        Username = json['Username'];
        Token = json['Token'];
        Timestamp = json['Timestamp'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'BP_ID': BP_ID,
        'Username': Username,
        'Token': Token,
        'Timestamp': Timestamp
    };

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

TypeContext _ctx = TypeContext(library: 'webservices.mbukdatabase.co.uk', types: <String, TypeInfo> {
    'Response': TypeInfo(TypeOf.Class, create:() => Response()),
    'MarketingPreference': TypeInfo(TypeOf.Class, create:() => MarketingPreference()),
    'CustomerPreferencesResponse': TypeInfo(TypeOf.Class, create:() => CustomerPreferencesResponse()),
    'CustomerPreferencesRequest': TypeInfo(TypeOf.Class, create:() => CustomerPreferencesRequest()),
});

Dart CustomerPreferencesRequest 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.

POST /CustomerPreferences/ HTTP/1.1 
Host: webservices.mbukdatabase.co.uk 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CustomerPreferencesRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MBFSPreferences.ServiceModel">
  <BP_ID>String</BP_ID>
  <Timestamp>String</Timestamp>
  <Token>String</Token>
  <Username>String</Username>
</CustomerPreferencesRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerPreferencesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MBFSPreferences.ServiceModel">
  <MarketingPreference>
    <MMF_Portal_Registered>false</MMF_Portal_Registered>
    <OptInEmail>String</OptInEmail>
    <OptInMail>String</OptInMail>
    <OptInSMS>String</OptInSMS>
    <OptInTelephone>String</OptInTelephone>
    <TimeStamp>String</TimeStamp>
  </MarketingPreference>
  <ResponseStatus>
    <Code>String</Code>
    <Message>String</Message>
  </ResponseStatus>
</CustomerPreferencesResponse>