ScannerVision Web Server

<back to all web services

GetJsonTemplateRequest

Requires Authentication
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 JsonDto:
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetJsonTemplateRequest(JsonDto):
    guid: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JsonScanSettings:
    scan_type: Optional[str] = None
    scan_type_locked: bool = False
    scan_colour: Optional[str] = None
    scan_colour_locked: bool = False
    scan_resolution: Optional[str] = None
    scan_resolution_locked: bool = False
    scan_side: Optional[str] = None
    scan_side_locked: bool = False
    scan_size: Optional[str] = None
    scan_size_locked: bool = False
    scan_orientation: Optional[str] = None
    scan_orientation_locked: bool = False
    scan_source: Optional[str] = None
    scan_source_locked: bool = False
    scan_continuously: bool = False
    scan_continuously_locked: bool = False
    is_mixed_sizes: bool = False
    is_mixed_sizes_locked: bool = False
    minimum_page_count: int = 0
    maximum_page_count: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JsonTemplate:
    name: Optional[str] = None
    description: Optional[str] = None
    guid: Optional[str] = None
    template_modification_date: datetime.datetime = datetime.datetime(1, 1, 1)
    icon_modification_date: datetime.datetime = datetime.datetime(1, 1, 1)
    icon: Optional[bytes] = None
    template_questions: Optional[List[JsonQuestion]] = None
    global_questions: Optional[List[JsonQuestion]] = None
    scan_settings: Optional[JsonScanSettings] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetJsonTemplateResponse(JsonDto):
    template: Optional[JsonTemplate] = None


class QuestionType(str, Enum):
    EDIT = 'Edit'
    LIST = 'List'
    EDIT_LIST = 'EditList'
    BROWSE = 'Browse'
    PASSWORD = 'Password'
    DATE = 'Date'
    TIME = 'Time'
    BOOLEAN = 'Boolean'
    INTEGER = 'Integer'
    DOUBLE = 'Double'
    BROWSE_LIST = 'BrowseList'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JsonQuestion:
    pl_question_type: Optional[QuestionType] = None
    question: Optional[str] = None
    tag_name: Optional[str] = None
    default: Optional[str] = None
    tool_tip: Optional[str] = None
    sample_value: Optional[str] = None
    regex: Optional[str] = None
    minimum: int = 0
    maximum: int = 0
    required: bool = False
    dynamic: bool = False
    picklist_guid: Optional[str] = None
    template_guid: Optional[str] = None
    hide_default_value: bool = False

Python GetJsonTemplateRequest 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 /csv/reply/GetJsonTemplateRequest HTTP/1.1 
Host: buildmax.org 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

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

{Unable to show example output for type 'GetJsonTemplateResponse' using the custom 'csv' filter}No parameterless constructor defined for this object.