PUT | /unit | ||
---|---|---|---|
PUT | /unit/{Id} | ||
GET POST | /UpdateUnit | ||
GET POST | /UpdateUnit/{Id} |
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 UpdateUnitResponse:
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateUnit:
id: Optional[str] = None
name: Optional[str] = None
reference_number: Optional[str] = None
client_id: Optional[str] = None
category_id: Optional[str] = None
vehicle_type: Optional[str] = None
pre_km: Optional[float] = None
pre_run1: Optional[float] = None
pre_run2: Optional[float] = None
note: Optional[str] = None
is_active: Optional[bool] = None
input1_name: Optional[str] = None
input2_name: Optional[str] = None
input3_name: Optional[str] = None
input4_name: Optional[str] = None
lock: Optional[bool] = None
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /UpdateUnit HTTP/1.1
Host: api.trackunit.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"id":"String","name":"String","referenceNumber":"String","clientId":"String","categoryId":"String","vehicleType":"String","preKm":0,"preRun1":0,"preRun2":0,"note":"String","isActive":false,"input1Name":"String","input2Name":"String","input3Name":"String","input4Name":"String","lock":false}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}