Trendsic Platform Service

<back to all web services

ActivityDataRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/ActivityData/{AgentId}/{DateFrom}/{DateTo}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class ActivityPlan implements IConvertible
{
    int? Id;
    int? AgentId;
    int? EventTypeId;
    int? Goal;
    DateTime? DateFrom;
    DateTime? DateTo;
    DateTime? DateCreated;
    int? MthlyCashFlow;
    int? YTDCashFlow;
    int? Recruit;
    String? EventTypeName;
    int? Actual;

    ActivityPlan({this.Id,this.AgentId,this.EventTypeId,this.Goal,this.DateFrom,this.DateTo,this.DateCreated,this.MthlyCashFlow,this.YTDCashFlow,this.Recruit,this.EventTypeName,this.Actual});
    ActivityPlan.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        AgentId = json['AgentId'];
        EventTypeId = json['EventTypeId'];
        Goal = json['Goal'];
        DateFrom = JsonConverters.fromJson(json['DateFrom'],'DateTime',context!);
        DateTo = JsonConverters.fromJson(json['DateTo'],'DateTime',context!);
        DateCreated = JsonConverters.fromJson(json['DateCreated'],'DateTime',context!);
        MthlyCashFlow = json['MthlyCashFlow'];
        YTDCashFlow = json['YTDCashFlow'];
        Recruit = json['Recruit'];
        EventTypeName = json['EventTypeName'];
        Actual = json['Actual'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'AgentId': AgentId,
        'EventTypeId': EventTypeId,
        'Goal': Goal,
        'DateFrom': JsonConverters.toJson(DateFrom,'DateTime',context!),
        'DateTo': JsonConverters.toJson(DateTo,'DateTime',context!),
        'DateCreated': JsonConverters.toJson(DateCreated,'DateTime',context!),
        'MthlyCashFlow': MthlyCashFlow,
        'YTDCashFlow': YTDCashFlow,
        'Recruit': Recruit,
        'EventTypeName': EventTypeName,
        'Actual': Actual
    };

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

class ActivityPlanExtended implements IConvertible
{
    int? AppCount;
    int? AvgFlow;
    int? AvgTransfer;
    int? AvgLife;
    double? LifePerAnnuity;
    double? FlowTransfer;
    double? TransferRatio;

    ActivityPlanExtended({this.AppCount,this.AvgFlow,this.AvgTransfer,this.AvgLife,this.LifePerAnnuity,this.FlowTransfer,this.TransferRatio});
    ActivityPlanExtended.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AppCount = json['AppCount'];
        AvgFlow = json['AvgFlow'];
        AvgTransfer = json['AvgTransfer'];
        AvgLife = json['AvgLife'];
        LifePerAnnuity = JsonConverters.toDouble(json['LifePerAnnuity']);
        FlowTransfer = JsonConverters.toDouble(json['FlowTransfer']);
        TransferRatio = JsonConverters.toDouble(json['TransferRatio']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AppCount': AppCount,
        'AvgFlow': AvgFlow,
        'AvgTransfer': AvgTransfer,
        'AvgLife': AvgLife,
        'LifePerAnnuity': LifePerAnnuity,
        'FlowTransfer': FlowTransfer,
        'TransferRatio': TransferRatio
    };

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

class ActivityPlanResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<ActivityPlan>? ActivityPlans = [];
    ActivityPlanExtended? ActivityData;

    ActivityPlanResponse({this.ResponseStatus,this.ActivityPlans,this.ActivityData});
    ActivityPlanResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        ActivityPlans = JsonConverters.fromJson(json['ActivityPlans'],'List<ActivityPlan>',context!);
        ActivityData = JsonConverters.fromJson(json['ActivityData'],'ActivityPlanExtended',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'ActivityPlans': JsonConverters.toJson(ActivityPlans,'List<ActivityPlan>',context!),
        'ActivityData': JsonConverters.toJson(ActivityData,'ActivityPlanExtended',context!)
    };

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

class ActivityDataRequest implements IConvertible
{
    int? AgentId;
    DateTime? DateFrom;
    DateTime? DateTo;

    ActivityDataRequest({this.AgentId,this.DateFrom,this.DateTo});
    ActivityDataRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AgentId = json['AgentId'];
        DateFrom = JsonConverters.fromJson(json['DateFrom'],'DateTime',context!);
        DateTo = JsonConverters.fromJson(json['DateTo'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AgentId': AgentId,
        'DateFrom': JsonConverters.toJson(DateFrom,'DateTime',context!),
        'DateTo': JsonConverters.toJson(DateTo,'DateTime',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'ActivityPlan': TypeInfo(TypeOf.Class, create:() => ActivityPlan()),
    'ActivityPlanExtended': TypeInfo(TypeOf.Class, create:() => ActivityPlanExtended()),
    'ActivityPlanResponse': TypeInfo(TypeOf.Class, create:() => ActivityPlanResponse()),
    'List<ActivityPlan>': TypeInfo(TypeOf.Class, create:() => <ActivityPlan>[]),
    'ActivityDataRequest': TypeInfo(TypeOf.Class, create:() => ActivityDataRequest()),
});

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

GET /v1/ActivityData/{AgentId}/{DateFrom}/{DateTo} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"ActivityPlans":[{"Id":0,"AgentId":0,"EventTypeId":0,"Goal":0,"DateFrom":"0001-01-01T00:00:00.0000000","DateTo":"0001-01-01T00:00:00.0000000","DateCreated":"0001-01-01T00:00:00.0000000","MthlyCashFlow":0,"YTDCashFlow":0,"Recruit":0,"EventTypeName":"String","Actual":0}],"ActivityData":{"AppCount":0,"AvgFlow":0,"AvgTransfer":0,"AvgLife":0,"LifePerAnnuity":0,"FlowTransfer":0,"TransferRatio":0}}