GET | /orgs/{Id}/admin |
---|
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 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 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 OrganizationMemberInvite:
id: int = 0
organization_id: int = 0
user_id: int = 0
user_name: Optional[str] = None
dismissed: Optional[datetime.datetime] = None
class FlagType(str, Enum):
VIOLATION = 'Violation'
SPAM = 'Spam'
ABUSIVE = 'Abusive'
CONFIDENTIAL = 'Confidential'
OFF_TOPIC = 'OffTopic'
OTHER = 'Other'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PostReportInfo:
id: int = 0
organization_id: int = 0
post_id: int = 0
user_id: int = 0
user_name: Optional[str] = None
flag_type: Optional[FlagType] = None
report_notes: Optional[str] = None
created: datetime.datetime = datetime.datetime(1, 1, 1)
acknowledged: Optional[datetime.datetime] = None
acknowledged_by: Optional[str] = None
dismissed: Optional[datetime.datetime] = None
dismissed_by: Optional[str] = None
title: Optional[str] = None
report_count: int = 0
created_by: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PostCommentReportInfo:
id: int = 0
organization_id: int = 0
post_id: int = 0
post_comment_id: int = 0
user_id: int = 0
user_name: Optional[str] = None
flag_type: Optional[FlagType] = None
report_notes: Optional[str] = None
created: datetime.datetime = datetime.datetime(1, 1, 1)
acknowledged: Optional[datetime.datetime] = None
acknowledged_by: Optional[str] = None
dismissed: Optional[datetime.datetime] = None
dismissed_by: Optional[str] = None
content_html: Optional[str] = None
report_count: int = 0
created_by: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetOrganizationAdminResponse:
labels: Optional[List[OrganizationLabel]] = None
members: Optional[List[OrganizationMember]] = None
member_invites: Optional[List[OrganizationMemberInvite]] = None
reported_posts: Optional[List[PostReportInfo]] = None
reported_post_comments: Optional[List[PostCommentReportInfo]] = None
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetOrganizationAdmin(IGet):
id: int = 0
Python GetOrganizationAdmin DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /orgs/{Id}/admin HTTP/1.1 Host: techstacks.io Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"labels":[{"slug":"String","organizationId":0,"description":"String","color":"String"}],"members":[{"id":0,"organizationId":0,"userId":0,"userName":"String","isOwner":false,"isModerator":false,"denyAll":false,"denyPosts":false,"denyComments":false,"notes":"String"}],"memberInvites":[{"id":0,"organizationId":0,"userId":0,"userName":"String","dismissed":"0001-01-01T00:00:00.0000000"}],"reportedPosts":[{"id":0,"organizationId":0,"postId":0,"userId":0,"userName":"String","flagType":"Violation","reportNotes":"String","created":"0001-01-01T00:00:00.0000000","acknowledged":"0001-01-01T00:00:00.0000000","acknowledgedBy":"String","dismissed":"0001-01-01T00:00:00.0000000","dismissedBy":"String","title":"String","reportCount":0,"createdBy":"String"}],"reportedPostComments":[{"id":0,"organizationId":0,"postId":0,"postCommentId":0,"userId":0,"userName":"String","flagType":"Violation","reportNotes":"String","created":"0001-01-01T00:00:00.0000000","acknowledged":"0001-01-01T00:00:00.0000000","acknowledgedBy":"String","dismissed":"0001-01-01T00:00:00.0000000","dismissedBy":"String","contentHtml":"String","reportCount":0,"createdBy":"String"}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}