Пример #1
0
 "mode":
 enum_type(attribute="street_network.mode"),
 "duration":
 fields.Integer(),
 "from":
 section_place(place, attribute="origin"),
 "to":
 section_place(place, attribute="destination"),
 "links":
 SectionLinks(attribute="uris"),
 "display_informations":
 PbField(display_informations_vj, attribute='pt_display_informations'),
 "additional_informations":
 NonNullList(PbEnum(response_pb2.SectionAdditionalInformationType)),
 "geojson":
 SectionGeoJson(),
 "path":
 NonNullList(NonNullNested({
     "length": fields.Integer(),
     "name": fields.String(),
     "duration": fields.Integer(),
     "direction": fields.Integer()
 }),
             attribute="street_network.path_items"),
 "transfer_type":
 enum_type(),
 "stop_date_times":
 NonNullList(NonNullNested(stop_date_time)),
 "departure_date_time":
 DateTime(attribute="begin_date_time"),
 "base_departure_date_time":
Пример #2
0
    "driver": PbField(individual_information, attribute="driver"),
    "seats": PbField(seats_description, attribute="seats"),
}

section = {
    "type": section_type(),
    "id": fields.String(),
    "mode": enum_type(attribute="street_network.mode"),
    "duration": Integer(),
    "from": section_place(place, attribute="origin"),
    "to": section_place(place, attribute="destination"),
    "links": SectionLinks(attribute="uris"),
    "display_informations": PbField(display_informations_vj,
                                    attribute='pt_display_informations'),
    "additional_informations": NonNullList(PbEnum(response_pb2.SectionAdditionalInformationType)),
    "geojson": SectionGeoJson(),
    "path": NonNullList(NonNullNested({"length": Integer(),
                                       "name": fields.String(),
                                       "duration": Integer(),
                                       "direction": fields.Integer()}),
                        attribute="street_network.path_items"),
    "transfer_type": enum_type(),
    "stop_date_times": NonNullList(NonNullNested(stop_date_time)),
    "departure_date_time": DateTime(attribute="begin_date_time"),
    "base_departure_date_time": DateTime(attribute="base_begin_date_time"),
    "arrival_date_time": DateTime(attribute="end_date_time"),
    "base_arrival_date_time": DateTime(attribute="base_end_date_time"),
    'data_freshness': enum_type(attribute='realtime_level'),
    "co2_emission": NonNullNested({
        'value': fields.Raw,
        'unit': fields.String