Trendsic Platform Service

<back to all web services

CourierBookPageRequest

The following routes are available for this service:
GET,OPTIONS/v1/book/{Slug}
import 'package:servicestack/servicestack.dart';

class CourierTrackBusiness implements IConvertible
{
    String? Name;
    String? Phone;

    CourierTrackBusiness({this.Name,this.Phone});
    CourierTrackBusiness.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class CourierBookLevel implements IConvertible
{
    String? Code;
    String? Name;
    String? Ready;
    int? WithinMin;
    String? InBy;
    double? Surcharge;
    List<int>? Days = [];
    int? DeadlineMin;

    CourierBookLevel({this.Code,this.Name,this.Ready,this.WithinMin,this.InBy,this.Surcharge,this.Days,this.DeadlineMin});
    CourierBookLevel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Code = json['Code'];
        Name = json['Name'];
        Ready = json['Ready'];
        WithinMin = json['WithinMin'];
        InBy = json['InBy'];
        Surcharge = JsonConverters.toDouble(json['Surcharge']);
        Days = JsonConverters.fromJson(json['Days'],'List<int>',context!);
        DeadlineMin = json['DeadlineMin'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Code': Code,
        'Name': Name,
        'Ready': Ready,
        'WithinMin': WithinMin,
        'InBy': InBy,
        'Surcharge': Surcharge,
        'Days': JsonConverters.toJson(Days,'List<int>',context!),
        'DeadlineMin': DeadlineMin
    };

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

class HandoffOptions implements IConvertible
{
    bool? Hand;
    bool? Porch;
    bool? Desk;
    bool? SigRequired;
    bool? IdRequired;
    bool? CodeRequired;

    HandoffOptions({this.Hand,this.Porch,this.Desk,this.SigRequired,this.IdRequired,this.CodeRequired});
    HandoffOptions.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Hand = json['Hand'];
        Porch = json['Porch'];
        Desk = json['Desk'];
        SigRequired = json['SigRequired'];
        IdRequired = json['IdRequired'];
        CodeRequired = json['CodeRequired'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Hand': Hand,
        'Porch': Porch,
        'Desk': Desk,
        'SigRequired': SigRequired,
        'IdRequired': IdRequired,
        'CodeRequired': CodeRequired
    };

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

class CourierBookProfile implements IConvertible
{
    String? Code;
    String? Name;
    String? Shape;
    String? Template;
    String? UnitOne;
    String? UnitMany;
    String? UnitOneEs;
    String? UnitManyEs;
    String? FacilityNoun;
    String? FacilityNounEs;
    String? FacilityName;
    List<CourierBookLevel>? Levels = [];
    bool? Asap;
    bool? Recurring;
    String? PayTiming;
    bool? FinalAfterCount;
    double? CancelFee;
    double? MissedFee;
    int? MissedWaitMin;
    List<String>? ServiceArea = [];
    List<String>? Zips = [];
    HandoffOptions? Handoffs;

    CourierBookProfile({this.Code,this.Name,this.Shape,this.Template,this.UnitOne,this.UnitMany,this.UnitOneEs,this.UnitManyEs,this.FacilityNoun,this.FacilityNounEs,this.FacilityName,this.Levels,this.Asap,this.Recurring,this.PayTiming,this.FinalAfterCount,this.CancelFee,this.MissedFee,this.MissedWaitMin,this.ServiceArea,this.Zips,this.Handoffs});
    CourierBookProfile.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Code = json['Code'];
        Name = json['Name'];
        Shape = json['Shape'];
        Template = json['Template'];
        UnitOne = json['UnitOne'];
        UnitMany = json['UnitMany'];
        UnitOneEs = json['UnitOneEs'];
        UnitManyEs = json['UnitManyEs'];
        FacilityNoun = json['FacilityNoun'];
        FacilityNounEs = json['FacilityNounEs'];
        FacilityName = json['FacilityName'];
        Levels = JsonConverters.fromJson(json['Levels'],'List<CourierBookLevel>',context!);
        Asap = json['Asap'];
        Recurring = json['Recurring'];
        PayTiming = json['PayTiming'];
        FinalAfterCount = json['FinalAfterCount'];
        CancelFee = JsonConverters.toDouble(json['CancelFee']);
        MissedFee = JsonConverters.toDouble(json['MissedFee']);
        MissedWaitMin = json['MissedWaitMin'];
        ServiceArea = JsonConverters.fromJson(json['ServiceArea'],'List<String>',context!);
        Zips = JsonConverters.fromJson(json['Zips'],'List<String>',context!);
        Handoffs = JsonConverters.fromJson(json['Handoffs'],'HandoffOptions',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Code': Code,
        'Name': Name,
        'Shape': Shape,
        'Template': Template,
        'UnitOne': UnitOne,
        'UnitMany': UnitMany,
        'UnitOneEs': UnitOneEs,
        'UnitManyEs': UnitManyEs,
        'FacilityNoun': FacilityNoun,
        'FacilityNounEs': FacilityNounEs,
        'FacilityName': FacilityName,
        'Levels': JsonConverters.toJson(Levels,'List<CourierBookLevel>',context!),
        'Asap': Asap,
        'Recurring': Recurring,
        'PayTiming': PayTiming,
        'FinalAfterCount': FinalAfterCount,
        'CancelFee': CancelFee,
        'MissedFee': MissedFee,
        'MissedWaitMin': MissedWaitMin,
        'ServiceArea': JsonConverters.toJson(ServiceArea,'List<String>',context!),
        'Zips': JsonConverters.toJson(Zips,'List<String>',context!),
        'Handoffs': JsonConverters.toJson(Handoffs,'HandoffOptions',context!)
    };

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

class CourierBookProfileLink implements IConvertible
{
    String? Code;
    String? Name;
    String? Shape;

    CourierBookProfileLink({this.Code,this.Name,this.Shape});
    CourierBookProfileLink.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Code': Code,
        'Name': Name,
        'Shape': Shape
    };

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

class CourierBookPageView implements IConvertible
{
    bool? Available;
    bool? BookingOn;
    CourierTrackBusiness? Business;
    CourierBookProfile? Profile;
    List<CourierBookProfileLink>? Profiles = [];
    bool? CardEnabled;
    String? PublishableKey;
    String? AppUrl;
    String? Today;
    int? Weekday;
    int? NowMin;

    CourierBookPageView({this.Available,this.BookingOn,this.Business,this.Profile,this.Profiles,this.CardEnabled,this.PublishableKey,this.AppUrl,this.Today,this.Weekday,this.NowMin});
    CourierBookPageView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Available = json['Available'];
        BookingOn = json['BookingOn'];
        Business = JsonConverters.fromJson(json['Business'],'CourierTrackBusiness',context!);
        Profile = JsonConverters.fromJson(json['Profile'],'CourierBookProfile',context!);
        Profiles = JsonConverters.fromJson(json['Profiles'],'List<CourierBookProfileLink>',context!);
        CardEnabled = json['CardEnabled'];
        PublishableKey = json['PublishableKey'];
        AppUrl = json['AppUrl'];
        Today = json['Today'];
        Weekday = json['Weekday'];
        NowMin = json['NowMin'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Available': Available,
        'BookingOn': BookingOn,
        'Business': JsonConverters.toJson(Business,'CourierTrackBusiness',context!),
        'Profile': JsonConverters.toJson(Profile,'CourierBookProfile',context!),
        'Profiles': JsonConverters.toJson(Profiles,'List<CourierBookProfileLink>',context!),
        'CardEnabled': CardEnabled,
        'PublishableKey': PublishableKey,
        'AppUrl': AppUrl,
        'Today': Today,
        'Weekday': Weekday,
        'NowMin': NowMin
    };

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

class CourierBookPageResponse implements IConvertible
{
    CourierBookPageView? Page;
    ResponseStatus? ResponseStatus;

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

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

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

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

class CourierBookPageRequest implements IConvertible
{
    String? Slug;
    String? Profile;

    CourierBookPageRequest({this.Slug,this.Profile});
    CourierBookPageRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CourierTrackBusiness': TypeInfo(TypeOf.Class, create:() => CourierTrackBusiness()),
    'CourierBookLevel': TypeInfo(TypeOf.Class, create:() => CourierBookLevel()),
    'HandoffOptions': TypeInfo(TypeOf.Class, create:() => HandoffOptions()),
    'CourierBookProfile': TypeInfo(TypeOf.Class, create:() => CourierBookProfile()),
    'List<CourierBookLevel>': TypeInfo(TypeOf.Class, create:() => <CourierBookLevel>[]),
    'CourierBookProfileLink': TypeInfo(TypeOf.Class, create:() => CourierBookProfileLink()),
    'CourierBookPageView': TypeInfo(TypeOf.Class, create:() => CourierBookPageView()),
    'List<CourierBookProfileLink>': TypeInfo(TypeOf.Class, create:() => <CourierBookProfileLink>[]),
    'CourierBookPageResponse': TypeInfo(TypeOf.Class, create:() => CourierBookPageResponse()),
    'CourierBookPageRequest': TypeInfo(TypeOf.Class, create:() => CourierBookPageRequest()),
});

Dart CourierBookPageRequest 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/book/{Slug} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Page: 
	{
		Available: False,
		BookingOn: False,
		Business: 
		{
			Name: String,
			Phone: String
		},
		Profile: 
		{
			Code: String,
			Name: String,
			Shape: String,
			Template: String,
			UnitOne: String,
			UnitMany: String,
			UnitOneEs: String,
			UnitManyEs: String,
			FacilityNoun: String,
			FacilityNounEs: String,
			FacilityName: String,
			Levels: 
			[
				{
					Code: String,
					Name: String,
					Ready: String,
					WithinMin: 0,
					InBy: String,
					Surcharge: 0,
					Days: 
					[
						0
					],
					DeadlineMin: 0
				}
			],
			Asap: False,
			Recurring: False,
			PayTiming: String,
			FinalAfterCount: False,
			CancelFee: 0,
			MissedFee: 0,
			MissedWaitMin: 0,
			ServiceArea: 
			[
				String
			],
			Zips: 
			[
				String
			],
			Handoffs: 
			{
				Hand: False,
				Porch: False,
				Desk: False,
				SigRequired: False,
				IdRequired: False,
				CodeRequired: False
			}
		},
		Profiles: 
		[
			{
				Code: String,
				Name: String,
				Shape: String
			}
		],
		CardEnabled: False,
		PublishableKey: String,
		AppUrl: String,
		Today: String,
		Weekday: 0,
		NowMin: 0
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}