Пример #1
0
class TimeRange(BaseSchema):
    start = fields.Time(
        required=True,
        example="14:00",
        description="The start time of the period's time range",
    )
    end = fields.Time(
        required=True,
        example="16:00",
        description="The end time of the period's time range",
    )
Пример #2
0
    friendlyName = fields.Str(
        required=True,
        description=
        "(optional) the user's name in a form suitable to be rendered in a UI.",
    )
    email = fields.Str(
        description="(optional) the user's email address, if known")
    roles = fields.List(
        fields.Str(),
        description=
        "list of unique role names that apply to this user (can be empty).",
    )


TIME_FIELD = fields.Time(
    example="14:00",
    description="The hour of the time period.",
)


class ConcreteTimeRange(BaseSchema):
    start = TIME_FIELD
    end = TIME_FIELD


class ConcreteTimeRangeActive(BaseSchema):
    day = fields.String(
        description="The day for which the time ranges are specified",
        pattern=f"{'|'.join(weekday_ids())}")
    time_ranges = fields.List(fields.Nested(ConcreteTimeRange))