Trendsic Platform Service

<back to all web services

AgreementKpiRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/agreements
import 'package:servicestack/servicestack.dart';

class DashboardStatTile implements IConvertible
{
    String? Key;
    String? Label;
    double? Value;
    double? PreviousValue;
    String? Unit;
    double? DeltaPct;

    DashboardStatTile({this.Key,this.Label,this.Value,this.PreviousValue,this.Unit,this.DeltaPct});
    DashboardStatTile.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Key = json['Key'];
        Label = json['Label'];
        Value = JsonConverters.toDouble(json['Value']);
        PreviousValue = JsonConverters.toDouble(json['PreviousValue']);
        Unit = json['Unit'];
        DeltaPct = JsonConverters.toDouble(json['DeltaPct']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'Label': Label,
        'Value': Value,
        'PreviousValue': PreviousValue,
        'Unit': Unit,
        'DeltaPct': DeltaPct
    };

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

class AgreementKpiBranchRow implements IConvertible
{
    String? BranchName;
    int? ActiveCount;
    double? Mrr;
    int? ExpiringCount;
    int? ChurnCount;
    double? SkippedRate;

    AgreementKpiBranchRow({this.BranchName,this.ActiveCount,this.Mrr,this.ExpiringCount,this.ChurnCount,this.SkippedRate});
    AgreementKpiBranchRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        BranchName = json['BranchName'];
        ActiveCount = json['ActiveCount'];
        Mrr = JsonConverters.toDouble(json['Mrr']);
        ExpiringCount = json['ExpiringCount'];
        ChurnCount = json['ChurnCount'];
        SkippedRate = JsonConverters.toDouble(json['SkippedRate']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'BranchName': BranchName,
        'ActiveCount': ActiveCount,
        'Mrr': Mrr,
        'ExpiringCount': ExpiringCount,
        'ChurnCount': ChurnCount,
        'SkippedRate': SkippedRate
    };

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

class AgreementKpiResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<DashboardStatTile>? Stats = [];
    List<AgreementKpiBranchRow>? ByBranch = [];

    AgreementKpiResponse({this.ResponseStatus,this.Stats,this.ByBranch});
    AgreementKpiResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Stats = JsonConverters.fromJson(json['Stats'],'List<DashboardStatTile>',context!);
        ByBranch = JsonConverters.fromJson(json['ByBranch'],'List<AgreementKpiBranchRow>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Stats': JsonConverters.toJson(Stats,'List<DashboardStatTile>',context!),
        'ByBranch': JsonConverters.toJson(ByBranch,'List<AgreementKpiBranchRow>',context!)
    };

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

class AgreementKpiRequest implements IConvertible
{
    DateTime? FromDate;
    DateTime? ToDate;
    List<String>? LocationIds = [];

    AgreementKpiRequest({this.FromDate,this.ToDate,this.LocationIds});
    AgreementKpiRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FromDate = JsonConverters.fromJson(json['FromDate'],'DateTime',context!);
        ToDate = JsonConverters.fromJson(json['ToDate'],'DateTime',context!);
        LocationIds = JsonConverters.fromJson(json['LocationIds'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FromDate': JsonConverters.toJson(FromDate,'DateTime',context!),
        'ToDate': JsonConverters.toJson(ToDate,'DateTime',context!),
        'LocationIds': JsonConverters.toJson(LocationIds,'List<String>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'DashboardStatTile': TypeInfo(TypeOf.Class, create:() => DashboardStatTile()),
    'AgreementKpiBranchRow': TypeInfo(TypeOf.Class, create:() => AgreementKpiBranchRow()),
    'AgreementKpiResponse': TypeInfo(TypeOf.Class, create:() => AgreementKpiResponse()),
    'List<DashboardStatTile>': TypeInfo(TypeOf.Class, create:() => <DashboardStatTile>[]),
    'List<AgreementKpiBranchRow>': TypeInfo(TypeOf.Class, create:() => <AgreementKpiBranchRow>[]),
    'AgreementKpiRequest': TypeInfo(TypeOf.Class, create:() => AgreementKpiRequest()),
});

Dart AgreementKpiRequest 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 /v1/dashboard/agreements HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AgreementKpiRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <FromDate>0001-01-01T00:00:00</FromDate>
  <LocationIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
  </LocationIds>
  <ToDate>0001-01-01T00:00:00</ToDate>
</AgreementKpiRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AgreementKpiResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ByBranch>
    <AgreementKpiBranchRow>
      <ActiveCount>0</ActiveCount>
      <BranchName>String</BranchName>
      <ChurnCount>0</ChurnCount>
      <ExpiringCount>0</ExpiringCount>
      <Mrr>0</Mrr>
      <SkippedRate>0</SkippedRate>
    </AgreementKpiBranchRow>
  </ByBranch>
  <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>
  <Stats>
    <DashboardStatTile>
      <Key>String</Key>
      <Label>String</Label>
      <PreviousValue>0</PreviousValue>
      <Unit>String</Unit>
      <Value>0</Value>
    </DashboardStatTile>
  </Stats>
</AgreementKpiResponse>