| POST | /api/v1/marketplace/animals |
|---|
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 Status:
message: Optional[str] = None
status_code: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseResponse:
status: Optional[Status] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PublishAnimalsResponse(BaseResponse):
id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PublishAnimals(IPost):
name: Optional[str] = None
phone_number: Optional[str] = None
region_id: int = 0
city_id: int = 0
category_id: int = 0
purpose_id: int = 0
description: Optional[str] = None
quantity: int = 0
price_type_id: int = 0
price: Decimal = decimal.Decimal(0)
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/v1/marketplace/animals HTTP/1.1
Host: pecuario-backend.develsystems.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
name: String,
phoneNumber: String,
regionId: 0,
cityId: 0,
categoryId: 0,
purposeId: 0,
description: String,
quantity: 0,
priceTypeId: 0,
price: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: String
}