Trendsic Platform Service

<back to all web services

PortalVisitsRequest

The following routes are available for this service:
GET,OPTIONS/portal/{Token}/visits
import 'package:servicestack/servicestack.dart';

class CustomerVisit implements IConvertible
{
    int? AgreementJobID;
    DateTime? VisitDate;
    DateTime? CompletedAt;
    String? ServiceName;
    String? CrewNotes;

    CustomerVisit({this.AgreementJobID,this.VisitDate,this.CompletedAt,this.ServiceName,this.CrewNotes});
    CustomerVisit.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AgreementJobID = json['AgreementJobID'];
        VisitDate = JsonConverters.fromJson(json['VisitDate'],'DateTime',context!);
        CompletedAt = JsonConverters.fromJson(json['CompletedAt'],'DateTime',context!);
        ServiceName = json['ServiceName'];
        CrewNotes = json['CrewNotes'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AgreementJobID': AgreementJobID,
        'VisitDate': JsonConverters.toJson(VisitDate,'DateTime',context!),
        'CompletedAt': JsonConverters.toJson(CompletedAt,'DateTime',context!),
        'ServiceName': ServiceName,
        'CrewNotes': CrewNotes
    };

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

class CustomerVisitPhoto implements IConvertible
{
    int? ProjectLocationAttachmentID;
    int? AgreementJobID;
    String? DocTitle;
    String? MimeType;
    DateTime? UploadDate;

    CustomerVisitPhoto({this.ProjectLocationAttachmentID,this.AgreementJobID,this.DocTitle,this.MimeType,this.UploadDate});
    CustomerVisitPhoto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ProjectLocationAttachmentID = json['ProjectLocationAttachmentID'];
        AgreementJobID = json['AgreementJobID'];
        DocTitle = json['DocTitle'];
        MimeType = json['MimeType'];
        UploadDate = JsonConverters.fromJson(json['UploadDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ProjectLocationAttachmentID': ProjectLocationAttachmentID,
        'AgreementJobID': AgreementJobID,
        'DocTitle': DocTitle,
        'MimeType': MimeType,
        'UploadDate': JsonConverters.toJson(UploadDate,'DateTime',context!)
    };

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

class PortalVisitsResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<CustomerVisit>? Visits = [];
    List<CustomerVisitPhoto>? Photos = [];

    PortalVisitsResponse({this.ResponseStatus,this.Visits,this.Photos});
    PortalVisitsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Visits': JsonConverters.toJson(Visits,'List<CustomerVisit>',context!),
        'Photos': JsonConverters.toJson(Photos,'List<CustomerVisitPhoto>',context!)
    };

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

class PortalVisitsRequest implements IConvertible
{
    String? Token;

    PortalVisitsRequest({this.Token});
    PortalVisitsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

Dart PortalVisitsRequest 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 /portal/{Token}/visits 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"}},"Visits":[{"AgreementJobID":0,"VisitDate":"0001-01-01T00:00:00.0000000","CompletedAt":"0001-01-01T00:00:00.0000000","ServiceName":"String","CrewNotes":"String"}],"Photos":[{"ProjectLocationAttachmentID":0,"AgreementJobID":0,"DocTitle":"String","MimeType":"String","UploadDate":"0001-01-01T00:00:00.0000000"}]}