narwhalapi 0.1.0__tar.gz → 0.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.
Files changed (25) hide show
  1. narwhalapi-0.3.0/CHANGELOG.md +49 -0
  2. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/PKG-INFO +1 -1
  3. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/pyproject.toml +1 -1
  4. narwhalapi-0.3.0/src/narwhalapi/_generated/__init__.py +3 -0
  5. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/_generated/models.py +312 -2
  6. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/_generated/operations.py +563 -11
  7. narwhalapi-0.3.0/src/narwhalapi/_version.py +1 -0
  8. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/codes.py +10 -0
  9. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/models.py +26 -2
  10. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/webhooks.py +3 -3
  11. narwhalapi-0.1.0/CHANGELOG.md +0 -14
  12. narwhalapi-0.1.0/src/narwhalapi/_generated/__init__.py +0 -3
  13. narwhalapi-0.1.0/src/narwhalapi/_version.py +0 -1
  14. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/LICENSE +0 -0
  15. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/README.md +0 -0
  16. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/hatch_build.py +0 -0
  17. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/__init__.py +0 -0
  18. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/_client.py +0 -0
  19. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/_deadline.py +0 -0
  20. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/_decode.py +0 -0
  21. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/_meta.py +0 -0
  22. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/_pagination.py +0 -0
  23. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/_transport.py +0 -0
  24. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/errors.py +0 -0
  25. {narwhalapi-0.1.0 → narwhalapi-0.3.0}/src/narwhalapi/py.typed +0 -0
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ ## 0.3.0 — 2026-10-18
4
+
5
+ - Breaking: `webhooks.verify` now returns a `WebhookEvent`, read from the delivery bodies the
6
+ API documents. 0.2.0 read deliveries as the REST `DeliveryEvent`, which needs an `event_type`
7
+ field that webhook bodies never carry, so it rejected real deliveries with `invalid_body`.
8
+ `WebhookEvent` reads economics, release calendar and holiday events, prediction events
9
+ (`prediction`, with the event status and venue settlements) and test deliveries (`is_test`,
10
+ no `cursor`). Unknown event types still decode, with the type kept as a string.
11
+ - `economics.read_series_observations(series_id, ...)` reads the observations of one economic
12
+ series by its id, with a page iterator (`read_series_observations_iter`).
13
+ - Prediction history (`binary_history`, `scalar_history`, `extreme_history`, `timing_history`)
14
+ now comes in pages of about 5,000 bars with a `next_cursor`. Pass `cursor`, or use the new
15
+ `…_iter` iterators, to read a whole window; each page repeats the series keys with the next
16
+ slice of bars. The API pages these responses for every version, so 0.2.0 sees only the first
17
+ page of a wide window.
18
+ - Webhook destinations carry `disabled_reason`: `customer` (switched off by the account),
19
+ `plan_limit` (paused because the plan no longer includes it) or none.
20
+ - New code constants for the documented errors: `SNAPSHOT_UNAVAILABLE`, `REQUEST_TOO_LARGE`,
21
+ `RIGHTS_STATE_CHANGING`, `COMMAND_UNAVAILABLE`, `PHYSICAL_SERIES_NOT_FOUND`,
22
+ `PHYSICAL_REFERENCE_UNAVAILABLE`, `EVENT_NOT_FOUND`, `PREDICTIONS_UNAVAILABLE` and
23
+ `LIMIT_REACHED`.
24
+ - No change on the wire: the contract now names the palm oil price unions and the shared
25
+ problem response, and documents `400` instead of `422` for webhook and calendar subscription
26
+ validation errors, which is what the API always returned.
27
+
28
+ ## 0.2.0 — 2026-10-12
29
+
30
+ - Breaking: economic calendar releases now carry Narwhal's English `name`, a permanent
31
+ `series_id`, a `topic` and a `stage` beside the publisher's `title`, and each schedule
32
+ carries its `local_date`. The API lists releases compactly by default; the SDK always asks
33
+ for the full release (`view=full`), so every field stays typed. Research articles are no
34
+ longer listed.
35
+ - `CALENDAR_NOT_PUBLISHED` for the 404 returned when a holiday calendar year is not published.
36
+ - FX bars publish their five fields again in the contract (no wire change).
37
+
38
+ ## 0.1.0 — 2026-10-09
39
+
40
+ - Initial typed synchronous and asynchronous clients for the stable API: economics,
41
+ FX, calendars, physical palm oil, spot prices (`commodities.spot_price`), events,
42
+ webhook destinations and calendar subscriptions.
43
+ - `nw.unstable` holds operations not yet in the live API; it is empty in this release.
44
+ - Exact decimals, typed errors, bounded retries, page iterators, response metadata,
45
+ and local webhook signature verification.
46
+ - `codes.PLAN_UPGRADE_REQUIRED` for the 403 returned when a request reaches before the
47
+ plan's history window.
48
+ - The release also covers prediction market reads, FX and commodity bar history, and physical commodity reference price series.
49
+ - Spot `bid` and `ask` are optional because the API may omit them.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: narwhalapi
3
- Version: 0.1.0
3
+ Version: 0.3.0
4
4
  Summary: Typed clients for the Narwhal API
5
5
  Project-URL: Homepage, https://narwhalapi.com
6
6
  Author-email: Narwhal API Team <support@narwhalapi.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "narwhalapi"
7
- version = "0.1.0"
7
+ version = "0.3.0"
8
8
  description = "Typed clients for the Narwhal API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -0,0 +1,3 @@
1
+ # Generated from spec/live/openapi.json sha256 a8f87a3ac708cc35c7a08fa69c5bf4c3edeea4259ff31a8cc7a3f6ded6b553a8. Do not edit.
2
+ # Generated from spec/next/openapi.json sha256 a8f87a3ac708cc35c7a08fa69c5bf4c3edeea4259ff31a8cc7a3f6ded6b553a8. Do not edit.
3
+ """Generated contract surface."""
@@ -1,5 +1,5 @@
1
- # Generated from spec/live/openapi.json sha256 b60f17d48a2e406d95b34c274a80961d2a3de2b5e7b056a082d0ded894340420. Do not edit.
2
- # Generated from spec/next/openapi.json sha256 b60f17d48a2e406d95b34c274a80961d2a3de2b5e7b056a082d0ded894340420. Do not edit.
1
+ # Generated from spec/live/openapi.json sha256 a8f87a3ac708cc35c7a08fa69c5bf4c3edeea4259ff31a8cc7a3f6ded6b553a8. Do not edit.
2
+ # Generated from spec/next/openapi.json sha256 a8f87a3ac708cc35c7a08fa69c5bf4c3edeea4259ff31a8cc7a3f6ded6b553a8. Do not edit.
3
3
  from __future__ import annotations
4
4
 
5
5
  from dataclasses import dataclass, field
@@ -301,6 +301,14 @@ class PredictionShape:
301
301
  TIMING: Literal["timing"] = "timing"
302
302
 
303
303
 
304
+ class PredictionWebhookStatus:
305
+ """Known values; response fields also accept future strings."""
306
+
307
+ CLOSED: Literal["closed"] = "closed"
308
+ SETTLED: Literal["settled"] = "settled"
309
+ VOID: Literal["void"] = "void"
310
+
311
+
304
312
  class ProducerArrangement:
305
313
  """Known values; response fields also accept future strings."""
306
314
 
@@ -323,6 +331,18 @@ class QuoteRole:
323
331
  EXCLUDED: Literal["excluded"] = "excluded"
324
332
 
325
333
 
334
+ class ReleaseStage:
335
+ """Known values; response fields also accept future strings."""
336
+
337
+ ADVANCE: Literal["advance"] = "advance"
338
+ FINAL: Literal["final"] = "final"
339
+ FIRST: Literal["first"] = "first"
340
+ FLASH: Literal["flash"] = "flash"
341
+ PRELIMINARY: Literal["preliminary"] = "preliminary"
342
+ SECOND: Literal["second"] = "second"
343
+ THIRD: Literal["third"] = "third"
344
+
345
+
326
346
  class ReleaseStatus:
327
347
  """Known values; response fields also accept future strings."""
328
348
 
@@ -331,6 +351,42 @@ class ReleaseStatus:
331
351
  SCHEDULED: Literal["scheduled"] = "scheduled"
332
352
 
333
353
 
354
+ class ReleaseTopic:
355
+ """Known values; response fields also accept future strings."""
356
+
357
+ BALANCE_OF_PAYMENTS: Literal["balance_of_payments"] = "balance_of_payments"
358
+ BUSINESS_CONFIDENCE: Literal["business_confidence"] = "business_confidence"
359
+ CONSTRUCTION: Literal["construction"] = "construction"
360
+ CONSUMER_CONFIDENCE: Literal["consumer_confidence"] = "consumer_confidence"
361
+ CONSUMER_PRICES: Literal["consumer_prices"] = "consumer_prices"
362
+ EMPLOYMENT: Literal["employment"] = "employment"
363
+ ENERGY: Literal["energy"] = "energy"
364
+ GDP: Literal["gdp"] = "gdp"
365
+ HOME_SALES: Literal["home_sales"] = "home_sales"
366
+ HOUSE_PRICES: Literal["house_prices"] = "house_prices"
367
+ HOUSEHOLD_SPENDING: Literal["household_spending"] = "household_spending"
368
+ HOUSING_CONSTRUCTION: Literal["housing_construction"] = "housing_construction"
369
+ IMPORT_EXPORT_PRICES: Literal["import_export_prices"] = "import_export_prices"
370
+ INDUSTRIAL_PRODUCTION: Literal["industrial_production"] = "industrial_production"
371
+ INVESTMENT: Literal["investment"] = "investment"
372
+ JOBLESS_CLAIMS: Literal["jobless_claims"] = "jobless_claims"
373
+ LABOUR_FORCE: Literal["labour_force"] = "labour_force"
374
+ MANUFACTURING: Literal["manufacturing"] = "manufacturing"
375
+ MERCHANDISE_TRADE: Literal["merchandise_trade"] = "merchandise_trade"
376
+ MONEY_CREDIT: Literal["money_credit"] = "money_credit"
377
+ OTHER: Literal["other"] = "other"
378
+ POLICY_COMMUNICATION: Literal["policy_communication"] = "policy_communication"
379
+ POLICY_MINUTES: Literal["policy_minutes"] = "policy_minutes"
380
+ POLICY_RATE: Literal["policy_rate"] = "policy_rate"
381
+ PRODUCER_PRICES: Literal["producer_prices"] = "producer_prices"
382
+ PUBLIC_FINANCE: Literal["public_finance"] = "public_finance"
383
+ RETAIL_SALES: Literal["retail_sales"] = "retail_sales"
384
+ SERVICES: Literal["services"] = "services"
385
+ TOURISM: Literal["tourism"] = "tourism"
386
+ WAGES: Literal["wages"] = "wages"
387
+ WHOLESALE_TRADE: Literal["wholesale_trade"] = "wholesale_trade"
388
+
389
+
334
390
  class ResolutionKind:
335
391
  """Known values; response fields also accept future strings."""
336
392
 
@@ -340,6 +396,32 @@ class ResolutionKind:
340
396
  RELEASE: Literal["release"] = "release"
341
397
 
342
398
 
399
+ class ResourceObservationStatus:
400
+ """Known values; response fields also accept future strings."""
401
+
402
+ BREAK_IN_SERIES: Literal["break_in_series"] = "break_in_series"
403
+ BREAK_IN_SERIES_AND_DEFINITION_DIFFERS: Literal[
404
+ "break_in_series_and_definition_differs"
405
+ ] = "break_in_series_and_definition_differs"
406
+ DEFINITION_DIFFERS: Literal["definition_differs"] = "definition_differs"
407
+ ESTIMATED: Literal["estimated"] = "estimated"
408
+ PROVISIONAL: Literal["provisional"] = "provisional"
409
+
410
+
411
+ class ResourceUnit:
412
+ """Known values; response fields also accept future strings."""
413
+
414
+ CURRENCY: Literal["currency"] = "currency"
415
+ CURRENCY_PER_HOUR: Literal["currency_per_hour"] = "currency_per_hour"
416
+ CURRENCY_PER_MONTH: Literal["currency_per_month"] = "currency_per_month"
417
+ CURRENCY_PER_WEEK: Literal["currency_per_week"] = "currency_per_week"
418
+ CURRENCY_PER_YEAR: Literal["currency_per_year"] = "currency_per_year"
419
+ INDEX: Literal["index"] = "index"
420
+ JOB: Literal["job"] = "job"
421
+ PERCENT: Literal["percent"] = "percent"
422
+ PERSON: Literal["person"] = "person"
423
+
424
+
343
425
  class SchedulePrecision:
344
426
  """Known values; response fields also accept future strings."""
345
427
 
@@ -455,6 +537,36 @@ class WebhookDeliveryState:
455
537
  SUCCEEDED: Literal["succeeded"] = "succeeded"
456
538
 
457
539
 
540
+ class WebhookDisabledReason:
541
+ """Known values; response fields also accept future strings."""
542
+
543
+ CUSTOMER: Literal["customer"] = "customer"
544
+ PLAN_LIMIT: Literal["plan_limit"] = "plan_limit"
545
+
546
+
547
+ class WebhookEventType:
548
+ """Known values; response fields also accept future strings."""
549
+
550
+ DATASET_PUBLISHED: Literal["dataset.published"] = "dataset.published"
551
+ DATASET_REVISED: Literal["dataset.revised"] = "dataset.revised"
552
+ HOLIDAY_CALENDAR_REVISED: Literal["holiday.calendar.revised"] = (
553
+ "holiday.calendar.revised"
554
+ )
555
+ PREDICTION_EVENT_CLOSED: Literal["prediction.event.closed"] = (
556
+ "prediction.event.closed"
557
+ )
558
+ PREDICTION_EVENT_SETTLED: Literal["prediction.event.settled"] = (
559
+ "prediction.event.settled"
560
+ )
561
+ RELEASE_CANCELLED: Literal["release.cancelled"] = "release.cancelled"
562
+ RELEASE_RESCHEDULED: Literal["release.rescheduled"] = "release.rescheduled"
563
+ RELEASE_SCHEDULED: Literal["release.scheduled"] = "release.scheduled"
564
+ RELEASE_UPDATED: Literal["release.updated"] = "release.updated"
565
+ WEBHOOK_TEST: Literal["webhook.test"] = "webhook.test"
566
+ YIELD_CURVE_PUBLISHED: Literal["yield_curve.published"] = "yield_curve.published"
567
+ YIELD_CURVE_REVISED: Literal["yield_curve.revised"] = "yield_curve.revised"
568
+
569
+
458
570
  class WebhookFamily:
459
571
  """Known values; response fields also accept future strings."""
460
572
 
@@ -682,6 +794,7 @@ class EconomicRelease:
682
794
  country: str
683
795
  family: str
684
796
  indicators: list[EconomicReleaseIndicator] | None = None
797
+ name: str
685
798
  notice: str | None = None
686
799
  observed_at: str | None = None
687
800
  officially_published_at: str | None = None
@@ -689,8 +802,11 @@ class EconomicRelease:
689
802
  release_id: str
690
803
  revision: int | None = None
691
804
  schedule: EconomicReleaseSchedule
805
+ series_id: str | None = None
806
+ stage: str | None = None
692
807
  status: str
693
808
  title: str
809
+ topic: str | None = None
694
810
  variant: str | None = None
695
811
  version: str
696
812
  meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
@@ -721,6 +837,7 @@ class EconomicReleaseIndicator:
721
837
  class EconomicReleaseSchedule:
722
838
  at: str | None = None
723
839
  date: str | None = None
840
+ local_date: str | None = None
724
841
  precision: str
725
842
  time_basis: str | None = None
726
843
  timezone: str | None = None
@@ -1250,6 +1367,7 @@ class PredictionHistory:
1250
1367
  end: str
1251
1368
  event_id: str
1252
1369
  interval: str
1370
+ next_cursor: str | None = None
1253
1371
  series: list[PredictionSeries]
1254
1372
  shape: str
1255
1373
  start: str
@@ -1330,6 +1448,24 @@ class PredictionVenue:
1330
1448
  weight: str | None = None
1331
1449
 
1332
1450
 
1451
+ @dataclass(frozen=True, slots=True, kw_only=True)
1452
+ class PredictionWebhookEvent:
1453
+ closes_at: str | None = None
1454
+ event_id: str
1455
+ release_id: str | None = None
1456
+ resolves_at: str | None = None
1457
+ settlements: list[PredictionWebhookSettlement]
1458
+ shape: str
1459
+ status: str
1460
+ topic_id: str
1461
+
1462
+
1463
+ @dataclass(frozen=True, slots=True, kw_only=True)
1464
+ class PredictionWebhookSettlement:
1465
+ status: str
1466
+ venue: str
1467
+
1468
+
1333
1469
  @dataclass(frozen=True, slots=True, kw_only=True)
1334
1470
  class Problem:
1335
1471
  code: str
@@ -1350,6 +1486,26 @@ class Quote:
1350
1486
  venue: str
1351
1487
 
1352
1488
 
1489
+ @dataclass(frozen=True, slots=True, kw_only=True)
1490
+ class ResourceHistory:
1491
+ country: str
1492
+ currency: str | None = None
1493
+ next_cursor: str | None = None
1494
+ observations: list[ResourceObservation]
1495
+ series_id: str
1496
+ source: SeriesSource | None = None
1497
+ unit: str
1498
+ meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
1499
+
1500
+
1501
+ @dataclass(frozen=True, slots=True, kw_only=True)
1502
+ class ResourceObservation:
1503
+ period: str
1504
+ released_on: str | None = None
1505
+ status: str | None = None
1506
+ value: Decimal
1507
+
1508
+
1353
1509
  @dataclass(frozen=True, slots=True, kw_only=True)
1354
1510
  class ScalarBody:
1355
1511
  outcomes: list[ScalarOutcome]
@@ -1573,6 +1729,7 @@ class WebhookDestinationCreated:
1573
1729
  countries: list[str]
1574
1730
  created_at: str
1575
1731
  destination_id: str
1732
+ disabled_reason: str | None = None
1576
1733
  enabled: bool
1577
1734
  families: list[str]
1578
1735
  secret: str
@@ -1603,6 +1760,7 @@ class WebhookDestinationResponse:
1603
1760
  countries: list[str]
1604
1761
  created_at: str
1605
1762
  destination_id: str
1763
+ disabled_reason: str | None = None
1606
1764
  enabled: bool
1607
1765
  families: list[str]
1608
1766
  secret_version: int
@@ -1611,6 +1769,26 @@ class WebhookDestinationResponse:
1611
1769
  meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
1612
1770
 
1613
1771
 
1772
+ @dataclass(frozen=True, slots=True, kw_only=True)
1773
+ class WebhookEvent:
1774
+ country: str | None = None
1775
+ cursor: str | None = None
1776
+ event_id: str
1777
+ family: str | None = None
1778
+ holiday_country: str | None = None
1779
+ holiday_generation: int | None = None
1780
+ holiday_year: int | None = None
1781
+ is_test: bool | None = None
1782
+ prediction: PredictionWebhookEvent | None = None
1783
+ publication_id: str | None = None
1784
+ recorded_at: str
1785
+ release_id: str | None = None
1786
+ resource_id: str | None = None
1787
+ resource_version: str | None = None
1788
+ schema_version: str
1789
+ type: str
1790
+
1791
+
1614
1792
  @dataclass(frozen=True, slots=True, kw_only=True)
1615
1793
  class WebhookHistoryResponse:
1616
1794
  history: list[WebhookConfigurationHistory]
@@ -2064,6 +2242,7 @@ def decode_EconomicRelease(
2064
2242
  ]
2065
2243
  if data.get("indicators") is not None
2066
2244
  else None,
2245
+ name=read_str(data["name"]),
2067
2246
  notice=read_str(data["notice"]) if data.get("notice") is not None else None,
2068
2247
  observed_at=read_str(data["observed_at"])
2069
2248
  if data.get("observed_at") is not None
@@ -2079,8 +2258,13 @@ def decode_EconomicRelease(
2079
2258
  if data.get("revision") is not None
2080
2259
  else None,
2081
2260
  schedule=decode_EconomicReleaseSchedule(data["schedule"]),
2261
+ series_id=read_str(data["series_id"])
2262
+ if data.get("series_id") is not None
2263
+ else None,
2264
+ stage=read_str(data["stage"]) if data.get("stage") is not None else None,
2082
2265
  status=read_str(data["status"]),
2083
2266
  title=read_str(data["title"]),
2267
+ topic=read_str(data["topic"]) if data.get("topic") is not None else None,
2084
2268
  variant=read_str(data["variant"]) if data.get("variant") is not None else None,
2085
2269
  version=read_str(data["version"]),
2086
2270
  meta=meta if meta is not None else ResponseMeta(),
@@ -2133,6 +2317,9 @@ def decode_EconomicReleaseSchedule(
2133
2317
  return EconomicReleaseSchedule(
2134
2318
  at=read_str(data["at"]) if data.get("at") is not None else None,
2135
2319
  date=read_str(data["date"]) if data.get("date") is not None else None,
2320
+ local_date=read_str(data["local_date"])
2321
+ if data.get("local_date") is not None
2322
+ else None,
2136
2323
  precision=read_str(data["precision"]),
2137
2324
  time_basis=read_str(data["time_basis"])
2138
2325
  if data.get("time_basis") is not None
@@ -2957,6 +3144,9 @@ def decode_PredictionHistory(
2957
3144
  end=read_str(data["end"]),
2958
3145
  event_id=read_str(data["event_id"]),
2959
3146
  interval=read_str(data["interval"]),
3147
+ next_cursor=read_cursor(data["next_cursor"])
3148
+ if data.get("next_cursor") is not None
3149
+ else None,
2960
3150
  series=[decode_PredictionSeries(item0) for item0 in read_list(data["series"])],
2961
3151
  shape=read_str(data["shape"]),
2962
3152
  start=read_str(data["start"]),
@@ -3096,6 +3286,41 @@ def decode_PredictionVenue(
3096
3286
  )
3097
3287
 
3098
3288
 
3289
+ def decode_PredictionWebhookEvent(
3290
+ value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
3291
+ ) -> PredictionWebhookEvent:
3292
+ data = read_object(value)
3293
+ return PredictionWebhookEvent(
3294
+ closes_at=read_str(data["closes_at"])
3295
+ if data.get("closes_at") is not None
3296
+ else None,
3297
+ event_id=read_str(data["event_id"]),
3298
+ release_id=read_str(data["release_id"])
3299
+ if data.get("release_id") is not None
3300
+ else None,
3301
+ resolves_at=read_str(data["resolves_at"])
3302
+ if data.get("resolves_at") is not None
3303
+ else None,
3304
+ settlements=[
3305
+ decode_PredictionWebhookSettlement(item0)
3306
+ for item0 in read_list(data["settlements"])
3307
+ ],
3308
+ shape=read_str(data["shape"]),
3309
+ status=read_str(data["status"]),
3310
+ topic_id=read_str(data["topic_id"]),
3311
+ )
3312
+
3313
+
3314
+ def decode_PredictionWebhookSettlement(
3315
+ value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
3316
+ ) -> PredictionWebhookSettlement:
3317
+ data = read_object(value)
3318
+ return PredictionWebhookSettlement(
3319
+ status=read_str(data["status"]),
3320
+ venue=read_str(data["venue"]),
3321
+ )
3322
+
3323
+
3099
3324
  def decode_Problem(
3100
3325
  value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
3101
3326
  ) -> Problem:
@@ -3126,6 +3351,45 @@ def decode_Quote(
3126
3351
  )
3127
3352
 
3128
3353
 
3354
+ def decode_ResourceHistory(
3355
+ value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
3356
+ ) -> ResourceHistory:
3357
+ data = read_object(value)
3358
+ return ResourceHistory(
3359
+ country=read_str(data["country"]),
3360
+ currency=read_str(data["currency"])
3361
+ if data.get("currency") is not None
3362
+ else None,
3363
+ next_cursor=read_cursor(data["next_cursor"])
3364
+ if data.get("next_cursor") is not None
3365
+ else None,
3366
+ observations=[
3367
+ decode_ResourceObservation(item0)
3368
+ for item0 in read_list(data["observations"])
3369
+ ],
3370
+ series_id=read_str(data["series_id"]),
3371
+ source=decode_SeriesSource(data["source"])
3372
+ if data.get("source") is not None
3373
+ else None,
3374
+ unit=read_str(data["unit"]),
3375
+ meta=meta if meta is not None else ResponseMeta(),
3376
+ )
3377
+
3378
+
3379
+ def decode_ResourceObservation(
3380
+ value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
3381
+ ) -> ResourceObservation:
3382
+ data = read_object(value)
3383
+ return ResourceObservation(
3384
+ period=read_str(data["period"]),
3385
+ released_on=read_str(data["released_on"])
3386
+ if data.get("released_on") is not None
3387
+ else None,
3388
+ status=read_str(data["status"]) if data.get("status") is not None else None,
3389
+ value=read_decimal(data["value"]),
3390
+ )
3391
+
3392
+
3129
3393
  def decode_ScalarBody(
3130
3394
  value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
3131
3395
  ) -> ScalarBody:
@@ -3480,6 +3744,9 @@ def decode_WebhookDestinationCreated(
3480
3744
  countries=[read_str(item0) for item0 in read_list(data["countries"])],
3481
3745
  created_at=read_str(data["created_at"]),
3482
3746
  destination_id=read_str(data["destination_id"]),
3747
+ disabled_reason=read_str(data["disabled_reason"])
3748
+ if data.get("disabled_reason") is not None
3749
+ else None,
3483
3750
  enabled=read_bool(data["enabled"]),
3484
3751
  families=[read_str(item0) for item0 in read_list(data["families"])],
3485
3752
  secret=read_str(data["secret"]),
@@ -3525,6 +3792,9 @@ def decode_WebhookDestinationResponse(
3525
3792
  countries=[read_str(item0) for item0 in read_list(data["countries"])],
3526
3793
  created_at=read_str(data["created_at"]),
3527
3794
  destination_id=read_str(data["destination_id"]),
3795
+ disabled_reason=read_str(data["disabled_reason"])
3796
+ if data.get("disabled_reason") is not None
3797
+ else None,
3528
3798
  enabled=read_bool(data["enabled"]),
3529
3799
  families=[read_str(item0) for item0 in read_list(data["families"])],
3530
3800
  secret_version=read_int(data["secret_version"]),
@@ -3534,6 +3804,46 @@ def decode_WebhookDestinationResponse(
3534
3804
  )
3535
3805
 
3536
3806
 
3807
+ def decode_WebhookEvent(
3808
+ value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
3809
+ ) -> WebhookEvent:
3810
+ data = read_object(value)
3811
+ return WebhookEvent(
3812
+ country=read_str(data["country"]) if data.get("country") is not None else None,
3813
+ cursor=read_str(data["cursor"]) if data.get("cursor") is not None else None,
3814
+ event_id=read_str(data["event_id"]),
3815
+ family=read_str(data["family"]) if data.get("family") is not None else None,
3816
+ holiday_country=read_str(data["holiday_country"])
3817
+ if data.get("holiday_country") is not None
3818
+ else None,
3819
+ holiday_generation=read_int(data["holiday_generation"])
3820
+ if data.get("holiday_generation") is not None
3821
+ else None,
3822
+ holiday_year=read_int(data["holiday_year"])
3823
+ if data.get("holiday_year") is not None
3824
+ else None,
3825
+ is_test=read_bool(data["is_test"]) if data.get("is_test") is not None else None,
3826
+ prediction=decode_PredictionWebhookEvent(data["prediction"])
3827
+ if data.get("prediction") is not None
3828
+ else None,
3829
+ publication_id=read_str(data["publication_id"])
3830
+ if data.get("publication_id") is not None
3831
+ else None,
3832
+ recorded_at=read_str(data["recorded_at"]),
3833
+ release_id=read_str(data["release_id"])
3834
+ if data.get("release_id") is not None
3835
+ else None,
3836
+ resource_id=read_str(data["resource_id"])
3837
+ if data.get("resource_id") is not None
3838
+ else None,
3839
+ resource_version=read_str(data["resource_version"])
3840
+ if data.get("resource_version") is not None
3841
+ else None,
3842
+ schema_version=read_str(data["schema_version"]),
3843
+ type=read_str(data["type"]),
3844
+ )
3845
+
3846
+
3537
3847
  def decode_WebhookHistoryResponse(
3538
3848
  value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
3539
3849
  ) -> WebhookHistoryResponse: