| All Verbs | /api/unitofmeasures/ | ||
|---|---|---|---|
| All Verbs | /api/unitofmeasures/{ApplianceId} |
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 UOMModel:
code: Optional[str] = None
name: Optional[str] = None
description: Optional[str] = None
symbol: Optional[str] = None
# @ApiResponse(Description="List of UOM codes (Unit of Measure)")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetUOMCodeListResponse:
uom_codes: Optional[List[UOMModel]] = None
response_status: Optional[ResponseStatus] = None
# @Api(Description="Get a list of UOM codes (Unit of Measure)")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetUOMCodeList:
"""
Get a list of UOM codes (Unit of Measure)
"""
# @ApiMember(DataType="Guid", Description="ApplianceId to narrow the UOM Code list down to relevant ones for the appliance.", Name="ApplianceId", ParameterType="query")
appliance_id: Optional[str] = None
"""
ApplianceId to narrow the UOM Code list down to relevant ones for the appliance.
"""
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/unitofmeasures/ HTTP/1.1
Host: pfapi.pstpf.com.au
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
UOMCodes:
[
{
Code: String,
Name: String,
Description: String,
Symbol: String
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}