Trendsic Platform Service

<back to all web services

VisitWeekRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/visits/week
import 'package:servicestack/servicestack.dart';

class CrewWeekCell implements IConvertible
{
    String? Date;
    int? VisitCount;
    int? LoadPct;

    CrewWeekCell({this.Date,this.VisitCount,this.LoadPct});
    CrewWeekCell.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Date = json['Date'];
        VisitCount = json['VisitCount'];
        LoadPct = json['LoadPct'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Date': Date,
        'VisitCount': VisitCount,
        'LoadPct': LoadPct
    };

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

class CrewWeekRow implements IConvertible
{
    int? CrewID;
    String? CrewName;
    String? CrewColor;
    List<CrewWeekCell>? Cells = [];

    CrewWeekRow({this.CrewID,this.CrewName,this.CrewColor,this.Cells});
    CrewWeekRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CrewID = json['CrewID'];
        CrewName = json['CrewName'];
        CrewColor = json['CrewColor'];
        Cells = JsonConverters.fromJson(json['Cells'],'List<CrewWeekCell>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CrewID': CrewID,
        'CrewName': CrewName,
        'CrewColor': CrewColor,
        'Cells': JsonConverters.toJson(Cells,'List<CrewWeekCell>',context!)
    };

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

class VisitWeekResponse implements IConvertible
{
    String? From;
    String? To;
    List<String>? Days = [];
    List<CrewWeekRow>? Rows = [];
    ResponseStatus? ResponseStatus;

    VisitWeekResponse({this.From,this.To,this.Days,this.Rows,this.ResponseStatus});
    VisitWeekResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        From = json['From'];
        To = json['To'];
        Days = JsonConverters.fromJson(json['Days'],'List<String>',context!);
        Rows = JsonConverters.fromJson(json['Rows'],'List<CrewWeekRow>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'From': From,
        'To': To,
        'Days': JsonConverters.toJson(Days,'List<String>',context!),
        'Rows': JsonConverters.toJson(Rows,'List<CrewWeekRow>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class VisitWeekRequest implements IConvertible
{
    String? From;
    int? Days;

    VisitWeekRequest({this.From,this.Days});
    VisitWeekRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'From': From,
        'Days': Days
    };

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

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

Dart VisitWeekRequest 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/visits/week HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<VisitWeekResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Days xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Days>
  <From>String</From>
  <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>
  <Rows>
    <CrewWeekRow>
      <Cells>
        <CrewWeekCell>
          <Date>String</Date>
          <LoadPct>0</LoadPct>
          <VisitCount>0</VisitCount>
        </CrewWeekCell>
      </Cells>
      <CrewColor>String</CrewColor>
      <CrewID>0</CrewID>
      <CrewName>String</CrewName>
    </CrewWeekRow>
  </Rows>
  <To>String</To>
</VisitWeekResponse>