Mds.Api

<back to all web services

DiagramSingle

Requires Authentication
Requires any of the roles:dealer-api-mds, dealer-api-nop
The following routes are available for this service:
All Verbs/diagram-single/{DiagramId}
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 Coordinate:
    x1: int = 0
    y1: int = 0
    x2: int = 0
    y2: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MyobStockItemMapping:
    stock_item_id: int = 0
    id: int = 0
    number: int = 0
    inventory_id: Optional[str] = None
    group_id: int = 0
    name: Optional[str] = None
    retail_price: Optional[Decimal] = None
    dealer_price: Optional[Decimal] = None
    trade_price: Optional[Decimal] = None
    retail_price_nz: Optional[Decimal] = None
    trade_price_nz: Optional[Decimal] = None
    dealer_price_nz: Optional[Decimal] = None
    sales_uom: Optional[str] = None
    stocking_indicator: Optional[str] = None
    color: Optional[str] = None
    color_code: Optional[str] = None
    note_text: Optional[str] = None
    coordinates: Optional[List[Coordinate]] = None
    part_quantity: int = 0
    avaiable_quantity: int = 0
    show_availability_pop_up: bool = False
    is_fd: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DiagramSingleResponse:
    response_status: Optional[ResponseStatus] = None
    parts: Optional[List[MyobStockItemMapping]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DiagramSingle:
    diagram_id: int = 0

Python DiagramSingle 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 /diagram-single/{DiagramId} HTTP/1.1 
Host: mds-api.mojomotorcycles.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	DiagramId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Parts: 
	[
		{
			StockItemId: 0,
			Id: 0,
			Number: 0,
			InventoryId: String,
			GroupId: 0,
			Name: String,
			RetailPrice: 0,
			DealerPrice: 0,
			TradePrice: 0,
			RetailPriceNz: 0,
			TradePriceNz: 0,
			DealerPriceNz: 0,
			SalesUom: String,
			StockingIndicator: String,
			Color: String,
			ColorCode: String,
			NoteText: String,
			Coordinates: 
			[
				{
					x1: 0,
					y1: 0,
					x2: 0,
					y2: 0
				}
			],
			PartQuantity: 0,
			AvaiableQuantity: 0,
			ShowAvailabilityPopUp: False,
			IsFd: False
		}
	]
}