Trendsic Platform Service

<back to all web services

ProductionRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET/v1/Production
GET/v1/Production/DateRange/{StartDate}/{EndDate}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class Production implements IConvertible
{
    int? AgentId;
    int? MVPID;
    int? AVPID;
    int? RVPID;
    String? FirstName;
    String? LastName;
    String? MiddleInitial;
    double? AgentLevel;
    String? Rank;
    String? FullName;
    bool? IsMVP;
    bool? IsRVP;
    bool? IsAVP;
    int? PolicyCount;
    double? AppCount;
    double? Points;
    double? Cashflow;

    Production({this.AgentId,this.MVPID,this.AVPID,this.RVPID,this.FirstName,this.LastName,this.MiddleInitial,this.AgentLevel,this.Rank,this.FullName,this.IsMVP,this.IsRVP,this.IsAVP,this.PolicyCount,this.AppCount,this.Points,this.Cashflow});
    Production.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AgentId = json['AgentId'];
        MVPID = json['MVPID'];
        AVPID = json['AVPID'];
        RVPID = json['RVPID'];
        FirstName = json['FirstName'];
        LastName = json['LastName'];
        MiddleInitial = json['MiddleInitial'];
        AgentLevel = JsonConverters.toDouble(json['AgentLevel']);
        Rank = json['Rank'];
        FullName = json['FullName'];
        IsMVP = json['IsMVP'];
        IsRVP = json['IsRVP'];
        IsAVP = json['IsAVP'];
        PolicyCount = json['PolicyCount'];
        AppCount = JsonConverters.toDouble(json['AppCount']);
        Points = JsonConverters.toDouble(json['Points']);
        Cashflow = JsonConverters.toDouble(json['Cashflow']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AgentId': AgentId,
        'MVPID': MVPID,
        'AVPID': AVPID,
        'RVPID': RVPID,
        'FirstName': FirstName,
        'LastName': LastName,
        'MiddleInitial': MiddleInitial,
        'AgentLevel': AgentLevel,
        'Rank': Rank,
        'FullName': FullName,
        'IsMVP': IsMVP,
        'IsRVP': IsRVP,
        'IsAVP': IsAVP,
        'PolicyCount': PolicyCount,
        'AppCount': AppCount,
        'Points': Points,
        'Cashflow': Cashflow
    };

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

class ProductionResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<Production>? ReportData = [];

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

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

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

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

class ProductionRequest implements IConvertible
{
    DateTime? StartDate;
    DateTime? EndDate;

    ProductionRequest({this.StartDate,this.EndDate});
    ProductionRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

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

GET /v1/Production HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ProductionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ReportData>
    <Production>
      <AVPID>0</AVPID>
      <AgentId>0</AgentId>
      <AgentLevel>0</AgentLevel>
      <AppCount>0</AppCount>
      <Cashflow>0</Cashflow>
      <FirstName>String</FirstName>
      <FullName>String</FullName>
      <IsAVP>false</IsAVP>
      <IsMVP>false</IsMVP>
      <IsRVP>false</IsRVP>
      <LastName>String</LastName>
      <MVPID>0</MVPID>
      <MiddleInitial>String</MiddleInitial>
      <Points>0</Points>
      <PolicyCount>0</PolicyCount>
      <RVPID>0</RVPID>
      <Rank>String</Rank>
    </Production>
  </ReportData>
  <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>
</ProductionResponse>