TicketUserServices

<back to all web services

CampaignConversionRunRequest

The following routes are available for this service:
POST/CampaignConversions/Run
import 'package:servicestack/servicestack.dart';

class CampaignConversionSurfaceCount implements IConvertible
{
    String? key;
    int? people;
    int? count;
    double? amount;

    CampaignConversionSurfaceCount({this.key,this.people,this.count,this.amount});
    CampaignConversionSurfaceCount.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        key = json['key'];
        people = json['people'];
        count = json['count'];
        amount = JsonConverters.toDouble(json['amount']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'key': key,
        'people': people,
        'count': count,
        'amount': amount
    };

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

class CampaignConversionResult implements IConvertible
{
    String? runId;
    int? peopleMeasured;
    int? peopleConverted;
    double? totalAmount;
    List<CampaignConversionSurfaceCount>? bySurface;
    List<CampaignConversionSurfaceCount>? byChannel;
    int? headlineConversions;
    double? headlineAmount;
    int? medianHoursToConvert;
    List<String>? notes;
    int? statusCode;
    String? message;

    CampaignConversionResult({this.runId,this.peopleMeasured,this.peopleConverted,this.totalAmount,this.bySurface,this.byChannel,this.headlineConversions,this.headlineAmount,this.medianHoursToConvert,this.notes,this.statusCode,this.message});
    CampaignConversionResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        runId = json['runId'];
        peopleMeasured = json['peopleMeasured'];
        peopleConverted = json['peopleConverted'];
        totalAmount = JsonConverters.toDouble(json['totalAmount']);
        bySurface = JsonConverters.fromJson(json['bySurface'],'List<CampaignConversionSurfaceCount>',context!);
        byChannel = JsonConverters.fromJson(json['byChannel'],'List<CampaignConversionSurfaceCount>',context!);
        headlineConversions = json['headlineConversions'];
        headlineAmount = JsonConverters.toDouble(json['headlineAmount']);
        medianHoursToConvert = json['medianHoursToConvert'];
        notes = JsonConverters.fromJson(json['notes'],'List<String>',context!);
        statusCode = json['statusCode'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'runId': runId,
        'peopleMeasured': peopleMeasured,
        'peopleConverted': peopleConverted,
        'totalAmount': totalAmount,
        'bySurface': JsonConverters.toJson(bySurface,'List<CampaignConversionSurfaceCount>',context!),
        'byChannel': JsonConverters.toJson(byChannel,'List<CampaignConversionSurfaceCount>',context!),
        'headlineConversions': headlineConversions,
        'headlineAmount': headlineAmount,
        'medianHoursToConvert': medianHoursToConvert,
        'notes': JsonConverters.toJson(notes,'List<String>',context!),
        'statusCode': statusCode,
        'message': message
    };

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

class CampaignConversionPerson implements IConvertible
{
    String? phone;
    String? email;
    int? recipientId;
    String? channel;
    DateTime? sentAt;

    CampaignConversionPerson({this.phone,this.email,this.recipientId,this.channel,this.sentAt});
    CampaignConversionPerson.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        phone = json['phone'];
        email = json['email'];
        recipientId = json['recipientId'];
        channel = json['channel'];
        sentAt = JsonConverters.fromJson(json['sentAt'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'phone': phone,
        'email': email,
        'recipientId': recipientId,
        'channel': channel,
        'sentAt': JsonConverters.toJson(sentAt,'DateTime',context!)
    };

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

class CampaignConversionRunRequest implements IConvertible
{
    int? campaignId;
    List<CampaignConversionPerson>? people;
    int? windowHours;
    int? targetEventId;
    bool? includeFood;

    CampaignConversionRunRequest({this.campaignId,this.people,this.windowHours,this.targetEventId,this.includeFood});
    CampaignConversionRunRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        campaignId = json['campaignId'];
        people = JsonConverters.fromJson(json['people'],'List<CampaignConversionPerson>',context!);
        windowHours = json['windowHours'];
        targetEventId = json['targetEventId'];
        includeFood = json['includeFood'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'campaignId': campaignId,
        'people': JsonConverters.toJson(people,'List<CampaignConversionPerson>',context!),
        'windowHours': windowHours,
        'targetEventId': targetEventId,
        'includeFood': includeFood
    };

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

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'CampaignConversionSurfaceCount': TypeInfo(TypeOf.Class, create:() => CampaignConversionSurfaceCount()),
    'CampaignConversionResult': TypeInfo(TypeOf.Class, create:() => CampaignConversionResult()),
    'List<CampaignConversionSurfaceCount>': TypeInfo(TypeOf.Class, create:() => <CampaignConversionSurfaceCount>[]),
    'CampaignConversionPerson': TypeInfo(TypeOf.Class, create:() => CampaignConversionPerson()),
    'CampaignConversionRunRequest': TypeInfo(TypeOf.Class, create:() => CampaignConversionRunRequest()),
    'List<CampaignConversionPerson>': TypeInfo(TypeOf.Class, create:() => <CampaignConversionPerson>[]),
});

Dart CampaignConversionRunRequest 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

HTTP + JSON

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

POST /CampaignConversions/Run HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"campaignId":0,"people":[{"phone":"String","email":"String","recipientId":0,"channel":"String","sentAt":"0001-01-01T00:00:00.0000000"}],"windowHours":0,"targetEventId":0,"includeFood":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"runId":"String","peopleMeasured":0,"peopleConverted":0,"totalAmount":0,"bySurface":[{"key":"String","people":0,"count":0,"amount":0}],"byChannel":[{"key":"String","people":0,"count":0,"amount":0}],"headlineConversions":0,"headlineAmount":0,"medianHoursToConvert":0,"notes":["String"],"statusCode":0,"message":"String"}