Trendsic Platform Service

<back to all web services

CoveragePtoDecideRequest

Requires Authentication
The following routes are available for this service:
POST/v1/coverage/pto/{WorkerTimeOffID}/decide
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class CoveragePtoCheck implements IConvertible
{
    bool? Ok;
    String? Text;

    CoveragePtoCheck({this.Ok,this.Text});
    CoveragePtoCheck.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class CoveragePlannedItem implements IConvertible
{
    int? WorkerTimeOffID;
    int? ContactId;
    String? WorkerName;
    String? Initials;
    String? Dates;
    String? Reason;
    String? Stage;
    String? StageLabel;
    bool? NeedBook;
    int? CoverageGapId;
    List<CoveragePtoCheck>? Checks = [];
    String? DenyReason;

    CoveragePlannedItem({this.WorkerTimeOffID,this.ContactId,this.WorkerName,this.Initials,this.Dates,this.Reason,this.Stage,this.StageLabel,this.NeedBook,this.CoverageGapId,this.Checks,this.DenyReason});
    CoveragePlannedItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        WorkerTimeOffID = json['WorkerTimeOffID'];
        ContactId = json['ContactId'];
        WorkerName = json['WorkerName'];
        Initials = json['Initials'];
        Dates = json['Dates'];
        Reason = json['Reason'];
        Stage = json['Stage'];
        StageLabel = json['StageLabel'];
        NeedBook = json['NeedBook'];
        CoverageGapId = json['CoverageGapId'];
        Checks = JsonConverters.fromJson(json['Checks'],'List<CoveragePtoCheck>',context!);
        DenyReason = json['DenyReason'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'WorkerTimeOffID': WorkerTimeOffID,
        'ContactId': ContactId,
        'WorkerName': WorkerName,
        'Initials': Initials,
        'Dates': Dates,
        'Reason': Reason,
        'Stage': Stage,
        'StageLabel': StageLabel,
        'NeedBook': NeedBook,
        'CoverageGapId': CoverageGapId,
        'Checks': JsonConverters.toJson(Checks,'List<CoveragePtoCheck>',context!),
        'DenyReason': DenyReason
    };

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

class CoveragePlannedResponse implements IConvertible
{
    List<CoveragePlannedItem>? Items = [];
    ResponseStatus? ResponseStatus;

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

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

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

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

class CoveragePtoDecideRequest implements IConvertible
{
    int? WorkerTimeOffID;
    bool? Approve;
    String? DenyReason;

    CoveragePtoDecideRequest({this.WorkerTimeOffID,this.Approve,this.DenyReason});
    CoveragePtoDecideRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'WorkerTimeOffID': WorkerTimeOffID,
        'Approve': Approve,
        'DenyReason': DenyReason
    };

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

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

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

POST /v1/coverage/pto/{WorkerTimeOffID}/decide HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	WorkerTimeOffID: 0,
	Approve: False,
	DenyReason: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Items: 
	[
		{
			WorkerTimeOffID: 0,
			ContactId: 0,
			WorkerName: String,
			Initials: String,
			Dates: String,
			Reason: String,
			Stage: String,
			StageLabel: String,
			NeedBook: False,
			CoverageGapId: 0,
			Checks: 
			[
				{
					Ok: False,
					Text: String
				}
			],
			DenyReason: String
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}