BokaMera.API.Host

<back to all web services

AccessyCodelockCallback

The following routes are available for this service:
POST/codelock/accessy/callback
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 AccessyEvent(str, Enum):
    UNKNOWN = 'Unknown'
    MEMBERSHI_P__C_R_E_A_T_E_D = 'MEMBERSHIP_CREATED'
    MEMBERSHI_P__R_E_M_O_V_E_D = 'MEMBERSHIP_REMOVED'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AccessyCodelockCallback:
    event_type: Optional[AccessyEvent] = None
    invitation_id: Optional[str] = None
    user_id: Optional[str] = None
    organization_id: Optional[str] = None


class IVirtualDirectory:
    pass


class IVirtualPathProvider:
    root_directory: Optional[IVirtualDirectory] = None
    virtual_path_separator: Optional[str] = None
    real_path_separator: Optional[str] = None


class IVirtualFile:
    virtual_path_provider: Optional[IVirtualPathProvider] = None
    extension: Optional[str] = None
    length: int = 0


# @Flags()
class CacheControl(IntEnum):
    NONE = 0
    PUBLIC = 1
    PRIVATE = 2
    MUST_REVALIDATE = 4
    NO_CACHE = 8
    NO_STORE = 16
    NO_TRANSFORM = 32
    PROXY_REVALIDATE = 64


class IContentTypeWriter:
    pass


class IResponse:
    original_response: Optional[Object] = None
    request: Optional[IRequest] = None
    status_code: int = 0
    status_description: Optional[str] = None
    content_type: Optional[str] = None
    output_stream: Optional[bytes] = None
    dto: Optional[Object] = None
    use_buffered_stream: bool = False
    is_closed: bool = False
    keep_alive: bool = False
    has_started: bool = False
    items: Optional[Dict[str, Object]] = None


# @Flags()
class RequestAttributes(IntEnum):
    NONE = 0
    LOCALHOST = 1
    LOCAL_SUBNET = 2
    EXTERNAL = 4
    SECURE = 8
    IN_SECURE = 16
    ANY_SECURITY_MODE = 24
    HTTP_HEAD = 32
    HTTP_GET = 64
    HTTP_POST = 128
    HTTP_PUT = 256
    HTTP_DELETE = 512
    HTTP_PATCH = 1024
    HTTP_OPTIONS = 2048
    HTTP_OTHER = 4096
    ANY_HTTP_METHOD = 8160
    ONE_WAY = 8192
    REPLY = 16384
    ANY_CALL_STYLE = 24576
    SOAP11 = 32768
    SOAP12 = 65536
    XML = 131072
    JSON = 262144
    JSV = 524288
    PROTO_BUF = 1048576
    CSV = 2097152
    HTML = 4194304
    JSONL = 8388608
    MSG_PACK = 16777216
    FORMAT_OTHER = 33554432
    ANY_FORMAT = 67076096
    HTTP = 67108864
    MESSAGE_QUEUE = 134217728
    TCP = 268435456
    GRPC = 536870912
    ENDPOINT_OTHER = 1073741824
    ANY_ENDPOINT = 2080374784
    IN_PROCESS = -2147483648
    INTERNAL_NETWORK_ACCESS = -2147483645
    ANY_NETWORK_ACCESS_TYPE = -2147483641
    ANY = -1


class IRequestPreferences:
    accepts_brotli: bool = False
    accepts_deflate: bool = False
    accepts_gzip: bool = False


class IRequest:
    original_request: Optional[Object] = None
    response: Optional[IResponse] = None
    operation_name: Optional[str] = None
    verb: Optional[str] = None
    request_attributes: Optional[RequestAttributes] = None
    request_preferences: Optional[IRequestPreferences] = None
    dto: Optional[Object] = None
    content_type: Optional[str] = None
    is_local: bool = False
    user_agent: Optional[str] = None
    cookies: Optional[Dict[str, Cookie]] = None
    response_content_type: Optional[str] = None
    has_explicit_response_content_type: bool = False
    items: Optional[Dict[str, Object]] = None
    headers: Optional[NameValueCollection] = None
    query_string: Optional[NameValueCollection] = None
    form_data: Optional[NameValueCollection] = None
    use_buffered_stream: bool = False
    raw_url: Optional[str] = None
    absolute_uri: Optional[str] = None
    user_host_address: Optional[str] = None
    remote_ip: Optional[str] = None
    authorization: Optional[str] = None
    is_secure_connection: bool = False
    accept_types: Optional[List[str]] = None
    path_info: Optional[str] = None
    original_path_info: Optional[str] = None
    input_stream: Optional[bytes] = None
    content_length: int = 0
    files: Optional[List[IHttpFile]] = None
    url_referrer: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HttpResult:
    response_text: Optional[str] = None
    response_stream: Optional[bytes] = None
    file_info: Optional[FileInfo] = None
    virtual_file: Optional[IVirtualFile] = None
    content_type: Optional[str] = None
    headers: Optional[Dict[str, str]] = None
    cookies: Optional[List[Cookie]] = None
    e_tag: Optional[str] = None
    age: Optional[datetime.timedelta] = None
    max_age: Optional[datetime.timedelta] = None
    expires: Optional[datetime.datetime] = None
    last_modified: Optional[datetime.datetime] = None
    cache_control: Optional[CacheControl] = None
    result_scope: Optional[Func[IDisposable]] = None
    allows_partial_response: bool = False
    options: Optional[Dict[str, str]] = None
    status: int = 0
    status_code: Optional[HttpStatusCode] = None
    status_description: Optional[str] = None
    response: Optional[Object] = None
    response_filter: Optional[IContentTypeWriter] = None
    request_context: Optional[IRequest] = None
    view: Optional[str] = None
    template: Optional[str] = None
    padding_length: int = 0
    is_partial_request: bool = False


class IHttpFile:
    name: Optional[str] = None
    file_name: Optional[str] = None
    content_length: int = 0
    content_type: Optional[str] = None
    input_stream: Optional[bytes] = None

Python AccessyCodelockCallback DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /codelock/accessy/callback HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"EventType":"Unknown"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{}