|
| 1 | +"""Specific parameter classes for ENTSO-E OMI endpoints. |
| 2 | +
|
| 3 | +This module contains specialized parameter classes for different OMI data |
| 4 | +endpoints, each inheriting from OMI and providing preset values for |
| 5 | +fixed parameters based on the ENTSO-E Transparency Platform API specification. |
| 6 | +""" |
| 7 | + |
| 8 | +from typing import Optional |
| 9 | + |
| 10 | +from .OMI import OMI |
| 11 | + |
| 12 | + |
| 13 | +class OtherMarketInformation(OMI): |
| 14 | + """Parameters for Other Market Information. |
| 15 | +
|
| 16 | + Data view: |
| 17 | + https://transparency.entsoe.eu/omi-domain/r2/otherMarketInformation/show |
| 18 | +
|
| 19 | + Fixed parameters: |
| 20 | + - documentType: B47 (Other market information) |
| 21 | +
|
| 22 | + Notes: |
| 23 | + - Returns other market information data |
| 24 | + - Can be filtered by document status (A05=Active, A09=Cancelled, A13=Withdrawn) |
| 25 | + - Supports update-based queries with PeriodStartUpdate/PeriodEndUpdate |
| 26 | + """ |
| 27 | + |
| 28 | + code = "Other Market" |
| 29 | + |
| 30 | + def __init__( |
| 31 | + self, |
| 32 | + security_token: str, |
| 33 | + control_area_domain: str, |
| 34 | + period_start: Optional[int] = None, |
| 35 | + period_end: Optional[int] = None, |
| 36 | + # Optional filtering parameters |
| 37 | + doc_status: Optional[str] = None, |
| 38 | + period_start_update: Optional[int] = None, |
| 39 | + period_end_update: Optional[int] = None, |
| 40 | + m_rid: Optional[str] = None, |
| 41 | + # Additional common parameters |
| 42 | + timeout: int = 5, |
| 43 | + offset: int = 0, |
| 44 | + ): |
| 45 | + """ |
| 46 | + Initialize other market information parameters. |
| 47 | +
|
| 48 | + Args: |
| 49 | + security_token: API security token |
| 50 | + control_area_domain: EIC code of Scheduling Area |
| 51 | + period_start: Start period (YYYYMMDDHHMM format, optional if |
| 52 | + period_start_update and period_end_update are defined) |
| 53 | + period_end: End period (YYYYMMDDHHMM format, optional if |
| 54 | + period_start_update and period_end_update are defined) |
| 55 | + doc_status: Document status (A05=Active, A09=Cancelled, A13=Withdrawn) |
| 56 | + period_start_update: Start of update period (YYYYMMDDHHMM format, |
| 57 | + mandatory if period_start and period_end not defined) |
| 58 | + period_end_update: End of update period (YYYYMMDDHHMM format, |
| 59 | + mandatory if period_start and period_end not defined) |
| 60 | + m_rid: Message ID for specific information versions |
| 61 | + timeout: Request timeout in seconds |
| 62 | + offset: Offset for pagination |
| 63 | +
|
| 64 | + Note: |
| 65 | + Either (period_start, period_end) or |
| 66 | + (period_start_update, period_end_update) |
| 67 | + must be provided. The parent OMI class validates this requirement. |
| 68 | + """ |
| 69 | + super().__init__( |
| 70 | + security_token=security_token, |
| 71 | + control_area_domain=control_area_domain, |
| 72 | + period_start=period_start, |
| 73 | + period_end=period_end, |
| 74 | + period_start_update=period_start_update, |
| 75 | + period_end_update=period_end_update, |
| 76 | + doc_status=doc_status, |
| 77 | + m_rid=m_rid, |
| 78 | + timeout=timeout, |
| 79 | + offset=offset, |
| 80 | + ) |
| 81 | + |
| 82 | + # Set the fixed document type for Other Market Information |
| 83 | + self.add_optional_param("documentType", "B47") |
0 commit comments