| Required permission: | manage_equipment |
| POST | /equipment/{Id}/approve |
|---|
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 Equipment:
id: int = 0
# @Required()
# @StringLength(500)
name: Optional[str] = None
# @StringLength(1000)
image_url: Optional[str] = None
description: Optional[str] = None
# @StringLength(50)
unit: Optional[str] = None
material_type_id: Optional[int] = None
status: int = 0
is_deleted: Optional[bool] = None
approved_at: Optional[datetime.datetime] = None
approved_by: Optional[int] = None
created_at: Optional[datetime.datetime] = None
created_by: Optional[int] = None
updated_at: Optional[datetime.datetime] = None
updated_by: Optional[int] = None
# @Ignore()
material_type_name: Optional[str] = None
# @Ignore()
created_by_name: Optional[str] = None
# @Ignore()
approved_by_name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApproveEquipmentRequest:
id: int = 0
approve: bool = False
Python ApproveEquipmentRequest DTOs
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 /equipment/{Id}/approve HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"id":0,"approve":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"id":0,"name":"String","imageUrl":"String","description":"String","unit":"String","materialTypeId":0,"status":0,"isDeleted":false,"approvedAt":"0001-01-01T00:00:00.0000000+07:06","approvedBy":0,"createdAt":"0001-01-01T00:00:00.0000000+07:06","createdBy":0,"updatedAt":"0001-01-01T00:00:00.0000000+07:06","updatedBy":0,"materialTypeName":"String","createdByName":"String","approvedByName":"String"}