Trendsic Platform Service

<back to all web services

DispatchModulesSaveRequest

Requires Authentication
The following routes are available for this service:
PUT,OPTIONS/v1/dispatch/settings/modules
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchModuleView:
    key: Optional[str] = None
    mode: Optional[str] = None
    allowed: bool = False
    enabled: bool = False
    in_flight: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchPatternView:
    pattern_id: Optional[str] = None
    name: Optional[str] = None
    source: Optional[str] = None
    facility: Optional[str] = None
    unit: Optional[str] = None
    has_quotas: bool = False
    is_inverted: bool = False
    load_limit_mins: int = 0
    ticket_source: Optional[str] = None
    pay_basis: Optional[str] = None
    is_active: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchModulesResponse:
    modules: List[DispatchModuleView] = field(default_factory=list)
    patterns: List[DispatchPatternView] = field(default_factory=list)
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchModulesSaveRequest:
    key: Optional[str] = None
    enabled: bool = False

Python DispatchModulesSaveRequest 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.

PUT /v1/dispatch/settings/modules HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Key: String,
	Enabled: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Modules: 
	[
		{
			Key: String,
			Mode: String,
			Allowed: False,
			Enabled: False,
			InFlight: 0
		}
	],
	Patterns: 
	[
		{
			PatternId: String,
			Name: String,
			Source: String,
			Facility: String,
			Unit: String,
			HasQuotas: False,
			IsInverted: False,
			LoadLimitMins: 0,
			TicketSource: String,
			PayBasis: String,
			IsActive: False
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}