Skip to content

api

api

ExportParameters dataclass

Bases: BaseInterface

The serializable request parameters which are accepted by the exporter service.

Source code in src/qgis_server_light/interface/exporter/api.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@dataclass(repr=False)
class ExportParameters(BaseInterface):
    """
    The serializable request parameters which are accepted by the exporter service.
    """

    mandant: str = field(metadata={"type": "Element"})
    project: str = field(metadata={"type": "Element"})
    unify_layer_names_by_group: bool = field(
        metadata={"type": "Element"}, default=False
    )
    output_format: str = field(metadata={"type": "Element"}, default="json")
    pg_service_configs: list[PgServiceConf] = field(
        metadata={"type": "Element"}, default_factory=list
    )

    @property
    def pg_service_configs_dict(self) -> dict:
        configurations = {}
        for config in self.pg_service_configs:
            configurations[config.name] = {
                "host": config.host,
                "port": config.port,
                "user": config.user,
                "dbname": config.dbname,
                "password": config.password,
                "sslmode": config.sslmode,
                "application_name": config.application_name,
                "client_encoding": config.client_encoding,
                "service": config.service,
            }
        return configurations

mandant: str = field(metadata={'type': 'Element'}) class-attribute instance-attribute

output_format: str = field(metadata={'type': 'Element'}, default='json') class-attribute instance-attribute

pg_service_configs: list[PgServiceConf] = field(metadata={'type': 'Element'}, default_factory=list) class-attribute instance-attribute

pg_service_configs_dict: dict property

project: str = field(metadata={'type': 'Element'}) class-attribute instance-attribute

unify_layer_names_by_group: bool = field(metadata={'type': 'Element'}, default=False) class-attribute instance-attribute

__init__(mandant: str, project: str, unify_layer_names_by_group: bool = False, output_format: str = 'json', pg_service_configs: list[PgServiceConf] = list()) -> None

ExportResult dataclass

Bases: BaseInterface

The serializable response which is provided by the exporter service.

Source code in src/qgis_server_light/interface/exporter/api.py
42
43
44
45
46
47
48
@dataclass(repr=False)
class ExportResult(BaseInterface):
    """
    The serializable response which is provided by the exporter service.
    """

    successful: bool = field(metadata={"type": "Element"})

successful: bool = field(metadata={'type': 'Element'}) class-attribute instance-attribute

__init__(successful: bool) -> None