""" Options: Date: 2024-12-22 12:18:01 Version: 8.51 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://techstacks.io #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: QueryPosts.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ 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 class PostType(str, Enum): ANNOUNCEMENT = 'Announcement' POST = 'Post' SHOWCASE = 'Showcase' QUESTION = 'Question' REQUEST = 'Request' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Post: id: int = 0 organization_id: int = 0 user_id: int = 0 type: Optional[PostType] = None category_id: int = 0 title: Optional[str] = None slug: Optional[str] = None url: Optional[str] = None image_url: Optional[str] = None # @StringLength(2147483647) content: Optional[str] = None # @StringLength(2147483647) content_html: Optional[str] = None pin_comment_id: Optional[int] = None technology_ids: Optional[List[int]] = None from_date: Optional[datetime.datetime] = None to_date: Optional[datetime.datetime] = None location: Optional[str] = None meta_type: Optional[str] = None meta: Optional[str] = None approved: bool = False up_votes: int = 0 down_votes: int = 0 points: int = 0 views: int = 0 favorites: int = 0 subscribers: int = 0 reply_count: int = 0 comments_count: int = 0 word_count: int = 0 report_count: int = 0 links_count: int = 0 linked_to_count: int = 0 score: int = 0 rank: int = 0 labels: Optional[List[str]] = None ref_user_ids: Optional[List[int]] = None ref_links: Optional[List[str]] = None mute_user_ids: Optional[List[int]] = None last_comment_date: Optional[datetime.datetime] = None last_comment_id: Optional[int] = None last_comment_user_id: Optional[int] = None deleted: Optional[datetime.datetime] = None deleted_by: Optional[str] = None locked: Optional[datetime.datetime] = None locked_by: Optional[str] = None hidden: Optional[datetime.datetime] = None hidden_by: Optional[str] = None status: Optional[str] = None status_date: Optional[datetime.datetime] = None status_by: Optional[str] = None archived: bool = False bumped: Optional[datetime.datetime] = None created: datetime.datetime = datetime.datetime(1, 1, 1) created_by: Optional[str] = None modified: datetime.datetime = datetime.datetime(1, 1, 1) modified_by: Optional[str] = None ref_id: Optional[int] = None ref_source: Optional[str] = None ref_urn: Optional[str] = None # @Route("/posts", "GET") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class QueryPosts(QueryDb[Post], IReturn[QueryResponse[Post]]): ids: Optional[List[int]] = None organization_id: Optional[int] = None organization_ids: Optional[List[int]] = None types: Optional[List[str]] = None any_technology_ids: Optional[List[int]] = None is_: Optional[List[str]] = field(metadata=config(field_name='is'), default=None)