Required role: | superadmin |
POST | /superadmin/company/{CompanyId}/comments | Adds a comment to the company. |
---|
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 CommentsType(IntEnum):
NORMAL_COMMENT = 1
CALL_BACK_PHONE_COMMENT = 2
CALL_BACK_EMAIL_COMMENT = 3
CALL_BACK_MEETING_BOOKED_COMMENT = 4
CALL_BACK_NOT_INTERESTED_COMMENT = 5
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CommentsTypeResponse:
id: int = 0
name: Optional[str] = None
description: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CompanyCommentsResponse:
# @ApiMember()
company_id: Optional[str] = None
# @ApiMember()
id: int = 0
# @ApiMember(IsRequired=true)
comment: Optional[str] = None
# @ApiMember(IsRequired=true)
comment_type_id: Optional[CommentsType] = None
# @ApiMember(IsRequired=true)
comment_type: Optional[CommentsTypeResponse] = None
# @ApiMember(Description="The updated date")
updated: datetime.datetime = datetime.datetime(1, 1, 1)
"""
The updated date
"""
# @ApiMember(Description="The created date")
created: datetime.datetime = datetime.datetime(1, 1, 1)
"""
The created date
"""
# @ApiMember(Description="The created by")
created_by: Optional[str] = None
"""
The created by
"""
# @ApiResponse(Description="", StatusCode=400)
# @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateCompanyCommentSuperAdminUser(ICompany):
# @ApiMember(Description="Enter the companyId for the customer", IsRequired=true, ParameterType="query")
company_id: Optional[str] = None
"""
Enter the companyId for the customer
"""
# @ApiMember(IsRequired=true)
comment: Optional[str] = None
# @ApiMember(IsRequired=true)
comment_type: Optional[CommentsType] = None
Python CreateCompanyCommentSuperAdminUser 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.
POST /superadmin/company/{CompanyId}/comments HTTP/1.1
Host: testapi.bokamera.se
Accept: application/json
Content-Type: application/json
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","Comment":"String","CommentType":"NormalComment"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"CompanyId":"00000000-0000-0000-0000-000000000000","Id":0,"Comment":"String","CommentTypeId":"NormalComment","CommentType":{"Id":0,"Name":"String","Description":"String"},"CreatedBy":"String"}