Trendsic Platform Service

<back to all web services

AgreementVisitsRequest

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

class AgreementVisit implements IConvertible
{
    int? AgreementJobID;
    int? AgreementID;
    int? JobID;
    DateTime? OccurrenceDate;
    String? Status;
    DateTime? CompletedAt;
    DateTime? CancelledAt;
    String? CancelReason;
    DateTime? ShiftedToDate;
    int? ActualDurationMinutes;

    AgreementVisit({this.AgreementJobID,this.AgreementID,this.JobID,this.OccurrenceDate,this.Status,this.CompletedAt,this.CancelledAt,this.CancelReason,this.ShiftedToDate,this.ActualDurationMinutes});
    AgreementVisit.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AgreementJobID = json['AgreementJobID'];
        AgreementID = json['AgreementID'];
        JobID = json['JobID'];
        OccurrenceDate = JsonConverters.fromJson(json['OccurrenceDate'],'DateTime',context!);
        Status = json['Status'];
        CompletedAt = JsonConverters.fromJson(json['CompletedAt'],'DateTime',context!);
        CancelledAt = JsonConverters.fromJson(json['CancelledAt'],'DateTime',context!);
        CancelReason = json['CancelReason'];
        ShiftedToDate = JsonConverters.fromJson(json['ShiftedToDate'],'DateTime',context!);
        ActualDurationMinutes = json['ActualDurationMinutes'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AgreementJobID': AgreementJobID,
        'AgreementID': AgreementID,
        'JobID': JobID,
        'OccurrenceDate': JsonConverters.toJson(OccurrenceDate,'DateTime',context!),
        'Status': Status,
        'CompletedAt': JsonConverters.toJson(CompletedAt,'DateTime',context!),
        'CancelledAt': JsonConverters.toJson(CancelledAt,'DateTime',context!),
        'CancelReason': CancelReason,
        'ShiftedToDate': JsonConverters.toJson(ShiftedToDate,'DateTime',context!),
        'ActualDurationMinutes': ActualDurationMinutes
    };

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

class AgreementVisitsResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<AgreementVisit>? Visits = [];

    AgreementVisitsResponse({this.ResponseStatus,this.Visits});
    AgreementVisitsResponse.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<AgreementVisit>',context!);
        return this;
    }

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

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

class AgreementVisitsRequest implements IConvertible
{
    int? AgreementID;

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

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

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

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

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

Dart AgreementVisitsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/serviceagreement/{AgreementID}/visits HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
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,
			AgreementID: 0,
			JobID: 0,
			OccurrenceDate: 0001-01-01,
			Status: String,
			CompletedAt: 0001-01-01,
			CancelledAt: 0001-01-01,
			CancelReason: String,
			ShiftedToDate: 0001-01-01,
			ActualDurationMinutes: 0
		}
	]
}