balancing-services 2.3.0__tar.gz → 2.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. {balancing_services-2.3.0 → balancing_services-2.4.0}/PKG-INFO +1 -1
  2. balancing_services-2.4.0/balancing_services/api/default/get_balancing_energy_activated_volume_history.py +332 -0
  3. balancing_services-2.4.0/balancing_services/api/default/get_balancing_energy_offered_volume_history.py +332 -0
  4. balancing_services-2.4.0/balancing_services/api/default/get_balancing_energy_price_history.py +326 -0
  5. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/__init__.py +28 -0
  6. balancing_services-2.4.0/balancing_services/models/balancing_energy_activated_volume_history.py +141 -0
  7. balancing_services-2.4.0/balancing_services/models/balancing_energy_activated_volume_history_response.py +132 -0
  8. balancing_services-2.4.0/balancing_services/models/balancing_energy_activated_volume_revision.py +84 -0
  9. balancing_services-2.4.0/balancing_services/models/balancing_energy_offered_volume_history.py +141 -0
  10. balancing_services-2.4.0/balancing_services/models/balancing_energy_offered_volume_history_response.py +132 -0
  11. balancing_services-2.4.0/balancing_services/models/balancing_energy_offered_volume_revision.py +84 -0
  12. balancing_services-2.4.0/balancing_services/models/balancing_energy_price_history.py +146 -0
  13. balancing_services-2.4.0/balancing_services/models/balancing_energy_price_history_response.py +128 -0
  14. balancing_services-2.4.0/balancing_services/models/balancing_energy_price_revision.py +84 -0
  15. {balancing_services-2.3.0 → balancing_services-2.4.0}/pyproject.toml +1 -1
  16. {balancing_services-2.3.0 → balancing_services-2.4.0}/tests/test_basic.py +69 -0
  17. {balancing_services-2.3.0 → balancing_services-2.4.0}/tests/test_integration.py +285 -0
  18. {balancing_services-2.3.0 → balancing_services-2.4.0}/.env.sample +0 -0
  19. {balancing_services-2.3.0 → balancing_services-2.4.0}/.gitignore +0 -0
  20. {balancing_services-2.3.0 → balancing_services-2.4.0}/LICENSE +0 -0
  21. {balancing_services-2.3.0 → balancing_services-2.4.0}/PUBLISHING.md +0 -0
  22. {balancing_services-2.3.0 → balancing_services-2.4.0}/README.md +0 -0
  23. {balancing_services-2.3.0 → balancing_services-2.4.0}/RELEASE_CHECKLIST.md +0 -0
  24. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/__init__.py +0 -0
  25. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/__init__.py +0 -0
  26. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/__init__.py +0 -0
  27. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_capacity_bids.py +0 -0
  28. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_capacity_demand.py +0 -0
  29. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_capacity_prices.py +0 -0
  30. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_capacity_procured_volumes.py +0 -0
  31. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_activated_volumes.py +0 -0
  32. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_bids.py +0 -0
  33. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_demand.py +0 -0
  34. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_offered_volumes.py +0 -0
  35. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_prices.py +0 -0
  36. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_balancing_energy_satisfied_demand.py +0 -0
  37. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_cross_border_available_capacity.py +0 -0
  38. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_cross_border_energy_volumes.py +0 -0
  39. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_cross_border_marginal_prices.py +0 -0
  40. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_cross_zonal_capacity_allocation.py +0 -0
  41. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_current_imbalance_total_volumes.py +0 -0
  42. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_day_ahead_energy_prices.py +0 -0
  43. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_price_forecasts.py +0 -0
  44. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_price_history.py +0 -0
  45. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_prices.py +0 -0
  46. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_total_volume_history.py +0 -0
  47. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/api/default/get_imbalance_total_volumes.py +0 -0
  48. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/client.py +0 -0
  49. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/errors.py +0 -0
  50. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/activation_type.py +0 -0
  51. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/area.py +0 -0
  52. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_bid_period.py +0 -0
  53. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_bids.py +0 -0
  54. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_bids_response.py +0 -0
  55. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_demand.py +0 -0
  56. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_demands.py +0 -0
  57. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_demands_response.py +0 -0
  58. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_price.py +0 -0
  59. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_prices.py +0 -0
  60. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_prices_response.py +0 -0
  61. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_volume.py +0 -0
  62. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_volumes.py +0 -0
  63. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_capacity_volumes_response.py +0 -0
  64. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_bid_period.py +0 -0
  65. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_bids.py +0 -0
  66. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_bids_response.py +0 -0
  67. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_price.py +0 -0
  68. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_prices.py +0 -0
  69. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_prices_response.py +0 -0
  70. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_volume.py +0 -0
  71. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_volumes.py +0 -0
  72. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/balancing_energy_volumes_response.py +0 -0
  73. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/bid_status.py +0 -0
  74. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/capacity_bid.py +0 -0
  75. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_available_capacity.py +0 -0
  76. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_available_capacity_response.py +0 -0
  77. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_available_capacity_value.py +0 -0
  78. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_energy_volumes.py +0 -0
  79. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_energy_volumes_response.py +0 -0
  80. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_marginal_price.py +0 -0
  81. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_marginal_prices.py +0 -0
  82. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_border_marginal_prices_response.py +0 -0
  83. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_zonal_capacity_allocation_response.py +0 -0
  84. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/cross_zonal_volumes.py +0 -0
  85. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/currency.py +0 -0
  86. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/day_ahead_energy_price.py +0 -0
  87. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/day_ahead_energy_prices.py +0 -0
  88. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/day_ahead_energy_prices_response.py +0 -0
  89. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/demand_basis.py +0 -0
  90. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/direction.py +0 -0
  91. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/eic_code.py +0 -0
  92. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/energy_bid.py +0 -0
  93. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_direction.py +0 -0
  94. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price.py +0 -0
  95. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_forecast.py +0 -0
  96. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_forecast_quantile.py +0 -0
  97. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_forecasts.py +0 -0
  98. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_forecasts_response.py +0 -0
  99. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_history.py +0 -0
  100. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_history_response.py +0 -0
  101. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_price_revision.py +0 -0
  102. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_prices.py +0 -0
  103. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_prices_response.py +0 -0
  104. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_total_volume_history.py +0 -0
  105. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_total_volume_history_response.py +0 -0
  106. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_total_volumes.py +0 -0
  107. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/imbalance_total_volumes_response.py +0 -0
  108. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/period.py +0 -0
  109. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/problem.py +0 -0
  110. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/procurement.py +0 -0
  111. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/reserve_type.py +0 -0
  112. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/total_imbalance_direction.py +0 -0
  113. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/total_imbalance_volume.py +0 -0
  114. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/models/total_imbalance_volume_revision.py +0 -0
  115. {balancing_services-2.3.0 → balancing_services-2.4.0}/balancing_services/types.py +0 -0
  116. {balancing_services-2.3.0 → balancing_services-2.4.0}/check.sh +0 -0
  117. {balancing_services-2.3.0 → balancing_services-2.4.0}/config.yaml +0 -0
  118. {balancing_services-2.3.0 → balancing_services-2.4.0}/examples/basic_usage.py +0 -0
  119. {balancing_services-2.3.0 → balancing_services-2.4.0}/examples/error_handling.py +0 -0
  120. {balancing_services-2.3.0 → balancing_services-2.4.0}/examples/pagination_example.py +0 -0
  121. {balancing_services-2.3.0 → balancing_services-2.4.0}/fix_enum_validator_casts.py +0 -0
  122. {balancing_services-2.3.0 → balancing_services-2.4.0}/generate-pyproject.sh +0 -0
  123. {balancing_services-2.3.0 → balancing_services-2.4.0}/generate.sh +0 -0
  124. {balancing_services-2.3.0 → balancing_services-2.4.0}/pyproject.toml.draft +0 -0
  125. {balancing_services-2.3.0 → balancing_services-2.4.0}/test-and-publish.sh +0 -0
  126. {balancing_services-2.3.0 → balancing_services-2.4.0}/tests/conftest.py +0 -0
  127. {balancing_services-2.3.0 → balancing_services-2.4.0}/tests/test_async.py +0 -0
  128. {balancing_services-2.3.0 → balancing_services-2.4.0}/tests/test_datetime_compat.py +0 -0
  129. {balancing_services-2.3.0 → balancing_services-2.4.0}/tests/test_procured_at_none_handling.py +0 -0
  130. {balancing_services-2.3.0 → balancing_services-2.4.0}/tests/test_readme_execution.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: balancing-services
3
- Version: 2.3.0
3
+ Version: 2.4.0
4
4
  Summary: Official Python client for accessing European electricity balancing market data via the Balancing Services REST API
5
5
  Project-URL: Homepage, https://balancing.services
6
6
  Project-URL: Documentation, https://api.balancing.services/v2/documentation
@@ -0,0 +1,332 @@
1
+ import datetime
2
+ from http import HTTPStatus
3
+ from typing import Any
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.area import Area
10
+ from ...models.balancing_energy_activated_volume_history_response import (
11
+ BalancingEnergyActivatedVolumeHistoryResponse,
12
+ )
13
+ from ...models.problem import Problem
14
+ from ...models.reserve_type import ReserveType
15
+ from ...types import UNSET, Response, Unset
16
+
17
+
18
+ def _get_kwargs(
19
+ *,
20
+ area: Area,
21
+ period_start_at: datetime.datetime,
22
+ period_end_at: datetime.datetime,
23
+ reserve_type: ReserveType,
24
+ cursor: str | Unset = UNSET,
25
+ limit: int | Unset = 100,
26
+ updated_since: datetime.datetime | Unset = UNSET,
27
+ ) -> dict[str, Any]:
28
+
29
+ params: dict[str, Any] = {}
30
+
31
+ json_area: str = area
32
+ params["area"] = json_area
33
+
34
+ json_period_start_at = period_start_at.isoformat()
35
+ params["period-start-at"] = json_period_start_at
36
+
37
+ json_period_end_at = period_end_at.isoformat()
38
+ params["period-end-at"] = json_period_end_at
39
+
40
+ json_reserve_type: str = reserve_type
41
+ params["reserve-type"] = json_reserve_type
42
+
43
+ params["cursor"] = cursor
44
+
45
+ params["limit"] = limit
46
+
47
+ json_updated_since: str | Unset = UNSET
48
+ if not isinstance(updated_since, Unset):
49
+ json_updated_since = updated_since.isoformat()
50
+ params["updated-since"] = json_updated_since
51
+
52
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
53
+
54
+ _kwargs: dict[str, Any] = {
55
+ "method": "get",
56
+ "url": "/balancing/energy/activated-volumes/history",
57
+ "params": params,
58
+ }
59
+
60
+ return _kwargs
61
+
62
+
63
+ def _parse_response(
64
+ *, client: AuthenticatedClient | Client, response: httpx.Response
65
+ ) -> BalancingEnergyActivatedVolumeHistoryResponse | Problem | None:
66
+ if response.status_code == 200:
67
+ response_200 = BalancingEnergyActivatedVolumeHistoryResponse.from_dict(
68
+ response.json()
69
+ )
70
+
71
+ return response_200
72
+
73
+ if response.status_code == 400:
74
+ response_400 = Problem.from_dict(response.json())
75
+
76
+ return response_400
77
+
78
+ if response.status_code == 401:
79
+ response_401 = Problem.from_dict(response.json())
80
+
81
+ return response_401
82
+
83
+ if response.status_code == 403:
84
+ response_403 = Problem.from_dict(response.json())
85
+
86
+ return response_403
87
+
88
+ if response.status_code == 404:
89
+ response_404 = Problem.from_dict(response.json())
90
+
91
+ return response_404
92
+
93
+ if response.status_code == 429:
94
+ response_429 = Problem.from_dict(response.json())
95
+
96
+ return response_429
97
+
98
+ if response.status_code == 500:
99
+ response_500 = Problem.from_dict(response.json())
100
+
101
+ return response_500
102
+
103
+ if response.status_code == 501:
104
+ response_501 = Problem.from_dict(response.json())
105
+
106
+ return response_501
107
+
108
+ if client.raise_on_unexpected_status:
109
+ raise errors.UnexpectedStatus(response.status_code, response.content)
110
+ else:
111
+ return None
112
+
113
+
114
+ def _build_response(
115
+ *, client: AuthenticatedClient | Client, response: httpx.Response
116
+ ) -> Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]:
117
+ return Response(
118
+ status_code=HTTPStatus(response.status_code),
119
+ content=response.content,
120
+ headers=response.headers,
121
+ parsed=_parse_response(client=client, response=response),
122
+ )
123
+
124
+
125
+ def sync_detailed(
126
+ *,
127
+ client: AuthenticatedClient | Client,
128
+ area: Area,
129
+ period_start_at: datetime.datetime,
130
+ period_end_at: datetime.datetime,
131
+ reserve_type: ReserveType,
132
+ cursor: str | Unset = UNSET,
133
+ limit: int | Unset = 100,
134
+ updated_since: datetime.datetime | Unset = UNSET,
135
+ ) -> Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]:
136
+ """Get the revision history of the activated balancing energy volumes for an area
137
+
138
+ **Experimental** - This endpoint is under active development and may change without notice.
139
+
140
+ Returns how the activated balancing energy volumes on `/balancing/energy/activated-volumes`
141
+ reached their current values: the sequence of values held for a period, each stamped with the
142
+ `observedAt` it was recorded at. The response is the `/balancing/energy/activated-volumes`
143
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
144
+ ascending by `observedAt`.
145
+
146
+ Args:
147
+ area (Area): Area code
148
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
149
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
150
+ reserve_type (ReserveType): Reserve type
151
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
152
+ limit (int | Unset): Default: 100. Example: 100.
153
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
154
+
155
+ Raises:
156
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
157
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
158
+
159
+ Returns:
160
+ Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]
161
+ """
162
+
163
+ kwargs = _get_kwargs(
164
+ area=area,
165
+ period_start_at=period_start_at,
166
+ period_end_at=period_end_at,
167
+ reserve_type=reserve_type,
168
+ cursor=cursor,
169
+ limit=limit,
170
+ updated_since=updated_since,
171
+ )
172
+
173
+ response = client.get_httpx_client().request(
174
+ **kwargs,
175
+ )
176
+
177
+ return _build_response(client=client, response=response)
178
+
179
+
180
+ def sync(
181
+ *,
182
+ client: AuthenticatedClient | Client,
183
+ area: Area,
184
+ period_start_at: datetime.datetime,
185
+ period_end_at: datetime.datetime,
186
+ reserve_type: ReserveType,
187
+ cursor: str | Unset = UNSET,
188
+ limit: int | Unset = 100,
189
+ updated_since: datetime.datetime | Unset = UNSET,
190
+ ) -> BalancingEnergyActivatedVolumeHistoryResponse | Problem | None:
191
+ """Get the revision history of the activated balancing energy volumes for an area
192
+
193
+ **Experimental** - This endpoint is under active development and may change without notice.
194
+
195
+ Returns how the activated balancing energy volumes on `/balancing/energy/activated-volumes`
196
+ reached their current values: the sequence of values held for a period, each stamped with the
197
+ `observedAt` it was recorded at. The response is the `/balancing/energy/activated-volumes`
198
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
199
+ ascending by `observedAt`.
200
+
201
+ Args:
202
+ area (Area): Area code
203
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
204
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
205
+ reserve_type (ReserveType): Reserve type
206
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
207
+ limit (int | Unset): Default: 100. Example: 100.
208
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
209
+
210
+ Raises:
211
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
212
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
213
+
214
+ Returns:
215
+ BalancingEnergyActivatedVolumeHistoryResponse | Problem
216
+ """
217
+
218
+ return sync_detailed(
219
+ client=client,
220
+ area=area,
221
+ period_start_at=period_start_at,
222
+ period_end_at=period_end_at,
223
+ reserve_type=reserve_type,
224
+ cursor=cursor,
225
+ limit=limit,
226
+ updated_since=updated_since,
227
+ ).parsed
228
+
229
+
230
+ async def asyncio_detailed(
231
+ *,
232
+ client: AuthenticatedClient | Client,
233
+ area: Area,
234
+ period_start_at: datetime.datetime,
235
+ period_end_at: datetime.datetime,
236
+ reserve_type: ReserveType,
237
+ cursor: str | Unset = UNSET,
238
+ limit: int | Unset = 100,
239
+ updated_since: datetime.datetime | Unset = UNSET,
240
+ ) -> Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]:
241
+ """Get the revision history of the activated balancing energy volumes for an area
242
+
243
+ **Experimental** - This endpoint is under active development and may change without notice.
244
+
245
+ Returns how the activated balancing energy volumes on `/balancing/energy/activated-volumes`
246
+ reached their current values: the sequence of values held for a period, each stamped with the
247
+ `observedAt` it was recorded at. The response is the `/balancing/energy/activated-volumes`
248
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
249
+ ascending by `observedAt`.
250
+
251
+ Args:
252
+ area (Area): Area code
253
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
254
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
255
+ reserve_type (ReserveType): Reserve type
256
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
257
+ limit (int | Unset): Default: 100. Example: 100.
258
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
259
+
260
+ Raises:
261
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
262
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
263
+
264
+ Returns:
265
+ Response[BalancingEnergyActivatedVolumeHistoryResponse | Problem]
266
+ """
267
+
268
+ kwargs = _get_kwargs(
269
+ area=area,
270
+ period_start_at=period_start_at,
271
+ period_end_at=period_end_at,
272
+ reserve_type=reserve_type,
273
+ cursor=cursor,
274
+ limit=limit,
275
+ updated_since=updated_since,
276
+ )
277
+
278
+ response = await client.get_async_httpx_client().request(**kwargs)
279
+
280
+ return _build_response(client=client, response=response)
281
+
282
+
283
+ async def asyncio(
284
+ *,
285
+ client: AuthenticatedClient | Client,
286
+ area: Area,
287
+ period_start_at: datetime.datetime,
288
+ period_end_at: datetime.datetime,
289
+ reserve_type: ReserveType,
290
+ cursor: str | Unset = UNSET,
291
+ limit: int | Unset = 100,
292
+ updated_since: datetime.datetime | Unset = UNSET,
293
+ ) -> BalancingEnergyActivatedVolumeHistoryResponse | Problem | None:
294
+ """Get the revision history of the activated balancing energy volumes for an area
295
+
296
+ **Experimental** - This endpoint is under active development and may change without notice.
297
+
298
+ Returns how the activated balancing energy volumes on `/balancing/energy/activated-volumes`
299
+ reached their current values: the sequence of values held for a period, each stamped with the
300
+ `observedAt` it was recorded at. The response is the `/balancing/energy/activated-volumes`
301
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
302
+ ascending by `observedAt`.
303
+
304
+ Args:
305
+ area (Area): Area code
306
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
307
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
308
+ reserve_type (ReserveType): Reserve type
309
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
310
+ limit (int | Unset): Default: 100. Example: 100.
311
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
312
+
313
+ Raises:
314
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
315
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
316
+
317
+ Returns:
318
+ BalancingEnergyActivatedVolumeHistoryResponse | Problem
319
+ """
320
+
321
+ return (
322
+ await asyncio_detailed(
323
+ client=client,
324
+ area=area,
325
+ period_start_at=period_start_at,
326
+ period_end_at=period_end_at,
327
+ reserve_type=reserve_type,
328
+ cursor=cursor,
329
+ limit=limit,
330
+ updated_since=updated_since,
331
+ )
332
+ ).parsed
@@ -0,0 +1,332 @@
1
+ import datetime
2
+ from http import HTTPStatus
3
+ from typing import Any
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.area import Area
10
+ from ...models.balancing_energy_offered_volume_history_response import (
11
+ BalancingEnergyOfferedVolumeHistoryResponse,
12
+ )
13
+ from ...models.problem import Problem
14
+ from ...models.reserve_type import ReserveType
15
+ from ...types import UNSET, Response, Unset
16
+
17
+
18
+ def _get_kwargs(
19
+ *,
20
+ area: Area,
21
+ period_start_at: datetime.datetime,
22
+ period_end_at: datetime.datetime,
23
+ reserve_type: ReserveType,
24
+ cursor: str | Unset = UNSET,
25
+ limit: int | Unset = 100,
26
+ updated_since: datetime.datetime | Unset = UNSET,
27
+ ) -> dict[str, Any]:
28
+
29
+ params: dict[str, Any] = {}
30
+
31
+ json_area: str = area
32
+ params["area"] = json_area
33
+
34
+ json_period_start_at = period_start_at.isoformat()
35
+ params["period-start-at"] = json_period_start_at
36
+
37
+ json_period_end_at = period_end_at.isoformat()
38
+ params["period-end-at"] = json_period_end_at
39
+
40
+ json_reserve_type: str = reserve_type
41
+ params["reserve-type"] = json_reserve_type
42
+
43
+ params["cursor"] = cursor
44
+
45
+ params["limit"] = limit
46
+
47
+ json_updated_since: str | Unset = UNSET
48
+ if not isinstance(updated_since, Unset):
49
+ json_updated_since = updated_since.isoformat()
50
+ params["updated-since"] = json_updated_since
51
+
52
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
53
+
54
+ _kwargs: dict[str, Any] = {
55
+ "method": "get",
56
+ "url": "/balancing/energy/offered-volumes/history",
57
+ "params": params,
58
+ }
59
+
60
+ return _kwargs
61
+
62
+
63
+ def _parse_response(
64
+ *, client: AuthenticatedClient | Client, response: httpx.Response
65
+ ) -> BalancingEnergyOfferedVolumeHistoryResponse | Problem | None:
66
+ if response.status_code == 200:
67
+ response_200 = BalancingEnergyOfferedVolumeHistoryResponse.from_dict(
68
+ response.json()
69
+ )
70
+
71
+ return response_200
72
+
73
+ if response.status_code == 400:
74
+ response_400 = Problem.from_dict(response.json())
75
+
76
+ return response_400
77
+
78
+ if response.status_code == 401:
79
+ response_401 = Problem.from_dict(response.json())
80
+
81
+ return response_401
82
+
83
+ if response.status_code == 403:
84
+ response_403 = Problem.from_dict(response.json())
85
+
86
+ return response_403
87
+
88
+ if response.status_code == 404:
89
+ response_404 = Problem.from_dict(response.json())
90
+
91
+ return response_404
92
+
93
+ if response.status_code == 429:
94
+ response_429 = Problem.from_dict(response.json())
95
+
96
+ return response_429
97
+
98
+ if response.status_code == 500:
99
+ response_500 = Problem.from_dict(response.json())
100
+
101
+ return response_500
102
+
103
+ if response.status_code == 501:
104
+ response_501 = Problem.from_dict(response.json())
105
+
106
+ return response_501
107
+
108
+ if client.raise_on_unexpected_status:
109
+ raise errors.UnexpectedStatus(response.status_code, response.content)
110
+ else:
111
+ return None
112
+
113
+
114
+ def _build_response(
115
+ *, client: AuthenticatedClient | Client, response: httpx.Response
116
+ ) -> Response[BalancingEnergyOfferedVolumeHistoryResponse | Problem]:
117
+ return Response(
118
+ status_code=HTTPStatus(response.status_code),
119
+ content=response.content,
120
+ headers=response.headers,
121
+ parsed=_parse_response(client=client, response=response),
122
+ )
123
+
124
+
125
+ def sync_detailed(
126
+ *,
127
+ client: AuthenticatedClient | Client,
128
+ area: Area,
129
+ period_start_at: datetime.datetime,
130
+ period_end_at: datetime.datetime,
131
+ reserve_type: ReserveType,
132
+ cursor: str | Unset = UNSET,
133
+ limit: int | Unset = 100,
134
+ updated_since: datetime.datetime | Unset = UNSET,
135
+ ) -> Response[BalancingEnergyOfferedVolumeHistoryResponse | Problem]:
136
+ """Get the revision history of the offered balancing energy volumes for an area
137
+
138
+ **Experimental** - This endpoint is under active development and may change without notice.
139
+
140
+ Returns how the offered balancing energy volumes on `/balancing/energy/offered-volumes`
141
+ reached their current values: the sequence of values held for a period, each stamped with the
142
+ `observedAt` it was recorded at. The response is the `/balancing/energy/offered-volumes`
143
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
144
+ ascending by `observedAt`.
145
+
146
+ Args:
147
+ area (Area): Area code
148
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
149
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
150
+ reserve_type (ReserveType): Reserve type
151
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
152
+ limit (int | Unset): Default: 100. Example: 100.
153
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
154
+
155
+ Raises:
156
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
157
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
158
+
159
+ Returns:
160
+ Response[BalancingEnergyOfferedVolumeHistoryResponse | Problem]
161
+ """
162
+
163
+ kwargs = _get_kwargs(
164
+ area=area,
165
+ period_start_at=period_start_at,
166
+ period_end_at=period_end_at,
167
+ reserve_type=reserve_type,
168
+ cursor=cursor,
169
+ limit=limit,
170
+ updated_since=updated_since,
171
+ )
172
+
173
+ response = client.get_httpx_client().request(
174
+ **kwargs,
175
+ )
176
+
177
+ return _build_response(client=client, response=response)
178
+
179
+
180
+ def sync(
181
+ *,
182
+ client: AuthenticatedClient | Client,
183
+ area: Area,
184
+ period_start_at: datetime.datetime,
185
+ period_end_at: datetime.datetime,
186
+ reserve_type: ReserveType,
187
+ cursor: str | Unset = UNSET,
188
+ limit: int | Unset = 100,
189
+ updated_since: datetime.datetime | Unset = UNSET,
190
+ ) -> BalancingEnergyOfferedVolumeHistoryResponse | Problem | None:
191
+ """Get the revision history of the offered balancing energy volumes for an area
192
+
193
+ **Experimental** - This endpoint is under active development and may change without notice.
194
+
195
+ Returns how the offered balancing energy volumes on `/balancing/energy/offered-volumes`
196
+ reached their current values: the sequence of values held for a period, each stamped with the
197
+ `observedAt` it was recorded at. The response is the `/balancing/energy/offered-volumes`
198
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
199
+ ascending by `observedAt`.
200
+
201
+ Args:
202
+ area (Area): Area code
203
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
204
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
205
+ reserve_type (ReserveType): Reserve type
206
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
207
+ limit (int | Unset): Default: 100. Example: 100.
208
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
209
+
210
+ Raises:
211
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
212
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
213
+
214
+ Returns:
215
+ BalancingEnergyOfferedVolumeHistoryResponse | Problem
216
+ """
217
+
218
+ return sync_detailed(
219
+ client=client,
220
+ area=area,
221
+ period_start_at=period_start_at,
222
+ period_end_at=period_end_at,
223
+ reserve_type=reserve_type,
224
+ cursor=cursor,
225
+ limit=limit,
226
+ updated_since=updated_since,
227
+ ).parsed
228
+
229
+
230
+ async def asyncio_detailed(
231
+ *,
232
+ client: AuthenticatedClient | Client,
233
+ area: Area,
234
+ period_start_at: datetime.datetime,
235
+ period_end_at: datetime.datetime,
236
+ reserve_type: ReserveType,
237
+ cursor: str | Unset = UNSET,
238
+ limit: int | Unset = 100,
239
+ updated_since: datetime.datetime | Unset = UNSET,
240
+ ) -> Response[BalancingEnergyOfferedVolumeHistoryResponse | Problem]:
241
+ """Get the revision history of the offered balancing energy volumes for an area
242
+
243
+ **Experimental** - This endpoint is under active development and may change without notice.
244
+
245
+ Returns how the offered balancing energy volumes on `/balancing/energy/offered-volumes`
246
+ reached their current values: the sequence of values held for a period, each stamped with the
247
+ `observedAt` it was recorded at. The response is the `/balancing/energy/offered-volumes`
248
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
249
+ ascending by `observedAt`.
250
+
251
+ Args:
252
+ area (Area): Area code
253
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
254
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
255
+ reserve_type (ReserveType): Reserve type
256
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
257
+ limit (int | Unset): Default: 100. Example: 100.
258
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
259
+
260
+ Raises:
261
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
262
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
263
+
264
+ Returns:
265
+ Response[BalancingEnergyOfferedVolumeHistoryResponse | Problem]
266
+ """
267
+
268
+ kwargs = _get_kwargs(
269
+ area=area,
270
+ period_start_at=period_start_at,
271
+ period_end_at=period_end_at,
272
+ reserve_type=reserve_type,
273
+ cursor=cursor,
274
+ limit=limit,
275
+ updated_since=updated_since,
276
+ )
277
+
278
+ response = await client.get_async_httpx_client().request(**kwargs)
279
+
280
+ return _build_response(client=client, response=response)
281
+
282
+
283
+ async def asyncio(
284
+ *,
285
+ client: AuthenticatedClient | Client,
286
+ area: Area,
287
+ period_start_at: datetime.datetime,
288
+ period_end_at: datetime.datetime,
289
+ reserve_type: ReserveType,
290
+ cursor: str | Unset = UNSET,
291
+ limit: int | Unset = 100,
292
+ updated_since: datetime.datetime | Unset = UNSET,
293
+ ) -> BalancingEnergyOfferedVolumeHistoryResponse | Problem | None:
294
+ """Get the revision history of the offered balancing energy volumes for an area
295
+
296
+ **Experimental** - This endpoint is under active development and may change without notice.
297
+
298
+ Returns how the offered balancing energy volumes on `/balancing/energy/offered-volumes`
299
+ reached their current values: the sequence of values held for a period, each stamped with the
300
+ `observedAt` it was recorded at. The response is the `/balancing/energy/offered-volumes`
301
+ shape with `observedAt` added to each entry of `volumes`, which carries the revision entries,
302
+ ascending by `observedAt`.
303
+
304
+ Args:
305
+ area (Area): Area code
306
+ period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
307
+ period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
308
+ reserve_type (ReserveType): Reserve type
309
+ cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
310
+ limit (int | Unset): Default: 100. Example: 100.
311
+ updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
312
+
313
+ Raises:
314
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
315
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
316
+
317
+ Returns:
318
+ BalancingEnergyOfferedVolumeHistoryResponse | Problem
319
+ """
320
+
321
+ return (
322
+ await asyncio_detailed(
323
+ client=client,
324
+ area=area,
325
+ period_start_at=period_start_at,
326
+ period_end_at=period_end_at,
327
+ reserve_type=reserve_type,
328
+ cursor=cursor,
329
+ limit=limit,
330
+ updated_since=updated_since,
331
+ )
332
+ ).parsed