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

<CourierBookPageResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Page>
    <AppUrl>String</AppUrl>
    <Available>false</Available>
    <BookingOn>false</BookingOn>
    <Business>
      <Name>String</Name>
      <Phone>String</Phone>
    </Business>
    <CardEnabled>false</CardEnabled>
    <NowMin>0</NowMin>
    <Profile>
      <Asap>false</Asap>
      <CancelFee>0</CancelFee>
      <Code>String</Code>
      <FacilityName>String</FacilityName>
      <FacilityNoun>String</FacilityNoun>
      <FacilityNounEs>String</FacilityNounEs>
      <FinalAfterCount>false</FinalAfterCount>
      <Handoffs>
        <CodeRequired>false</CodeRequired>
        <Desk>false</Desk>
        <Hand>false</Hand>
        <IdRequired>false</IdRequired>
        <Porch>false</Porch>
        <SigRequired>false</SigRequired>
      </Handoffs>
      <Levels>
        <CourierBookLevel>
          <Code>String</Code>
          <Days xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:int>0</d6p1:int>
          </Days>
          <DeadlineMin>0</DeadlineMin>
          <InBy>String</InBy>
          <Name>String</Name>
          <Ready>String</Ready>
          <Surcharge>0</Surcharge>
          <WithinMin>0</WithinMin>
        </CourierBookLevel>
      </Levels>
      <MissedFee>0</MissedFee>
      <MissedWaitMin>0</MissedWaitMin>
      <Name>String</Name>
      <PayTiming>String</PayTiming>
      <Recurring>false</Recurring>
      <ServiceArea xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </ServiceArea>
      <Shape>String</Shape>
      <Template>String</Template>
      <UnitMany>String</UnitMany>
      <UnitManyEs>String</UnitManyEs>
      <UnitOne>String</UnitOne>
      <UnitOneEs>String</UnitOneEs>
      <Zips xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Zips>
    </Profile>
    <Profiles>
      <CourierBookProfileLink>
        <Code>String</Code>
        <Name>String</Name>
        <Shape>String</Shape>
      </CourierBookProfileLink>
    </Profiles>
    <PublishableKey>String</PublishableKey>
    <Today>String</Today>
    <Weekday>0</Weekday>
  </Page>
  <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>
</CourierBookPageResponse>