GET | /organizations/{Slug} |
---|
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 Organization:
id: int = 0
name: Optional[str] = None
slug: Optional[str] = None
description: Optional[str] = None
description_html: Optional[str] = None
color: Optional[str] = None
text_color: Optional[str] = None
link_color: Optional[str] = None
background_color: Optional[str] = None
background_url: Optional[str] = None
logo_url: Optional[str] = None
hero_url: Optional[str] = None
lang: Optional[str] = None
default_post_type: Optional[str] = None
default_subscription_post_types: Optional[List[str]] = None
post_types: Optional[List[str]] = None
moderator_post_types: Optional[List[str]] = None
delete_posts_with_report_count: int = 0
disable_invites: Optional[bool] = None
up_votes: int = 0
down_votes: int = 0
views: int = 0
favorites: int = 0
subscribers: int = 0
comments_count: int = 0
posts_count: int = 0
score: int = 0
rank: int = 0
ref_id: Optional[int] = None
ref_source: Optional[str] = None
hidden: Optional[datetime.datetime] = None
hidden_by: Optional[str] = None
locked: Optional[datetime.datetime] = None
locked_by: Optional[str] = None
deleted: Optional[datetime.datetime] = None
deleted_by: Optional[str] = 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
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrganizationLabel:
slug: Optional[str] = None
organization_id: int = 0
description: Optional[str] = None
color: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Category:
id: int = 0
organization_id: int = 0
name: Optional[str] = None
slug: Optional[str] = None
description: Optional[str] = None
color: Optional[str] = None
technology_ids: Optional[List[int]] = None
comments_count: int = 0
posts_count: int = 0
score: int = 0
rank: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrganizationMember:
id: int = 0
organization_id: int = 0
user_id: int = 0
user_name: Optional[str] = None
is_owner: bool = False
is_moderator: bool = False
deny_all: bool = False
deny_posts: bool = False
deny_comments: bool = False
notes: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetOrganizationResponse:
cache: int = 0
id: int = 0
slug: Optional[str] = None
organization: Optional[Organization] = None
labels: Optional[List[OrganizationLabel]] = None
categories: Optional[List[Category]] = None
owners: Optional[List[OrganizationMember]] = None
moderators: Optional[List[OrganizationMember]] = None
members_count: int = 0
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetOrganizationBySlug(IGet):
slug: Optional[str] = None
Python GetOrganizationBySlug 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.
GET /organizations/{Slug} HTTP/1.1 Host: techstacks.io Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"cache":0,"id":0,"slug":"String","organization":{"id":0,"name":"String","slug":"String","description":"String","descriptionHtml":"String","color":"String","textColor":"String","linkColor":"String","backgroundColor":"String","backgroundUrl":"String","logoUrl":"String","heroUrl":"String","lang":"String","defaultPostType":"String","defaultSubscriptionPostTypes":["String"],"postTypes":["String"],"moderatorPostTypes":["String"],"deletePostsWithReportCount":0,"disableInvites":false,"upVotes":0,"downVotes":0,"views":0,"favorites":0,"subscribers":0,"commentsCount":0,"postsCount":0,"score":0,"rank":0,"refId":0,"refSource":"String","hidden":"0001-01-01T00:00:00.0000000","hiddenBy":"String","locked":"0001-01-01T00:00:00.0000000","lockedBy":"String","deleted":"0001-01-01T00:00:00.0000000","deletedBy":"String","created":"0001-01-01T00:00:00.0000000","createdBy":"String","modified":"0001-01-01T00:00:00.0000000","modifiedBy":"String"},"labels":[{"slug":"String","organizationId":0,"description":"String","color":"String"}],"categories":[{"id":0,"organizationId":0,"name":"String","slug":"String","description":"String","color":"String","technologyIds":[0],"commentsCount":0,"postsCount":0,"score":0,"rank":0}],"owners":[{"id":0,"organizationId":0,"userId":0,"userName":"String","isOwner":false,"isModerator":false,"denyAll":false,"denyPosts":false,"denyComments":false,"notes":"String"}],"moderators":[{"id":0,"organizationId":0,"userId":0,"userName":"String","isOwner":false,"isModerator":false,"denyAll":false,"denyPosts":false,"denyComments":false,"notes":"String"}],"membersCount":0,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}