# 充電樁 (https://nolantw.github.io/tdx/reference/charging/)

## `Charging`

### `authorities`

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

取得提供充電資料的機關。

### `stations`

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

取得充電站與設施。

### `charging_points`

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

取得充電樁與付款、啟動方式。

### `connectors`

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

取得充電槍與電力規格。

### `connector_status`

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

取得充電槍的即時狀態。

### `operators`

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

取得充電營運業者。

### `charging_rates`

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

取得充電費率與計價時段。

### `parking_rates`

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

取得充電站的停車費率。

### `service_times`

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

取得充電站的營業時間。

## `ChargingArea`

```python
class ChargingArea(Enum):
    TOURISM = 'Tourism'
    PORT = 'Ship/Port/TIPC'
    FREEWAY = 'Freeway/ServiceArea'
    TRA = 'Rail/Station/TRA'
    TRTC = 'Rail/Station/TRTC'
    TMRT = 'Rail/Station/TMRT'
    TAOYUAN_AIRPORT = 'Air/Airport/TAC'
    CIVIL_AIRPORTS = 'Air/Airport/CAA'
```

## `ChargingAuthority`

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

## `ChargingOperator`

```python
class ChargingOperator(BaseModel):
    id: str
    name: Name | None
    telephone: str | None
    address: str | None
    website: str | None
    logo_url: str | None
    terms_url: str | None
    business_number: str | None
```

## `ConnectorSummary`

```python
class ConnectorSummary(BaseModel):
    type: int | None
    power: int | None
    quantity: int | None
```

## `FreewayChargingLocation`

```python
class FreewayChargingLocation(BaseModel):
    road: str | None
    service_area: str | None
```

## `CityChargingLocation`

```python
class CityChargingLocation(BaseModel):
    city: str | None
    town: str | None
    road: str | None
```

## `ChargingAddress`

```python
class ChargingAddress(CityChargingLocation):
    lane: str | None
    alley: str | None
    number: str | None
```

## `ChargingPlace`

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

## `ChargingLocation`

```python
class ChargingLocation(BaseModel):
    freeway: FreewayChargingLocation | None
    city_road: CityChargingLocation | None
    place: ChargingPlace | None
    address: ChargingAddress | None
```

## `ChargingCarPark`

```python
class ChargingCarPark(BaseModel):
    id: str
```

## `ChargingCurbParking`

```python
class ChargingCurbParking(BaseModel):
    id: str
```

## `ChargingParkingReference`

```python
class ChargingParkingReference(BaseModel):
    car_park: ChargingCarPark | None
    curbside: ChargingCurbParking | None
```

## `ChargingStation`

```python
class ChargingStation(BaseModel):
    id: str
    name: Name | None
    description: str | None
    operator_id: str | None
    operation_type: int | None
    latitude: float | None
    longitude: float | None
    geometry: str | None
    spaces: int | None
    charging_points: int | None
    connectors: tuple[ConnectorSummary, ...] | None
    service_time: str | None
    parking_rate: str | None
    charging_rate: str | None
    floors: str | None
    restriction: str | None
    photo_urls: tuple[str, ...] | None
    location: ChargingLocation | None
    telephone: str | None
    parking: ChargingParkingReference | None
```

## `ChargingPayment`

```python
class ChargingPayment(BaseModel):
    credit_card: bool | None
    smart_card: bool | None
    electronic: bool | None
    other: bool | None
```

## `ChargingStartMethods`

```python
class ChargingStartMethods(BaseModel):
    card: bool | None
    app: bool | None
    staff: bool | None
    other: bool | None
```

## `ChargingPoint`

```python
class ChargingPoint(BaseModel):
    id: str
    station_id: str
    operator_id: str | None
    connectors: tuple[ConnectorSummary, ...] | None
    charging_rate: str | None
    payment: ChargingPayment | None
    start_methods: ChargingStartMethods | None
    operation_url: str | None
    floor: str | None
    restriction: str | None
```

## `ChargingConnector`

```python
class ChargingConnector(BaseModel):
    id: str
    station_id: str
    charging_point_id: str
    type: int | None
    power: int | None
    voltage: str | None
    current_rating: str | None
    power_rating: str | None
    floor: str | None
    restriction: str | None
    ios_url: str | None
    android_url: str | None
    website: str | None
```

## `ConnectorStatus`

```python
class ConnectorStatus(BaseModel):
    id: str
    station_id: str
    charging_point_id: str
    type: int | None
    status: int | None
    charged_kwh: float | None
    charged_percent: float | None
    updated_at: MaybeTimestamp
```

## `RateBand`

```python
class RateBand(BaseModel):
    start_time: str | None
    end_time: str | None
    rate_type: int | None
    pricing_type: int | None
    day_type: int | None
    day_info: str | None
    sequence: int | None
    stay_start: int | None
    stay_end: int | None
    price: float | None
    peak: int | None
```

## `ChargeRateBand`

```python
class ChargeRateBand(RateBand):
    start_kw: int | None
    end_kw: int | None
    summer: bool | None
```

## `ParkingRateBand`

```python
class ParkingRateBand(RateBand):
    maximum_price: float | None
```

## `ChargingRate`

```python
class ChargingRate(BaseModel):
    station_id: str
    charging_point_id: str | None
    rates: tuple[ChargeRateBand, ...] | None
    overtime_rate: str | None
```

## `ChargingParkingRate`

```python
class ChargingParkingRate(BaseModel):
    station_id: str
    rates: tuple[ParkingRateBand, ...] | None
```

## `ChargingOpeningHour`

```python
class ChargingOpeningHour(BaseModel):
    start_time: str | None
    end_time: str | None
    service_type: int | None
    day_type: int | None
    day_info: str | None
    last_entrance: str | None
```

## `ChargingServiceTime`

```python
class ChargingServiceTime(BaseModel):
    station_id: str
    opening_hours: tuple[ChargingOpeningHour, ...] | None
```