Trendsic Platform Service

<back to all web services

DispatchHoldCreateRequest

Requires Authentication
Requires any of the permissions:DISPATCH:HAUL:MANAGE, DISPATCH:JOB:MANAGE, DISPATCH:ONDEMAND:MANAGE
The following routes are available for this service:
POST,OPTIONS/v1/dispatch/holds
import 'package:servicestack/servicestack.dart';

class DispatchHoldView implements IConvertible
{
    int? HoldId;
    String? Code;
    String? ScopeKind;
    String? ScopeKey;
    String? ScopeLabel;
    String? Reason;
    String? Note;
    DateTime? StartUtc;
    DateTime? EndUtc;
    String? Source;
    String? IncidentRef;
    DateTime? LiftedUtc;
    String? LiftedBy;
    DateTime? CreatedUtc;
    String? CreatedBy;
    String? Status;

    DispatchHoldView({this.HoldId,this.Code,this.ScopeKind,this.ScopeKey,this.ScopeLabel,this.Reason,this.Note,this.StartUtc,this.EndUtc,this.Source,this.IncidentRef,this.LiftedUtc,this.LiftedBy,this.CreatedUtc,this.CreatedBy,this.Status});
    DispatchHoldView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        HoldId = json['HoldId'];
        Code = json['Code'];
        ScopeKind = json['ScopeKind'];
        ScopeKey = json['ScopeKey'];
        ScopeLabel = json['ScopeLabel'];
        Reason = json['Reason'];
        Note = json['Note'];
        StartUtc = JsonConverters.fromJson(json['StartUtc'],'DateTime',context!);
        EndUtc = JsonConverters.fromJson(json['EndUtc'],'DateTime',context!);
        Source = json['Source'];
        IncidentRef = json['IncidentRef'];
        LiftedUtc = JsonConverters.fromJson(json['LiftedUtc'],'DateTime',context!);
        LiftedBy = json['LiftedBy'];
        CreatedUtc = JsonConverters.fromJson(json['CreatedUtc'],'DateTime',context!);
        CreatedBy = json['CreatedBy'];
        Status = json['Status'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'HoldId': HoldId,
        'Code': Code,
        'ScopeKind': ScopeKind,
        'ScopeKey': ScopeKey,
        'ScopeLabel': ScopeLabel,
        'Reason': Reason,
        'Note': Note,
        'StartUtc': JsonConverters.toJson(StartUtc,'DateTime',context!),
        'EndUtc': JsonConverters.toJson(EndUtc,'DateTime',context!),
        'Source': Source,
        'IncidentRef': IncidentRef,
        'LiftedUtc': JsonConverters.toJson(LiftedUtc,'DateTime',context!),
        'LiftedBy': LiftedBy,
        'CreatedUtc': JsonConverters.toJson(CreatedUtc,'DateTime',context!),
        'CreatedBy': CreatedBy,
        'Status': Status
    };

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

class DispatchOfflineWindowView implements IConvertible
{
    int? OfflineWindowId;
    String? FromHour;
    String? ToHour;

    DispatchOfflineWindowView({this.OfflineWindowId,this.FromHour,this.ToHour});
    DispatchOfflineWindowView.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'OfflineWindowId': OfflineWindowId,
        'FromHour': FromHour,
        'ToHour': ToHour
    };

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

class DispatchHoldScopeView implements IConvertible
{
    String? Kind;
    String? Key;
    String? Label;

    DispatchHoldScopeView({this.Kind,this.Key,this.Label});
    DispatchHoldScopeView.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Kind': Kind,
        'Key': Key,
        'Label': Label
    };

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

class DispatchHoldSuggestionView implements IConvertible
{
    String? ForDate;
    String? Kind;
    int? Severity;
    String? Headline;
    String? DayLabel;
    String? ScopeKind;
    String? ScopeLabel;
    String? Reason;
    DateTime? StartUtc;
    DateTime? EndUtc;
    String? WindowLocal;
    String? Text;

    DispatchHoldSuggestionView({this.ForDate,this.Kind,this.Severity,this.Headline,this.DayLabel,this.ScopeKind,this.ScopeLabel,this.Reason,this.StartUtc,this.EndUtc,this.WindowLocal,this.Text});
    DispatchHoldSuggestionView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ForDate = json['ForDate'];
        Kind = json['Kind'];
        Severity = json['Severity'];
        Headline = json['Headline'];
        DayLabel = json['DayLabel'];
        ScopeKind = json['ScopeKind'];
        ScopeLabel = json['ScopeLabel'];
        Reason = json['Reason'];
        StartUtc = JsonConverters.fromJson(json['StartUtc'],'DateTime',context!);
        EndUtc = JsonConverters.fromJson(json['EndUtc'],'DateTime',context!);
        WindowLocal = json['WindowLocal'];
        Text = json['Text'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ForDate': ForDate,
        'Kind': Kind,
        'Severity': Severity,
        'Headline': Headline,
        'DayLabel': DayLabel,
        'ScopeKind': ScopeKind,
        'ScopeLabel': ScopeLabel,
        'Reason': Reason,
        'StartUtc': JsonConverters.toJson(StartUtc,'DateTime',context!),
        'EndUtc': JsonConverters.toJson(EndUtc,'DateTime',context!),
        'WindowLocal': WindowLocal,
        'Text': Text
    };

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

class DispatchHoldsResponse implements IConvertible
{
    List<DispatchHoldView>? Holds = [];
    List<DispatchOfflineWindowView>? Windows = [];
    List<DispatchHoldScopeView>? Scopes = [];
    DispatchHoldSuggestionView? Suggestion;
    ResponseStatus? ResponseStatus;

    DispatchHoldsResponse({this.Holds,this.Windows,this.Scopes,this.Suggestion,this.ResponseStatus});
    DispatchHoldsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Holds = JsonConverters.fromJson(json['Holds'],'List<DispatchHoldView>',context!);
        Windows = JsonConverters.fromJson(json['Windows'],'List<DispatchOfflineWindowView>',context!);
        Scopes = JsonConverters.fromJson(json['Scopes'],'List<DispatchHoldScopeView>',context!);
        Suggestion = JsonConverters.fromJson(json['Suggestion'],'DispatchHoldSuggestionView',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Holds': JsonConverters.toJson(Holds,'List<DispatchHoldView>',context!),
        'Windows': JsonConverters.toJson(Windows,'List<DispatchOfflineWindowView>',context!),
        'Scopes': JsonConverters.toJson(Scopes,'List<DispatchHoldScopeView>',context!),
        'Suggestion': JsonConverters.toJson(Suggestion,'DispatchHoldSuggestionView',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class DispatchHoldCreateRequest implements IConvertible
{
    String? ScopeKind;
    String? ScopeKey;
    String? ScopeLabel;
    String? Reason;
    String? Note;
    String? StartUtc;
    String? EndUtc;
    String? SuggestionDate;
    String? SuggestionKind;

    DispatchHoldCreateRequest({this.ScopeKind,this.ScopeKey,this.ScopeLabel,this.Reason,this.Note,this.StartUtc,this.EndUtc,this.SuggestionDate,this.SuggestionKind});
    DispatchHoldCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ScopeKind = json['ScopeKind'];
        ScopeKey = json['ScopeKey'];
        ScopeLabel = json['ScopeLabel'];
        Reason = json['Reason'];
        Note = json['Note'];
        StartUtc = json['StartUtc'];
        EndUtc = json['EndUtc'];
        SuggestionDate = json['SuggestionDate'];
        SuggestionKind = json['SuggestionKind'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ScopeKind': ScopeKind,
        'ScopeKey': ScopeKey,
        'ScopeLabel': ScopeLabel,
        'Reason': Reason,
        'Note': Note,
        'StartUtc': StartUtc,
        'EndUtc': EndUtc,
        'SuggestionDate': SuggestionDate,
        'SuggestionKind': SuggestionKind
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'DispatchHoldView': TypeInfo(TypeOf.Class, create:() => DispatchHoldView()),
    'DispatchOfflineWindowView': TypeInfo(TypeOf.Class, create:() => DispatchOfflineWindowView()),
    'DispatchHoldScopeView': TypeInfo(TypeOf.Class, create:() => DispatchHoldScopeView()),
    'DispatchHoldSuggestionView': TypeInfo(TypeOf.Class, create:() => DispatchHoldSuggestionView()),
    'DispatchHoldsResponse': TypeInfo(TypeOf.Class, create:() => DispatchHoldsResponse()),
    'List<DispatchHoldView>': TypeInfo(TypeOf.Class, create:() => <DispatchHoldView>[]),
    'List<DispatchOfflineWindowView>': TypeInfo(TypeOf.Class, create:() => <DispatchOfflineWindowView>[]),
    'List<DispatchHoldScopeView>': TypeInfo(TypeOf.Class, create:() => <DispatchHoldScopeView>[]),
    'DispatchHoldCreateRequest': TypeInfo(TypeOf.Class, create:() => DispatchHoldCreateRequest()),
});

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

POST /v1/dispatch/holds HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<DispatchHoldCreateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <EndUtc>String</EndUtc>
  <Note>String</Note>
  <Reason>String</Reason>
  <ScopeKey>String</ScopeKey>
  <ScopeKind>String</ScopeKind>
  <ScopeLabel>String</ScopeLabel>
  <StartUtc>String</StartUtc>
  <SuggestionDate>String</SuggestionDate>
  <SuggestionKind>String</SuggestionKind>
</DispatchHoldCreateRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DispatchHoldsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Holds>
    <DispatchHoldView>
      <Code>String</Code>
      <CreatedBy>String</CreatedBy>
      <CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
      <EndUtc>0001-01-01T00:00:00</EndUtc>
      <HoldId>0</HoldId>
      <IncidentRef>String</IncidentRef>
      <LiftedBy>String</LiftedBy>
      <LiftedUtc>0001-01-01T00:00:00</LiftedUtc>
      <Note>String</Note>
      <Reason>String</Reason>
      <ScopeKey>String</ScopeKey>
      <ScopeKind>String</ScopeKind>
      <ScopeLabel>String</ScopeLabel>
      <Source>String</Source>
      <StartUtc>0001-01-01T00:00:00</StartUtc>
      <Status>String</Status>
    </DispatchHoldView>
  </Holds>
  <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>
  <Scopes>
    <DispatchHoldScopeView>
      <Key>String</Key>
      <Kind>String</Kind>
      <Label>String</Label>
    </DispatchHoldScopeView>
  </Scopes>
  <Suggestion>
    <DayLabel>String</DayLabel>
    <EndUtc>0001-01-01T00:00:00</EndUtc>
    <ForDate>String</ForDate>
    <Headline>String</Headline>
    <Kind>String</Kind>
    <Reason>String</Reason>
    <ScopeKind>String</ScopeKind>
    <ScopeLabel>String</ScopeLabel>
    <Severity>0</Severity>
    <StartUtc>0001-01-01T00:00:00</StartUtc>
    <Text>String</Text>
    <WindowLocal>String</WindowLocal>
  </Suggestion>
  <Windows>
    <DispatchOfflineWindowView>
      <FromHour>String</FromHour>
      <OfflineWindowId>0</OfflineWindowId>
      <ToHour>String</ToHour>
    </DispatchOfflineWindowView>
  </Windows>
</DispatchHoldsResponse>