# 道路事件 (https://nolantw.github.io/tdx/reference/road-events/)

## `RoadEvents`

### `events`

```python
def events(
    area: City | str | TrafficArea,
    *,
    query: Query[RoadEvent] | QueryParams | None = None,
    limit: int | None = None,
    offset: int = 0,
    cache_ttl: float | None = None,
) -> Records[RoadEvent]
```

取得預告的道路事件，例如施工與封閉。

### `live_events`

```python
def live_events(
    area: City | str | TrafficArea,
    *,
    query: Query[RoadEvent] | QueryParams | None = None,
    limit: int | None = None,
    offset: int = 0,
    cache_ttl: float | None = None,
) -> Records[RoadEvent]
```

取得目前的道路事件與影響。

### `authorities`

```python
def authorities(
    *,
    query: Query[RoadEventAuthority] | QueryParams | None = None,
    limit: int | None = None,
    offset: int = 0,
    cache_ttl: float | None = None,
) -> Records[RoadEventAuthority]
```

取得提供道路事件的機關。

## `RampLocation`

```python
class RampLocation(BaseModel):
    direction: str | None
    entry_exit: str | None
```

## `HighwayLocation`

```python
class HighwayLocation(BaseModel):
    road: str | None
    direction: str | None
    start_km: str | None
    end_km: str | None
    section_start: str | None
    section_end: str | None
    interchange: str | None
    ramp: RampLocation | None
```

## `CityRoadway`

```python
class CityRoadway(BaseModel):
    city: str | None
    town: str | None
    road: str | None
    direction: str | None
    section_start: str | None
    section_end: str | None
```

## `CityRoadLocation`

```python
class CityRoadLocation(BaseModel):
    roadways: tuple[CityRoadway, ...] | None
```

## `IntersectionLocation`

```python
class IntersectionLocation(BaseModel):
    city: str | None
    roads: tuple[str, ...] | None
```

## `AddressLocation`

```python
class AddressLocation(BaseModel):
    city: str | None
    town: str | None
    road: str | None
    lane: str | None
    alley: str | None
    start_number: str | None
    end_number: str | None
```

## `PlaceLocation`

```python
class PlaceLocation(BaseModel):
    point_of_interest: str | None
```

## `RoadEventLocation`

```python
class RoadEventLocation(BaseModel):
    highway: HighwayLocation | None
    city_road: CityRoadLocation | None
    intersection: IntersectionLocation | None
    address: AddressLocation | None
    place: PlaceLocation | None
    other: str | None
```

## `RoadEventDuration`

```python
class RoadEventDuration(BaseModel):
    occurrence_type: int | None
    occurrence_days: tuple[int, ...] | None
    occurrence_dates: tuple[str, ...] | None
    start_time: str | None
    end_time: str | None
    starts_at: MaybeTimestamp
    ends_at: MaybeTimestamp
```

## `RoadEventDetour`

```python
class RoadEventDetour(BaseModel):
    description: str | None
    attachment_url: str | None
    geometry: str | None
```

## `RoadEventImpact`

```python
class RoadEventImpact(BaseModel):
    description: str | None
    severity: int | None
    regulations: tuple[int, ...] | None
    block_way: int | None
    blocked_lanes: str | None
    duration: RoadEventDuration | None
    detour: RoadEventDetour | None
```

## `RoadEvent`

```python
class RoadEvent(BaseModel):
    id: str
    title: str | None
    description: str | None
    type: int | None
    subtype: int | None
    step: int | None
    effective_at: MaybeTimestamp
    expires_at: MaybeTimestamp
    positions: str | None
    geometry: str | None
    location_type: int | None
    location: RoadEventLocation | None
    impact: RoadEventImpact | None
    url: str | None
    attachment_urls: tuple[str, ...] | None
    source: str | None
    published_at: MaybeTimestamp
    updated_at: MaybeTimestamp
```

## `RoadEventAuthority`

```python
class RoadEventAuthority(BaseModel):
    code: str
    id: str | None
    name: Name | None
    telephone: str | None
    email: str | None
    address: str | None
    website: str | None
    updated_at: MaybeTimestamp
    oid: str | None
    logo_url: str | None
```