Coverage for arbejdstimer/api_auto_derive.py: 0.00%
28 statements
« prev ^ index » next coverage.py v7.0.1, created at 2023-01-02 19:01 +0100
« prev ^ index » next coverage.py v7.0.1, created at 2023-01-02 19:01 +0100
1# generated by datamodel-codegen:
2# filename: arbejdstimer-configuration-schema.json
3# timestamp: 2021-12-29T17:22:42+00:00
5from __future__ import annotations
7from datetime import date
8from enum import Enum
9from typing import Annotated, List, Optional
11from pydantic import BaseModel, Field
14class Application(Enum):
15 arbejdstimer = 'arbejdstimer'
18class Operator(Enum):
19 and_ = 'and'
20 or_ = 'or'
21 xor = 'xor'
24class WorkingHoursTypeItem(BaseModel):
25 __root__: Annotated[int, Field(ge=0.0, le=23.0)]
28class WorkingHoursType(BaseModel):
29 __root__: Annotated[
30 List[WorkingHoursTypeItem],
31 Field(
32 description='Inclusive range of 24 hour start and end integer values.',
33 max_items=2,
34 min_items=2,
35 title='Working Hours',
36 ),
37 ]
40class Dates(BaseModel):
41 __root__: Annotated[
42 List[date],
43 Field(
44 description='Two dates are an inclusive range and 1, 3, or more dates represent a set of dates.',
45 min_items=1,
46 title='Dates - Range or Set',
47 ),
48 ]
51class HolidaysTypeItem(BaseModel):
52 label: Annotated[Optional[str], Field(examples=['public holiday'])] = ''
53 at: Dates
56class HolidaysType(BaseModel):
57 __root__: Annotated[
58 List[HolidaysTypeItem],
59 Field(
60 description='Optionally labeled dates of non-working days.',
61 min_items=0,
62 title='Holidays',
63 ),
64 ]
67class Arbejdstimer(BaseModel):
68 api: Annotated[
69 Optional[int],
70 Field(
71 description='API version of the application this configuration targets.',
72 title='API Version',
73 ),
74 ] = 1
75 application: Annotated[
76 Optional[Application],
77 Field(
78 description='Name of the application this configuration targets.',
79 title='Application Name',
80 ),
81 ] = 'arbejdstimer' # type: ignore
82 operator: Annotated[
83 Operator,
84 Field(
85 description='Logic combining the given specific values with the application defaults.',
86 title='Logic for Combination with Default Values',
87 ),
88 ]
89 holidays: Optional[HolidaysType] = None
90 working_hours: Optional[WorkingHoursType] = None