| POST | /acknowlegement/{SubscriptionId}/{CendynPropertyId} |
|---|
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 Response:
status_code: Optional[str] = None
record_count: Optional[int] = None
error_count: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UniqueIDType:
id: Optional[str] = None
type: Optional[str] = None
context: Optional[str] = None
class StatusMessageType(str, Enum):
INFO = 'Info'
WARNING = 'Warning'
ERROR = 'Error'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class StatusMessage:
message_type: Optional[StatusMessageType] = None
code: Optional[str] = None
message: Optional[str] = None
target: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Acknowledgement:
cendyn_property_i_d: Optional[str] = None
hotel_code: Optional[str] = None
success: Optional[bool] = None
echo_token: Optional[str] = None
unique_i_ds: Optional[List[UniqueIDType]] = None
messages: Optional[List[StatusMessage]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MessageAcknowledgement:
acknowledgement: Optional[Acknowledgement] = None
subscription_id: Optional[str] = None
cendyn_property_id: Optional[str] = None
Python MessageAcknowledgement 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 /acknowlegement/{SubscriptionId}/{CendynPropertyId} HTTP/1.1
Host: cert.cendyn.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"acknowledgement":{"cendynPropertyID":"String","hotelCode":"String","success":false,"echoToken":"String","uniqueIDs":[{"id":"String","type":"String","context":"String"}],"messages":[{"messageType":"Info","code":"String","message":"String","target":"String"}]},"subscriptionId":"String","cendynPropertyId":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"statusCode":"String","recordCount":0,"errorCount":0}