balancing-services 2.2.0__tar.gz → 2.3.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.
- {balancing_services-2.2.0 → balancing_services-2.3.0}/PKG-INFO +14 -21
- {balancing_services-2.2.0 → balancing_services-2.3.0}/README.md +13 -20
- balancing_services-2.3.0/balancing_services/api/default/get_imbalance_total_volume_history.py +321 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/__init__.py +6 -0
- balancing_services-2.3.0/balancing_services/models/imbalance_total_volume_history.py +97 -0
- balancing_services-2.3.0/balancing_services/models/imbalance_total_volume_history_response.py +128 -0
- balancing_services-2.3.0/balancing_services/models/total_imbalance_volume_revision.py +100 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/examples/basic_usage.py +1 -3
- {balancing_services-2.2.0 → balancing_services-2.3.0}/examples/error_handling.py +3 -5
- {balancing_services-2.2.0 → balancing_services-2.3.0}/examples/pagination_example.py +2 -7
- {balancing_services-2.2.0 → balancing_services-2.3.0}/fix_enum_validator_casts.py +1 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/pyproject.toml +1 -1
- {balancing_services-2.2.0 → balancing_services-2.3.0}/tests/conftest.py +1 -3
- {balancing_services-2.2.0 → balancing_services-2.3.0}/tests/test_async.py +3 -13
- {balancing_services-2.2.0 → balancing_services-2.3.0}/tests/test_basic.py +30 -15
- {balancing_services-2.2.0 → balancing_services-2.3.0}/tests/test_datetime_compat.py +1 -3
- {balancing_services-2.2.0 → balancing_services-2.3.0}/tests/test_integration.py +442 -418
- {balancing_services-2.2.0 → balancing_services-2.3.0}/tests/test_procured_at_none_handling.py +2 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/tests/test_readme_execution.py +15 -37
- {balancing_services-2.2.0 → balancing_services-2.3.0}/.env.sample +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/.gitignore +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/LICENSE +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/PUBLISHING.md +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/RELEASE_CHECKLIST.md +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/__init__.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/__init__.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/__init__.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_capacity_bids.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_capacity_demand.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_capacity_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_capacity_procured_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_energy_activated_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_energy_bids.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_energy_demand.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_energy_offered_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_energy_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_balancing_energy_satisfied_demand.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_cross_border_available_capacity.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_cross_border_energy_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_cross_border_marginal_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_cross_zonal_capacity_allocation.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_current_imbalance_total_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_day_ahead_energy_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_imbalance_price_forecasts.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_imbalance_price_history.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_imbalance_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/api/default/get_imbalance_total_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/client.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/errors.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/activation_type.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/area.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_bid_period.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_bids.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_bids_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_demand.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_demands.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_demands_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_price.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_prices_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_volume.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_capacity_volumes_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_bid_period.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_bids.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_bids_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_price.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_prices_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_volume.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/balancing_energy_volumes_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/bid_status.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/capacity_bid.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_border_available_capacity.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_border_available_capacity_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_border_available_capacity_value.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_border_energy_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_border_energy_volumes_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_border_marginal_price.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_border_marginal_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_border_marginal_prices_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_zonal_capacity_allocation_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/cross_zonal_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/currency.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/day_ahead_energy_price.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/day_ahead_energy_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/day_ahead_energy_prices_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/demand_basis.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/direction.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/eic_code.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/energy_bid.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_direction.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_price.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_price_forecast.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_price_forecast_quantile.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_price_forecasts.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_price_forecasts_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_price_history.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_price_history_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_price_revision.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_prices.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_prices_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_total_volumes.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/imbalance_total_volumes_response.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/period.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/problem.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/procurement.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/reserve_type.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/total_imbalance_direction.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/models/total_imbalance_volume.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/balancing_services/types.py +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/check.sh +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/config.yaml +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/generate-pyproject.sh +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/generate.sh +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/pyproject.toml.draft +0 -0
- {balancing_services-2.2.0 → balancing_services-2.3.0}/test-and-publish.sh +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: balancing-services
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.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
|
|
@@ -74,10 +74,7 @@ from balancing_services import AuthenticatedClient
|
|
|
74
74
|
from balancing_services.api.default import get_imbalance_prices
|
|
75
75
|
|
|
76
76
|
# Create an authenticated client
|
|
77
|
-
client = AuthenticatedClient(
|
|
78
|
-
base_url="https://api.balancing.services/v2",
|
|
79
|
-
token="YOUR_API_TOKEN"
|
|
80
|
-
)
|
|
77
|
+
client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_API_TOKEN")
|
|
81
78
|
|
|
82
79
|
# Get imbalance prices for Estonia. Enum-typed parameters take plain string
|
|
83
80
|
# values (e.g. area="EE") — see "Data Models" below.
|
|
@@ -85,7 +82,7 @@ response = get_imbalance_prices.sync_detailed(
|
|
|
85
82
|
client=client,
|
|
86
83
|
area="EE",
|
|
87
84
|
period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
|
|
88
|
-
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
|
|
85
|
+
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
89
86
|
)
|
|
90
87
|
|
|
91
88
|
if response.status_code == 200:
|
|
@@ -108,10 +105,7 @@ Include your token when creating the client:
|
|
|
108
105
|
```python
|
|
109
106
|
from balancing_services import AuthenticatedClient
|
|
110
107
|
|
|
111
|
-
client = AuthenticatedClient(
|
|
112
|
-
base_url="https://api.balancing.services/v2",
|
|
113
|
-
token="YOUR_API_TOKEN"
|
|
114
|
-
)
|
|
108
|
+
client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_API_TOKEN")
|
|
115
109
|
```
|
|
116
110
|
|
|
117
111
|
## Usage Examples
|
|
@@ -133,7 +127,7 @@ response = get_balancing_energy_bids.sync_detailed(
|
|
|
133
127
|
period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
|
|
134
128
|
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
135
129
|
reserve_type="aFRR",
|
|
136
|
-
limit=100
|
|
130
|
+
limit=100,
|
|
137
131
|
)
|
|
138
132
|
|
|
139
133
|
if response.status_code == 200:
|
|
@@ -155,7 +149,7 @@ if response.status_code == 200:
|
|
|
155
149
|
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
156
150
|
reserve_type="aFRR",
|
|
157
151
|
cursor=data.next_cursor,
|
|
158
|
-
limit=100
|
|
152
|
+
limit=100,
|
|
159
153
|
)
|
|
160
154
|
```
|
|
161
155
|
|
|
@@ -168,23 +162,22 @@ from datetime import datetime
|
|
|
168
162
|
from balancing_services import AuthenticatedClient
|
|
169
163
|
from balancing_services.api.default import get_imbalance_prices
|
|
170
164
|
|
|
165
|
+
|
|
171
166
|
async def fetch_prices():
|
|
172
|
-
client = AuthenticatedClient(
|
|
173
|
-
base_url="https://api.balancing.services/v2",
|
|
174
|
-
token="YOUR_TOKEN"
|
|
175
|
-
)
|
|
167
|
+
client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_TOKEN")
|
|
176
168
|
|
|
177
169
|
response = await get_imbalance_prices.asyncio_detailed(
|
|
178
170
|
client=client,
|
|
179
171
|
area="EE",
|
|
180
172
|
period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
|
|
181
|
-
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
|
|
173
|
+
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
182
174
|
)
|
|
183
175
|
|
|
184
176
|
if response.status_code == 200:
|
|
185
177
|
return response.parsed
|
|
186
178
|
return None
|
|
187
179
|
|
|
180
|
+
|
|
188
181
|
# Run async function
|
|
189
182
|
prices = asyncio.run(fetch_prices())
|
|
190
183
|
```
|
|
@@ -203,7 +196,7 @@ response = get_imbalance_prices.sync_detailed(
|
|
|
203
196
|
client=client,
|
|
204
197
|
area="EE",
|
|
205
198
|
period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
|
|
206
|
-
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
|
|
199
|
+
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
207
200
|
)
|
|
208
201
|
|
|
209
202
|
if response.status_code == 200:
|
|
@@ -400,7 +393,7 @@ if response.status_code == 400:
|
|
|
400
393
|
client = AuthenticatedClient(
|
|
401
394
|
base_url="https://api.balancing.services/v2",
|
|
402
395
|
token="YOUR_TOKEN",
|
|
403
|
-
timeout=30.0 # Increase from default
|
|
396
|
+
timeout=30.0, # Increase from default
|
|
404
397
|
)
|
|
405
398
|
```
|
|
406
399
|
- Reduce the date range in your request
|
|
@@ -415,8 +408,8 @@ client = AuthenticatedClient(
|
|
|
415
408
|
no enum member to import:
|
|
416
409
|
```python
|
|
417
410
|
# Correct
|
|
418
|
-
area="EE"
|
|
419
|
-
reserve_type="aFRR"
|
|
411
|
+
area = "EE"
|
|
412
|
+
reserve_type = "aFRR"
|
|
420
413
|
```
|
|
421
414
|
|
|
422
415
|
The accepted values for each enum are available as a `*_VALUES` set if you need
|
|
@@ -38,10 +38,7 @@ from balancing_services import AuthenticatedClient
|
|
|
38
38
|
from balancing_services.api.default import get_imbalance_prices
|
|
39
39
|
|
|
40
40
|
# Create an authenticated client
|
|
41
|
-
client = AuthenticatedClient(
|
|
42
|
-
base_url="https://api.balancing.services/v2",
|
|
43
|
-
token="YOUR_API_TOKEN"
|
|
44
|
-
)
|
|
41
|
+
client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_API_TOKEN")
|
|
45
42
|
|
|
46
43
|
# Get imbalance prices for Estonia. Enum-typed parameters take plain string
|
|
47
44
|
# values (e.g. area="EE") — see "Data Models" below.
|
|
@@ -49,7 +46,7 @@ response = get_imbalance_prices.sync_detailed(
|
|
|
49
46
|
client=client,
|
|
50
47
|
area="EE",
|
|
51
48
|
period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
|
|
52
|
-
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
|
|
49
|
+
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
53
50
|
)
|
|
54
51
|
|
|
55
52
|
if response.status_code == 200:
|
|
@@ -72,10 +69,7 @@ Include your token when creating the client:
|
|
|
72
69
|
```python
|
|
73
70
|
from balancing_services import AuthenticatedClient
|
|
74
71
|
|
|
75
|
-
client = AuthenticatedClient(
|
|
76
|
-
base_url="https://api.balancing.services/v2",
|
|
77
|
-
token="YOUR_API_TOKEN"
|
|
78
|
-
)
|
|
72
|
+
client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_API_TOKEN")
|
|
79
73
|
```
|
|
80
74
|
|
|
81
75
|
## Usage Examples
|
|
@@ -97,7 +91,7 @@ response = get_balancing_energy_bids.sync_detailed(
|
|
|
97
91
|
period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
|
|
98
92
|
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
99
93
|
reserve_type="aFRR",
|
|
100
|
-
limit=100
|
|
94
|
+
limit=100,
|
|
101
95
|
)
|
|
102
96
|
|
|
103
97
|
if response.status_code == 200:
|
|
@@ -119,7 +113,7 @@ if response.status_code == 200:
|
|
|
119
113
|
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
120
114
|
reserve_type="aFRR",
|
|
121
115
|
cursor=data.next_cursor,
|
|
122
|
-
limit=100
|
|
116
|
+
limit=100,
|
|
123
117
|
)
|
|
124
118
|
```
|
|
125
119
|
|
|
@@ -132,23 +126,22 @@ from datetime import datetime
|
|
|
132
126
|
from balancing_services import AuthenticatedClient
|
|
133
127
|
from balancing_services.api.default import get_imbalance_prices
|
|
134
128
|
|
|
129
|
+
|
|
135
130
|
async def fetch_prices():
|
|
136
|
-
client = AuthenticatedClient(
|
|
137
|
-
base_url="https://api.balancing.services/v2",
|
|
138
|
-
token="YOUR_TOKEN"
|
|
139
|
-
)
|
|
131
|
+
client = AuthenticatedClient(base_url="https://api.balancing.services/v2", token="YOUR_TOKEN")
|
|
140
132
|
|
|
141
133
|
response = await get_imbalance_prices.asyncio_detailed(
|
|
142
134
|
client=client,
|
|
143
135
|
area="EE",
|
|
144
136
|
period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
|
|
145
|
-
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
|
|
137
|
+
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
146
138
|
)
|
|
147
139
|
|
|
148
140
|
if response.status_code == 200:
|
|
149
141
|
return response.parsed
|
|
150
142
|
return None
|
|
151
143
|
|
|
144
|
+
|
|
152
145
|
# Run async function
|
|
153
146
|
prices = asyncio.run(fetch_prices())
|
|
154
147
|
```
|
|
@@ -167,7 +160,7 @@ response = get_imbalance_prices.sync_detailed(
|
|
|
167
160
|
client=client,
|
|
168
161
|
area="EE",
|
|
169
162
|
period_start_at=datetime.fromisoformat("2025-01-01T00:00:00Z"),
|
|
170
|
-
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z")
|
|
163
|
+
period_end_at=datetime.fromisoformat("2025-01-02T00:00:00Z"),
|
|
171
164
|
)
|
|
172
165
|
|
|
173
166
|
if response.status_code == 200:
|
|
@@ -364,7 +357,7 @@ if response.status_code == 400:
|
|
|
364
357
|
client = AuthenticatedClient(
|
|
365
358
|
base_url="https://api.balancing.services/v2",
|
|
366
359
|
token="YOUR_TOKEN",
|
|
367
|
-
timeout=30.0 # Increase from default
|
|
360
|
+
timeout=30.0, # Increase from default
|
|
368
361
|
)
|
|
369
362
|
```
|
|
370
363
|
- Reduce the date range in your request
|
|
@@ -379,8 +372,8 @@ client = AuthenticatedClient(
|
|
|
379
372
|
no enum member to import:
|
|
380
373
|
```python
|
|
381
374
|
# Correct
|
|
382
|
-
area="EE"
|
|
383
|
-
reserve_type="aFRR"
|
|
375
|
+
area = "EE"
|
|
376
|
+
reserve_type = "aFRR"
|
|
384
377
|
```
|
|
385
378
|
|
|
386
379
|
The accepted values for each enum are available as a `*_VALUES` set if you need
|
|
@@ -0,0 +1,321 @@
|
|
|
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.imbalance_total_volume_history_response import (
|
|
11
|
+
ImbalanceTotalVolumeHistoryResponse,
|
|
12
|
+
)
|
|
13
|
+
from ...models.problem import Problem
|
|
14
|
+
from ...types import UNSET, Response, Unset
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_kwargs(
|
|
18
|
+
*,
|
|
19
|
+
area: Area,
|
|
20
|
+
period_start_at: datetime.datetime,
|
|
21
|
+
period_end_at: datetime.datetime,
|
|
22
|
+
cursor: str | Unset = UNSET,
|
|
23
|
+
limit: int | Unset = 100,
|
|
24
|
+
updated_since: datetime.datetime | Unset = UNSET,
|
|
25
|
+
) -> dict[str, Any]:
|
|
26
|
+
|
|
27
|
+
params: dict[str, Any] = {}
|
|
28
|
+
|
|
29
|
+
json_area: str = area
|
|
30
|
+
params["area"] = json_area
|
|
31
|
+
|
|
32
|
+
json_period_start_at = period_start_at.isoformat()
|
|
33
|
+
params["period-start-at"] = json_period_start_at
|
|
34
|
+
|
|
35
|
+
json_period_end_at = period_end_at.isoformat()
|
|
36
|
+
params["period-end-at"] = json_period_end_at
|
|
37
|
+
|
|
38
|
+
params["cursor"] = cursor
|
|
39
|
+
|
|
40
|
+
params["limit"] = limit
|
|
41
|
+
|
|
42
|
+
json_updated_since: str | Unset = UNSET
|
|
43
|
+
if not isinstance(updated_since, Unset):
|
|
44
|
+
json_updated_since = updated_since.isoformat()
|
|
45
|
+
params["updated-since"] = json_updated_since
|
|
46
|
+
|
|
47
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
48
|
+
|
|
49
|
+
_kwargs: dict[str, Any] = {
|
|
50
|
+
"method": "get",
|
|
51
|
+
"url": "/imbalance/total-volumes/history",
|
|
52
|
+
"params": params,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return _kwargs
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _parse_response(
|
|
59
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
60
|
+
) -> ImbalanceTotalVolumeHistoryResponse | Problem | None:
|
|
61
|
+
if response.status_code == 200:
|
|
62
|
+
response_200 = ImbalanceTotalVolumeHistoryResponse.from_dict(response.json())
|
|
63
|
+
|
|
64
|
+
return response_200
|
|
65
|
+
|
|
66
|
+
if response.status_code == 400:
|
|
67
|
+
response_400 = Problem.from_dict(response.json())
|
|
68
|
+
|
|
69
|
+
return response_400
|
|
70
|
+
|
|
71
|
+
if response.status_code == 401:
|
|
72
|
+
response_401 = Problem.from_dict(response.json())
|
|
73
|
+
|
|
74
|
+
return response_401
|
|
75
|
+
|
|
76
|
+
if response.status_code == 403:
|
|
77
|
+
response_403 = Problem.from_dict(response.json())
|
|
78
|
+
|
|
79
|
+
return response_403
|
|
80
|
+
|
|
81
|
+
if response.status_code == 404:
|
|
82
|
+
response_404 = Problem.from_dict(response.json())
|
|
83
|
+
|
|
84
|
+
return response_404
|
|
85
|
+
|
|
86
|
+
if response.status_code == 429:
|
|
87
|
+
response_429 = Problem.from_dict(response.json())
|
|
88
|
+
|
|
89
|
+
return response_429
|
|
90
|
+
|
|
91
|
+
if response.status_code == 500:
|
|
92
|
+
response_500 = Problem.from_dict(response.json())
|
|
93
|
+
|
|
94
|
+
return response_500
|
|
95
|
+
|
|
96
|
+
if response.status_code == 501:
|
|
97
|
+
response_501 = Problem.from_dict(response.json())
|
|
98
|
+
|
|
99
|
+
return response_501
|
|
100
|
+
|
|
101
|
+
if client.raise_on_unexpected_status:
|
|
102
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
103
|
+
else:
|
|
104
|
+
return None
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _build_response(
|
|
108
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
109
|
+
) -> Response[ImbalanceTotalVolumeHistoryResponse | Problem]:
|
|
110
|
+
return Response(
|
|
111
|
+
status_code=HTTPStatus(response.status_code),
|
|
112
|
+
content=response.content,
|
|
113
|
+
headers=response.headers,
|
|
114
|
+
parsed=_parse_response(client=client, response=response),
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def sync_detailed(
|
|
119
|
+
*,
|
|
120
|
+
client: AuthenticatedClient | Client,
|
|
121
|
+
area: Area,
|
|
122
|
+
period_start_at: datetime.datetime,
|
|
123
|
+
period_end_at: datetime.datetime,
|
|
124
|
+
cursor: str | Unset = UNSET,
|
|
125
|
+
limit: int | Unset = 100,
|
|
126
|
+
updated_since: datetime.datetime | Unset = UNSET,
|
|
127
|
+
) -> Response[ImbalanceTotalVolumeHistoryResponse | Problem]:
|
|
128
|
+
"""Get the revision history of the total imbalance volumes for an area
|
|
129
|
+
|
|
130
|
+
**Experimental** - This endpoint is under active development and may change without notice.
|
|
131
|
+
|
|
132
|
+
Returns how the total imbalance volumes on `/imbalance/total-volumes` reached their current
|
|
133
|
+
values: the sequence of values held for a period, each stamped with the `observedAt` it was
|
|
134
|
+
recorded at. The response is the `/imbalance/total-volumes` shape with `observedAt` added to
|
|
135
|
+
each entry of `volumes`, which carries the revision entries, each period's ascending by
|
|
136
|
+
`observedAt` and the periods themselves in page order. A period appears once per change of
|
|
137
|
+
the value served for it — its direction or its magnitude — except for entries sharing an
|
|
138
|
+
`observedAt`, which are all returned because no order is recorded within an instant.
|
|
139
|
+
|
|
140
|
+
Args:
|
|
141
|
+
area (Area): Area code
|
|
142
|
+
period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
|
|
143
|
+
period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
|
|
144
|
+
cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
|
|
145
|
+
limit (int | Unset): Default: 100. Example: 100.
|
|
146
|
+
updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
|
|
147
|
+
|
|
148
|
+
Raises:
|
|
149
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
150
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
Response[ImbalanceTotalVolumeHistoryResponse | Problem]
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
kwargs = _get_kwargs(
|
|
157
|
+
area=area,
|
|
158
|
+
period_start_at=period_start_at,
|
|
159
|
+
period_end_at=period_end_at,
|
|
160
|
+
cursor=cursor,
|
|
161
|
+
limit=limit,
|
|
162
|
+
updated_since=updated_since,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
response = client.get_httpx_client().request(
|
|
166
|
+
**kwargs,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
return _build_response(client=client, response=response)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def sync(
|
|
173
|
+
*,
|
|
174
|
+
client: AuthenticatedClient | Client,
|
|
175
|
+
area: Area,
|
|
176
|
+
period_start_at: datetime.datetime,
|
|
177
|
+
period_end_at: datetime.datetime,
|
|
178
|
+
cursor: str | Unset = UNSET,
|
|
179
|
+
limit: int | Unset = 100,
|
|
180
|
+
updated_since: datetime.datetime | Unset = UNSET,
|
|
181
|
+
) -> ImbalanceTotalVolumeHistoryResponse | Problem | None:
|
|
182
|
+
"""Get the revision history of the total imbalance volumes for an area
|
|
183
|
+
|
|
184
|
+
**Experimental** - This endpoint is under active development and may change without notice.
|
|
185
|
+
|
|
186
|
+
Returns how the total imbalance volumes on `/imbalance/total-volumes` reached their current
|
|
187
|
+
values: the sequence of values held for a period, each stamped with the `observedAt` it was
|
|
188
|
+
recorded at. The response is the `/imbalance/total-volumes` shape with `observedAt` added to
|
|
189
|
+
each entry of `volumes`, which carries the revision entries, each period's ascending by
|
|
190
|
+
`observedAt` and the periods themselves in page order. A period appears once per change of
|
|
191
|
+
the value served for it — its direction or its magnitude — except for entries sharing an
|
|
192
|
+
`observedAt`, which are all returned because no order is recorded within an instant.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
area (Area): Area code
|
|
196
|
+
period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
|
|
197
|
+
period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
|
|
198
|
+
cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
|
|
199
|
+
limit (int | Unset): Default: 100. Example: 100.
|
|
200
|
+
updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
|
|
201
|
+
|
|
202
|
+
Raises:
|
|
203
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
204
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
205
|
+
|
|
206
|
+
Returns:
|
|
207
|
+
ImbalanceTotalVolumeHistoryResponse | Problem
|
|
208
|
+
"""
|
|
209
|
+
|
|
210
|
+
return sync_detailed(
|
|
211
|
+
client=client,
|
|
212
|
+
area=area,
|
|
213
|
+
period_start_at=period_start_at,
|
|
214
|
+
period_end_at=period_end_at,
|
|
215
|
+
cursor=cursor,
|
|
216
|
+
limit=limit,
|
|
217
|
+
updated_since=updated_since,
|
|
218
|
+
).parsed
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
async def asyncio_detailed(
|
|
222
|
+
*,
|
|
223
|
+
client: AuthenticatedClient | Client,
|
|
224
|
+
area: Area,
|
|
225
|
+
period_start_at: datetime.datetime,
|
|
226
|
+
period_end_at: datetime.datetime,
|
|
227
|
+
cursor: str | Unset = UNSET,
|
|
228
|
+
limit: int | Unset = 100,
|
|
229
|
+
updated_since: datetime.datetime | Unset = UNSET,
|
|
230
|
+
) -> Response[ImbalanceTotalVolumeHistoryResponse | Problem]:
|
|
231
|
+
"""Get the revision history of the total imbalance volumes for an area
|
|
232
|
+
|
|
233
|
+
**Experimental** - This endpoint is under active development and may change without notice.
|
|
234
|
+
|
|
235
|
+
Returns how the total imbalance volumes on `/imbalance/total-volumes` reached their current
|
|
236
|
+
values: the sequence of values held for a period, each stamped with the `observedAt` it was
|
|
237
|
+
recorded at. The response is the `/imbalance/total-volumes` shape with `observedAt` added to
|
|
238
|
+
each entry of `volumes`, which carries the revision entries, each period's ascending by
|
|
239
|
+
`observedAt` and the periods themselves in page order. A period appears once per change of
|
|
240
|
+
the value served for it — its direction or its magnitude — except for entries sharing an
|
|
241
|
+
`observedAt`, which are all returned because no order is recorded within an instant.
|
|
242
|
+
|
|
243
|
+
Args:
|
|
244
|
+
area (Area): Area code
|
|
245
|
+
period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
|
|
246
|
+
period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
|
|
247
|
+
cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
|
|
248
|
+
limit (int | Unset): Default: 100. Example: 100.
|
|
249
|
+
updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
|
|
250
|
+
|
|
251
|
+
Raises:
|
|
252
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
253
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
254
|
+
|
|
255
|
+
Returns:
|
|
256
|
+
Response[ImbalanceTotalVolumeHistoryResponse | Problem]
|
|
257
|
+
"""
|
|
258
|
+
|
|
259
|
+
kwargs = _get_kwargs(
|
|
260
|
+
area=area,
|
|
261
|
+
period_start_at=period_start_at,
|
|
262
|
+
period_end_at=period_end_at,
|
|
263
|
+
cursor=cursor,
|
|
264
|
+
limit=limit,
|
|
265
|
+
updated_since=updated_since,
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
269
|
+
|
|
270
|
+
return _build_response(client=client, response=response)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
async def asyncio(
|
|
274
|
+
*,
|
|
275
|
+
client: AuthenticatedClient | Client,
|
|
276
|
+
area: Area,
|
|
277
|
+
period_start_at: datetime.datetime,
|
|
278
|
+
period_end_at: datetime.datetime,
|
|
279
|
+
cursor: str | Unset = UNSET,
|
|
280
|
+
limit: int | Unset = 100,
|
|
281
|
+
updated_since: datetime.datetime | Unset = UNSET,
|
|
282
|
+
) -> ImbalanceTotalVolumeHistoryResponse | Problem | None:
|
|
283
|
+
"""Get the revision history of the total imbalance volumes for an area
|
|
284
|
+
|
|
285
|
+
**Experimental** - This endpoint is under active development and may change without notice.
|
|
286
|
+
|
|
287
|
+
Returns how the total imbalance volumes on `/imbalance/total-volumes` reached their current
|
|
288
|
+
values: the sequence of values held for a period, each stamped with the `observedAt` it was
|
|
289
|
+
recorded at. The response is the `/imbalance/total-volumes` shape with `observedAt` added to
|
|
290
|
+
each entry of `volumes`, which carries the revision entries, each period's ascending by
|
|
291
|
+
`observedAt` and the periods themselves in page order. A period appears once per change of
|
|
292
|
+
the value served for it — its direction or its magnitude — except for entries sharing an
|
|
293
|
+
`observedAt`, which are all returned because no order is recorded within an instant.
|
|
294
|
+
|
|
295
|
+
Args:
|
|
296
|
+
area (Area): Area code
|
|
297
|
+
period_start_at (datetime.datetime): Example: 2025-01-01T00:00:00Z.
|
|
298
|
+
period_end_at (datetime.datetime): Example: 2025-01-02T00:00:00Z.
|
|
299
|
+
cursor (str | Unset): Example: v1:AAAAAYwBAgMEBQYHCAkKCw==.
|
|
300
|
+
limit (int | Unset): Default: 100. Example: 100.
|
|
301
|
+
updated_since (datetime.datetime | Unset): Example: 2025-01-02T09:15:00Z.
|
|
302
|
+
|
|
303
|
+
Raises:
|
|
304
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
305
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
306
|
+
|
|
307
|
+
Returns:
|
|
308
|
+
ImbalanceTotalVolumeHistoryResponse | Problem
|
|
309
|
+
"""
|
|
310
|
+
|
|
311
|
+
return (
|
|
312
|
+
await asyncio_detailed(
|
|
313
|
+
client=client,
|
|
314
|
+
area=area,
|
|
315
|
+
period_start_at=period_start_at,
|
|
316
|
+
period_end_at=period_end_at,
|
|
317
|
+
cursor=cursor,
|
|
318
|
+
limit=limit,
|
|
319
|
+
updated_since=updated_since,
|
|
320
|
+
)
|
|
321
|
+
).parsed
|
|
@@ -58,6 +58,8 @@ from .imbalance_price_history_response import ImbalancePriceHistoryResponse
|
|
|
58
58
|
from .imbalance_price_revision import ImbalancePriceRevision
|
|
59
59
|
from .imbalance_prices import ImbalancePrices
|
|
60
60
|
from .imbalance_prices_response import ImbalancePricesResponse
|
|
61
|
+
from .imbalance_total_volume_history import ImbalanceTotalVolumeHistory
|
|
62
|
+
from .imbalance_total_volume_history_response import ImbalanceTotalVolumeHistoryResponse
|
|
61
63
|
from .imbalance_total_volumes import ImbalanceTotalVolumes
|
|
62
64
|
from .imbalance_total_volumes_response import ImbalanceTotalVolumesResponse
|
|
63
65
|
from .period import Period
|
|
@@ -66,6 +68,7 @@ from .procurement import Procurement
|
|
|
66
68
|
from .reserve_type import ReserveType
|
|
67
69
|
from .total_imbalance_direction import TotalImbalanceDirection
|
|
68
70
|
from .total_imbalance_volume import TotalImbalanceVolume
|
|
71
|
+
from .total_imbalance_volume_revision import TotalImbalanceVolumeRevision
|
|
69
72
|
|
|
70
73
|
__all__ = (
|
|
71
74
|
"ActivationType",
|
|
@@ -122,6 +125,8 @@ __all__ = (
|
|
|
122
125
|
"ImbalancePriceRevision",
|
|
123
126
|
"ImbalancePrices",
|
|
124
127
|
"ImbalancePricesResponse",
|
|
128
|
+
"ImbalanceTotalVolumeHistory",
|
|
129
|
+
"ImbalanceTotalVolumeHistoryResponse",
|
|
125
130
|
"ImbalanceTotalVolumes",
|
|
126
131
|
"ImbalanceTotalVolumesResponse",
|
|
127
132
|
"Period",
|
|
@@ -130,4 +135,5 @@ __all__ = (
|
|
|
130
135
|
"ReserveType",
|
|
131
136
|
"TotalImbalanceDirection",
|
|
132
137
|
"TotalImbalanceVolume",
|
|
138
|
+
"TotalImbalanceVolumeRevision",
|
|
133
139
|
)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.area import Area, check_area
|
|
10
|
+
from ..models.eic_code import EicCode, check_eic_code
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from ..models.total_imbalance_volume_revision import TotalImbalanceVolumeRevision
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="ImbalanceTotalVolumeHistory")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class ImbalanceTotalVolumeHistory:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
area (Area): Area code
|
|
24
|
+
eic_code (EicCode): Energy Identification Code (EIC)
|
|
25
|
+
volumes (list[TotalImbalanceVolumeRevision]): Revision entries, each period's ascending by observedAt; direction
|
|
26
|
+
can vary per entry
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
area: Area
|
|
30
|
+
eic_code: EicCode
|
|
31
|
+
volumes: list[TotalImbalanceVolumeRevision]
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
area: str = self.area
|
|
36
|
+
|
|
37
|
+
eic_code: str = self.eic_code
|
|
38
|
+
|
|
39
|
+
volumes = []
|
|
40
|
+
for volumes_item_data in self.volumes:
|
|
41
|
+
volumes_item = volumes_item_data.to_dict()
|
|
42
|
+
volumes.append(volumes_item)
|
|
43
|
+
|
|
44
|
+
field_dict: dict[str, Any] = {}
|
|
45
|
+
field_dict.update(self.additional_properties)
|
|
46
|
+
field_dict.update(
|
|
47
|
+
{
|
|
48
|
+
"area": area,
|
|
49
|
+
"eicCode": eic_code,
|
|
50
|
+
"volumes": volumes,
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return field_dict
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
58
|
+
from ..models.total_imbalance_volume_revision import (
|
|
59
|
+
TotalImbalanceVolumeRevision,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
d = dict(src_dict)
|
|
63
|
+
area = check_area(d.pop("area"))
|
|
64
|
+
|
|
65
|
+
eic_code = check_eic_code(d.pop("eicCode"))
|
|
66
|
+
|
|
67
|
+
volumes = []
|
|
68
|
+
_volumes = d.pop("volumes")
|
|
69
|
+
for volumes_item_data in _volumes:
|
|
70
|
+
volumes_item = TotalImbalanceVolumeRevision.from_dict(volumes_item_data)
|
|
71
|
+
|
|
72
|
+
volumes.append(volumes_item)
|
|
73
|
+
|
|
74
|
+
imbalance_total_volume_history = cls(
|
|
75
|
+
area=area,
|
|
76
|
+
eic_code=eic_code,
|
|
77
|
+
volumes=volumes,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
imbalance_total_volume_history.additional_properties = d
|
|
81
|
+
return imbalance_total_volume_history
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def additional_keys(self) -> list[str]:
|
|
85
|
+
return list(self.additional_properties.keys())
|
|
86
|
+
|
|
87
|
+
def __getitem__(self, key: str) -> Any:
|
|
88
|
+
return self.additional_properties[key]
|
|
89
|
+
|
|
90
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
91
|
+
self.additional_properties[key] = value
|
|
92
|
+
|
|
93
|
+
def __delitem__(self, key: str) -> None:
|
|
94
|
+
del self.additional_properties[key]
|
|
95
|
+
|
|
96
|
+
def __contains__(self, key: str) -> bool:
|
|
97
|
+
return key in self.additional_properties
|