GET | /config/{Category} |
---|
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 Entity(IEntity):
id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Country:
name: Optional[str] = None
languages: Optional[Dict[str, str]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ListItem(Entity):
list_id: Optional[str] = None
country: Optional[str] = None
related_id: Optional[str] = None
code: Optional[str] = None
custom: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SiteSection:
route: Optional[str] = None
public: Optional[bool] = None
parent: Optional[str] = None
roles: Optional[int] = None
hide_from: Optional[List[str]] = None
order: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Configuration(Entity):
category: Optional[str] = None
countries: Optional[Dict[str, Country]] = None
list_items: Optional[List[ListItem]] = None
list_relationships: Optional[Dict[str, str]] = None
section_elements: Optional[Dict[str, List[str]]] = None
site_structure: Optional[Dict[str, SiteSection]] = None
version: Optional[int] = None
created_by: Optional[str] = None
date_created: Optional[datetime.datetime] = None
updated_by: Optional[str] = None
date_updated: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConfigurationByCategoryReq:
category: Optional[str] = None
Python ConfigurationByCategoryReq DTOs
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.
GET /config/{Category} HTTP/1.1 Host: hcbtas-q-albamfs-api.azurewebsites.net Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { category: String, countries: { String: { name: String, languages: { String: String } } }, listItems: [ { listId: String, country: String, relatedId: String, code: String, custom: String, id: String } ], listRelationships: { String: String }, sectionElements: { String: [ String ] }, siteStructure: { String: { route: String, public: False, parent: String, roles: 0, hideFrom: [ String ], order: 0 } }, version: 0, createdBy: String, dateCreated: 0001-01-01, updatedBy: String, dateUpdated: 0001-01-01, id: String }