exchangerate-dev 0.1.0__py3-none-any.whl
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.
- exchangerate_dev/__init__.py +16 -0
- exchangerate_dev/_client.py +122 -0
- exchangerate_dev/_deadline.py +180 -0
- exchangerate_dev/_decode.py +67 -0
- exchangerate_dev/_generated/__init__.py +2 -0
- exchangerate_dev/_generated/models.py +617 -0
- exchangerate_dev/_generated/operations.py +986 -0
- exchangerate_dev/_meta.py +40 -0
- exchangerate_dev/_pagination.py +47 -0
- exchangerate_dev/_transport.py +346 -0
- exchangerate_dev/_version.py +1 -0
- exchangerate_dev/errors.py +84 -0
- exchangerate_dev/models.py +48 -0
- exchangerate_dev/py.typed +0 -0
- exchangerate_dev-0.1.0.dist-info/METADATA +90 -0
- exchangerate_dev-0.1.0.dist-info/RECORD +18 -0
- exchangerate_dev-0.1.0.dist-info/WHEEL +4 -0
- exchangerate_dev-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
# Generated from spec/exchangerate/live/openapi.json sha256 6062a9cab89641865dd0d1ce764c5f89e54b11901602b41231f8dae9987ba773. Do not edit.
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from decimal import Decimal
|
|
6
|
+
from typing import Literal
|
|
7
|
+
|
|
8
|
+
from .._decode import (
|
|
9
|
+
read_bool,
|
|
10
|
+
read_cursor,
|
|
11
|
+
read_decimal_number,
|
|
12
|
+
read_int,
|
|
13
|
+
read_list,
|
|
14
|
+
read_object,
|
|
15
|
+
read_str,
|
|
16
|
+
)
|
|
17
|
+
from .._meta import ResponseMeta
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class BarInterval:
|
|
21
|
+
"""Known values; response fields also accept future strings."""
|
|
22
|
+
|
|
23
|
+
V15M: Literal["15m"] = "15m"
|
|
24
|
+
V1D: Literal["1d"] = "1d"
|
|
25
|
+
V1H: Literal["1h"] = "1h"
|
|
26
|
+
V1M: Literal["1m"] = "1m"
|
|
27
|
+
V4H: Literal["4h"] = "4h"
|
|
28
|
+
V5M: Literal["5m"] = "5m"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class IndexSourceType:
|
|
32
|
+
"""Known values; response fields also accept future strings."""
|
|
33
|
+
|
|
34
|
+
MARKET: Literal["market"] = "market"
|
|
35
|
+
REFERENCE: Literal["reference"] = "reference"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class MarketSession:
|
|
39
|
+
"""Known values; response fields also accept future strings."""
|
|
40
|
+
|
|
41
|
+
INTERBANK_CLOSED: Literal["interbank_closed"] = "interbank_closed"
|
|
42
|
+
OPEN: Literal["open"] = "open"
|
|
43
|
+
WEEKEND: Literal["weekend"] = "weekend"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class RateSource:
|
|
47
|
+
"""Known values; response fields also accept future strings."""
|
|
48
|
+
|
|
49
|
+
ECB_DAILY: Literal["ecb_daily"] = "ecb_daily"
|
|
50
|
+
LIVE: Literal["live"] = "live"
|
|
51
|
+
MARKET_DAILY: Literal["market_daily"] = "market_daily"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
55
|
+
class ConvertResponse:
|
|
56
|
+
amount: Decimal
|
|
57
|
+
converted: Decimal
|
|
58
|
+
data_updated_at: str
|
|
59
|
+
derivation_bps_max: Decimal | None = None
|
|
60
|
+
derived: bool
|
|
61
|
+
from_: str
|
|
62
|
+
market_session: str
|
|
63
|
+
notice: str
|
|
64
|
+
rate: Decimal
|
|
65
|
+
result: str | None = None
|
|
66
|
+
source: str
|
|
67
|
+
sources: dict[str, str]
|
|
68
|
+
stale: bool
|
|
69
|
+
timestamp: str
|
|
70
|
+
to: str
|
|
71
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
75
|
+
class CurrenciesResponse:
|
|
76
|
+
currencies: list[CurrencyInfo]
|
|
77
|
+
result: str | None = None
|
|
78
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
82
|
+
class CurrencyInfo:
|
|
83
|
+
code: str
|
|
84
|
+
decimals: int
|
|
85
|
+
is_derived: bool
|
|
86
|
+
minor_units: int
|
|
87
|
+
name: str
|
|
88
|
+
type: str | None = None
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
92
|
+
class DailyUsageEntry:
|
|
93
|
+
count: int
|
|
94
|
+
date: str
|
|
95
|
+
rate_limited: int
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
99
|
+
class DailyUsageResponse:
|
|
100
|
+
active_streams: int | None = None
|
|
101
|
+
days: list[DailyUsageEntry]
|
|
102
|
+
limit: int
|
|
103
|
+
max_streams: int
|
|
104
|
+
month_to_date: int
|
|
105
|
+
rate_limited_total: int
|
|
106
|
+
result: str | None = None
|
|
107
|
+
tier: str
|
|
108
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
112
|
+
class HistoricalResponse:
|
|
113
|
+
base: str
|
|
114
|
+
data_updated_at: str
|
|
115
|
+
date: str
|
|
116
|
+
derived_symbols: list[str]
|
|
117
|
+
is_forward_filled: bool
|
|
118
|
+
market_session: str
|
|
119
|
+
notice: str
|
|
120
|
+
rates: dict[str, Decimal]
|
|
121
|
+
result: str | None = None
|
|
122
|
+
source: str
|
|
123
|
+
sources: dict[str, str]
|
|
124
|
+
timestamp: str
|
|
125
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
129
|
+
class IndexConstituent:
|
|
130
|
+
contribution: Decimal
|
|
131
|
+
currency: str
|
|
132
|
+
effective_at: str
|
|
133
|
+
rate: Decimal
|
|
134
|
+
weight: Decimal
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
138
|
+
class IndexSnapshotResponse:
|
|
139
|
+
base_date: str | None = None
|
|
140
|
+
constituents: list[IndexConstituent]
|
|
141
|
+
data_updated_at: str
|
|
142
|
+
index: str
|
|
143
|
+
market_session: str
|
|
144
|
+
methodology_version: str
|
|
145
|
+
name: str
|
|
146
|
+
notice: str
|
|
147
|
+
result: str | None = None
|
|
148
|
+
source: str
|
|
149
|
+
source_type: str
|
|
150
|
+
stale: bool
|
|
151
|
+
timestamp: str
|
|
152
|
+
value: Decimal
|
|
153
|
+
weights: dict[str, Decimal]
|
|
154
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
158
|
+
class IndexTimeseriesResponse:
|
|
159
|
+
base_date: str | None = None
|
|
160
|
+
data: list[IndexTimeseriesRow]
|
|
161
|
+
from_: str
|
|
162
|
+
has_more: bool | None = None
|
|
163
|
+
index: str
|
|
164
|
+
interval: str
|
|
165
|
+
methodology_version: str
|
|
166
|
+
name: str
|
|
167
|
+
next_cursor: str | None = None
|
|
168
|
+
notice: str
|
|
169
|
+
result: str | None = None
|
|
170
|
+
to: str
|
|
171
|
+
weights: dict[str, Decimal]
|
|
172
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
176
|
+
class IndexTimeseriesRow:
|
|
177
|
+
data_updated_at: str
|
|
178
|
+
market_session: str
|
|
179
|
+
source: str
|
|
180
|
+
source_type: str
|
|
181
|
+
timestamp: str
|
|
182
|
+
value: Decimal
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
186
|
+
class LatestResponse:
|
|
187
|
+
base: str
|
|
188
|
+
data_updated_at: str
|
|
189
|
+
derived_symbols: list[str]
|
|
190
|
+
effective_at: dict[str, str]
|
|
191
|
+
market_session: str
|
|
192
|
+
notice: str
|
|
193
|
+
rates: dict[str, Decimal]
|
|
194
|
+
result: str | None = None
|
|
195
|
+
source: str
|
|
196
|
+
sources: dict[str, str]
|
|
197
|
+
stale: dict[str, bool]
|
|
198
|
+
timestamp: str
|
|
199
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
203
|
+
class RangeResponse:
|
|
204
|
+
base: str
|
|
205
|
+
data: list[RangeRow]
|
|
206
|
+
end_date: str
|
|
207
|
+
has_more: bool | None = None
|
|
208
|
+
next_cursor: str | None = None
|
|
209
|
+
notice: str
|
|
210
|
+
result: str | None = None
|
|
211
|
+
start_date: str
|
|
212
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
216
|
+
class RangeRow:
|
|
217
|
+
date: str
|
|
218
|
+
derived_symbols: list[str]
|
|
219
|
+
is_forward_filled: bool
|
|
220
|
+
rates: dict[str, Decimal]
|
|
221
|
+
source: str
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
225
|
+
class RateResponse:
|
|
226
|
+
base: str
|
|
227
|
+
data_updated_at: str
|
|
228
|
+
derivation_bps_max: Decimal | None = None
|
|
229
|
+
derived: bool
|
|
230
|
+
market_session: str
|
|
231
|
+
notice: str
|
|
232
|
+
pair: str
|
|
233
|
+
quote: str
|
|
234
|
+
rate: Decimal
|
|
235
|
+
result: str | None = None
|
|
236
|
+
source: str
|
|
237
|
+
sources: dict[str, str]
|
|
238
|
+
stale: bool
|
|
239
|
+
timestamp: str
|
|
240
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
244
|
+
class TimeseriesResponse:
|
|
245
|
+
base: str
|
|
246
|
+
data: list[TimeseriesRow]
|
|
247
|
+
from_: str
|
|
248
|
+
has_more: bool | None = None
|
|
249
|
+
interval: str
|
|
250
|
+
next_cursor: str | None = None
|
|
251
|
+
notice: str
|
|
252
|
+
result: str | None = None
|
|
253
|
+
symbols: list[str]
|
|
254
|
+
to: str
|
|
255
|
+
meta: ResponseMeta = field(default_factory=ResponseMeta, compare=False)
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
259
|
+
class TimeseriesRow:
|
|
260
|
+
derived_symbols: list[str]
|
|
261
|
+
effective_at: dict[str, str]
|
|
262
|
+
market_session: str
|
|
263
|
+
rates: dict[str, Decimal]
|
|
264
|
+
source: str
|
|
265
|
+
source_type: str
|
|
266
|
+
timestamp: str
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def decode_ConvertResponse(
|
|
270
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
271
|
+
) -> ConvertResponse:
|
|
272
|
+
data = read_object(value)
|
|
273
|
+
return ConvertResponse(
|
|
274
|
+
amount=read_decimal_number(data["amount"]),
|
|
275
|
+
converted=read_decimal_number(data["converted"]),
|
|
276
|
+
data_updated_at=read_str(data["data_updated_at"]),
|
|
277
|
+
derivation_bps_max=read_decimal_number(data["derivation_bps_max"])
|
|
278
|
+
if data.get("derivation_bps_max") is not None
|
|
279
|
+
else None,
|
|
280
|
+
derived=read_bool(data["derived"]),
|
|
281
|
+
from_=read_str(data["from"]),
|
|
282
|
+
market_session=read_str(data["market_session"]),
|
|
283
|
+
notice=read_str(data["notice"]),
|
|
284
|
+
rate=read_decimal_number(data["rate"]),
|
|
285
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
286
|
+
source=read_str(data["source"]),
|
|
287
|
+
sources={
|
|
288
|
+
key0: read_str(item0)
|
|
289
|
+
for key0, item0 in read_object(data["sources"]).items()
|
|
290
|
+
},
|
|
291
|
+
stale=read_bool(data["stale"]),
|
|
292
|
+
timestamp=read_str(data["timestamp"]),
|
|
293
|
+
to=read_str(data["to"]),
|
|
294
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def decode_CurrenciesResponse(
|
|
299
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
300
|
+
) -> CurrenciesResponse:
|
|
301
|
+
data = read_object(value)
|
|
302
|
+
return CurrenciesResponse(
|
|
303
|
+
currencies=[
|
|
304
|
+
decode_CurrencyInfo(item0) for item0 in read_list(data["currencies"])
|
|
305
|
+
],
|
|
306
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
307
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
def decode_CurrencyInfo(
|
|
312
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
313
|
+
) -> CurrencyInfo:
|
|
314
|
+
data = read_object(value)
|
|
315
|
+
return CurrencyInfo(
|
|
316
|
+
code=read_str(data["code"]),
|
|
317
|
+
decimals=read_int(data["decimals"]),
|
|
318
|
+
is_derived=read_bool(data["is_derived"]),
|
|
319
|
+
minor_units=read_int(data["minor_units"]),
|
|
320
|
+
name=read_str(data["name"]),
|
|
321
|
+
type=read_str(data["type"]) if data.get("type") is not None else None,
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
def decode_DailyUsageEntry(
|
|
326
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
327
|
+
) -> DailyUsageEntry:
|
|
328
|
+
data = read_object(value)
|
|
329
|
+
return DailyUsageEntry(
|
|
330
|
+
count=read_int(data["count"]),
|
|
331
|
+
date=read_str(data["date"]),
|
|
332
|
+
rate_limited=read_int(data["rate_limited"]),
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
def decode_DailyUsageResponse(
|
|
337
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
338
|
+
) -> DailyUsageResponse:
|
|
339
|
+
data = read_object(value)
|
|
340
|
+
return DailyUsageResponse(
|
|
341
|
+
active_streams=read_int(data["active_streams"])
|
|
342
|
+
if data.get("active_streams") is not None
|
|
343
|
+
else None,
|
|
344
|
+
days=[decode_DailyUsageEntry(item0) for item0 in read_list(data["days"])],
|
|
345
|
+
limit=read_int(data["limit"]),
|
|
346
|
+
max_streams=read_int(data["max_streams"]),
|
|
347
|
+
month_to_date=read_int(data["month_to_date"]),
|
|
348
|
+
rate_limited_total=read_int(data["rate_limited_total"]),
|
|
349
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
350
|
+
tier=read_str(data["tier"]),
|
|
351
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
def decode_HistoricalResponse(
|
|
356
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
357
|
+
) -> HistoricalResponse:
|
|
358
|
+
data = read_object(value)
|
|
359
|
+
return HistoricalResponse(
|
|
360
|
+
base=read_str(data["base"]),
|
|
361
|
+
data_updated_at=read_str(data["data_updated_at"]),
|
|
362
|
+
date=read_str(data["date"]),
|
|
363
|
+
derived_symbols=[
|
|
364
|
+
read_str(item0) for item0 in read_list(data["derived_symbols"])
|
|
365
|
+
],
|
|
366
|
+
is_forward_filled=read_bool(data["is_forward_filled"]),
|
|
367
|
+
market_session=read_str(data["market_session"]),
|
|
368
|
+
notice=read_str(data["notice"]),
|
|
369
|
+
rates={
|
|
370
|
+
key0: read_decimal_number(item0)
|
|
371
|
+
for key0, item0 in read_object(data["rates"]).items()
|
|
372
|
+
},
|
|
373
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
374
|
+
source=read_str(data["source"]),
|
|
375
|
+
sources={
|
|
376
|
+
key0: read_str(item0)
|
|
377
|
+
for key0, item0 in read_object(data["sources"]).items()
|
|
378
|
+
},
|
|
379
|
+
timestamp=read_str(data["timestamp"]),
|
|
380
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
def decode_IndexConstituent(
|
|
385
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
386
|
+
) -> IndexConstituent:
|
|
387
|
+
data = read_object(value)
|
|
388
|
+
return IndexConstituent(
|
|
389
|
+
contribution=read_decimal_number(data["contribution"]),
|
|
390
|
+
currency=read_str(data["currency"]),
|
|
391
|
+
effective_at=read_str(data["effective_at"]),
|
|
392
|
+
rate=read_decimal_number(data["rate"]),
|
|
393
|
+
weight=read_decimal_number(data["weight"]),
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
def decode_IndexSnapshotResponse(
|
|
398
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
399
|
+
) -> IndexSnapshotResponse:
|
|
400
|
+
data = read_object(value)
|
|
401
|
+
return IndexSnapshotResponse(
|
|
402
|
+
base_date=read_str(data["base_date"])
|
|
403
|
+
if data.get("base_date") is not None
|
|
404
|
+
else None,
|
|
405
|
+
constituents=[
|
|
406
|
+
decode_IndexConstituent(item0) for item0 in read_list(data["constituents"])
|
|
407
|
+
],
|
|
408
|
+
data_updated_at=read_str(data["data_updated_at"]),
|
|
409
|
+
index=read_str(data["index"]),
|
|
410
|
+
market_session=read_str(data["market_session"]),
|
|
411
|
+
methodology_version=read_str(data["methodology_version"]),
|
|
412
|
+
name=read_str(data["name"]),
|
|
413
|
+
notice=read_str(data["notice"]),
|
|
414
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
415
|
+
source=read_str(data["source"]),
|
|
416
|
+
source_type=read_str(data["source_type"]),
|
|
417
|
+
stale=read_bool(data["stale"]),
|
|
418
|
+
timestamp=read_str(data["timestamp"]),
|
|
419
|
+
value=read_decimal_number(data["value"]),
|
|
420
|
+
weights={
|
|
421
|
+
key0: read_decimal_number(item0)
|
|
422
|
+
for key0, item0 in read_object(data["weights"]).items()
|
|
423
|
+
},
|
|
424
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
def decode_IndexTimeseriesResponse(
|
|
429
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
430
|
+
) -> IndexTimeseriesResponse:
|
|
431
|
+
data = read_object(value)
|
|
432
|
+
return IndexTimeseriesResponse(
|
|
433
|
+
base_date=read_str(data["base_date"])
|
|
434
|
+
if data.get("base_date") is not None
|
|
435
|
+
else None,
|
|
436
|
+
data=[decode_IndexTimeseriesRow(item0) for item0 in read_list(data["data"])],
|
|
437
|
+
from_=read_str(data["from"]),
|
|
438
|
+
has_more=read_bool(data["has_more"])
|
|
439
|
+
if data.get("has_more") is not None
|
|
440
|
+
else None,
|
|
441
|
+
index=read_str(data["index"]),
|
|
442
|
+
interval=read_str(data["interval"]),
|
|
443
|
+
methodology_version=read_str(data["methodology_version"]),
|
|
444
|
+
name=read_str(data["name"]),
|
|
445
|
+
next_cursor=read_cursor(data["next_cursor"])
|
|
446
|
+
if data.get("next_cursor") is not None
|
|
447
|
+
else None,
|
|
448
|
+
notice=read_str(data["notice"]),
|
|
449
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
450
|
+
to=read_str(data["to"]),
|
|
451
|
+
weights={
|
|
452
|
+
key0: read_decimal_number(item0)
|
|
453
|
+
for key0, item0 in read_object(data["weights"]).items()
|
|
454
|
+
},
|
|
455
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
456
|
+
)
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
def decode_IndexTimeseriesRow(
|
|
460
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
461
|
+
) -> IndexTimeseriesRow:
|
|
462
|
+
data = read_object(value)
|
|
463
|
+
return IndexTimeseriesRow(
|
|
464
|
+
data_updated_at=read_str(data["data_updated_at"]),
|
|
465
|
+
market_session=read_str(data["market_session"]),
|
|
466
|
+
source=read_str(data["source"]),
|
|
467
|
+
source_type=read_str(data["source_type"]),
|
|
468
|
+
timestamp=read_str(data["timestamp"]),
|
|
469
|
+
value=read_decimal_number(data["value"]),
|
|
470
|
+
)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
def decode_LatestResponse(
|
|
474
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
475
|
+
) -> LatestResponse:
|
|
476
|
+
data = read_object(value)
|
|
477
|
+
return LatestResponse(
|
|
478
|
+
base=read_str(data["base"]),
|
|
479
|
+
data_updated_at=read_str(data["data_updated_at"]),
|
|
480
|
+
derived_symbols=[
|
|
481
|
+
read_str(item0) for item0 in read_list(data["derived_symbols"])
|
|
482
|
+
],
|
|
483
|
+
effective_at={
|
|
484
|
+
key0: read_str(item0)
|
|
485
|
+
for key0, item0 in read_object(data["effective_at"]).items()
|
|
486
|
+
},
|
|
487
|
+
market_session=read_str(data["market_session"]),
|
|
488
|
+
notice=read_str(data["notice"]),
|
|
489
|
+
rates={
|
|
490
|
+
key0: read_decimal_number(item0)
|
|
491
|
+
for key0, item0 in read_object(data["rates"]).items()
|
|
492
|
+
},
|
|
493
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
494
|
+
source=read_str(data["source"]),
|
|
495
|
+
sources={
|
|
496
|
+
key0: read_str(item0)
|
|
497
|
+
for key0, item0 in read_object(data["sources"]).items()
|
|
498
|
+
},
|
|
499
|
+
stale={
|
|
500
|
+
key0: read_bool(item0) for key0, item0 in read_object(data["stale"]).items()
|
|
501
|
+
},
|
|
502
|
+
timestamp=read_str(data["timestamp"]),
|
|
503
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
def decode_RangeResponse(
|
|
508
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
509
|
+
) -> RangeResponse:
|
|
510
|
+
data = read_object(value)
|
|
511
|
+
return RangeResponse(
|
|
512
|
+
base=read_str(data["base"]),
|
|
513
|
+
data=[decode_RangeRow(item0) for item0 in read_list(data["data"])],
|
|
514
|
+
end_date=read_str(data["end_date"]),
|
|
515
|
+
has_more=read_bool(data["has_more"])
|
|
516
|
+
if data.get("has_more") is not None
|
|
517
|
+
else None,
|
|
518
|
+
next_cursor=read_cursor(data["next_cursor"])
|
|
519
|
+
if data.get("next_cursor") is not None
|
|
520
|
+
else None,
|
|
521
|
+
notice=read_str(data["notice"]),
|
|
522
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
523
|
+
start_date=read_str(data["start_date"]),
|
|
524
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
525
|
+
)
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
def decode_RangeRow(
|
|
529
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
530
|
+
) -> RangeRow:
|
|
531
|
+
data = read_object(value)
|
|
532
|
+
return RangeRow(
|
|
533
|
+
date=read_str(data["date"]),
|
|
534
|
+
derived_symbols=[
|
|
535
|
+
read_str(item0) for item0 in read_list(data["derived_symbols"])
|
|
536
|
+
],
|
|
537
|
+
is_forward_filled=read_bool(data["is_forward_filled"]),
|
|
538
|
+
rates={
|
|
539
|
+
key0: read_decimal_number(item0)
|
|
540
|
+
for key0, item0 in read_object(data["rates"]).items()
|
|
541
|
+
},
|
|
542
|
+
source=read_str(data["source"]),
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
def decode_RateResponse(
|
|
547
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
548
|
+
) -> RateResponse:
|
|
549
|
+
data = read_object(value)
|
|
550
|
+
return RateResponse(
|
|
551
|
+
base=read_str(data["base"]),
|
|
552
|
+
data_updated_at=read_str(data["data_updated_at"]),
|
|
553
|
+
derivation_bps_max=read_decimal_number(data["derivation_bps_max"])
|
|
554
|
+
if data.get("derivation_bps_max") is not None
|
|
555
|
+
else None,
|
|
556
|
+
derived=read_bool(data["derived"]),
|
|
557
|
+
market_session=read_str(data["market_session"]),
|
|
558
|
+
notice=read_str(data["notice"]),
|
|
559
|
+
pair=read_str(data["pair"]),
|
|
560
|
+
quote=read_str(data["quote"]),
|
|
561
|
+
rate=read_decimal_number(data["rate"]),
|
|
562
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
563
|
+
source=read_str(data["source"]),
|
|
564
|
+
sources={
|
|
565
|
+
key0: read_str(item0)
|
|
566
|
+
for key0, item0 in read_object(data["sources"]).items()
|
|
567
|
+
},
|
|
568
|
+
stale=read_bool(data["stale"]),
|
|
569
|
+
timestamp=read_str(data["timestamp"]),
|
|
570
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
571
|
+
)
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
def decode_TimeseriesResponse(
|
|
575
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
576
|
+
) -> TimeseriesResponse:
|
|
577
|
+
data = read_object(value)
|
|
578
|
+
return TimeseriesResponse(
|
|
579
|
+
base=read_str(data["base"]),
|
|
580
|
+
data=[decode_TimeseriesRow(item0) for item0 in read_list(data["data"])],
|
|
581
|
+
from_=read_str(data["from"]),
|
|
582
|
+
has_more=read_bool(data["has_more"])
|
|
583
|
+
if data.get("has_more") is not None
|
|
584
|
+
else None,
|
|
585
|
+
interval=read_str(data["interval"]),
|
|
586
|
+
next_cursor=read_cursor(data["next_cursor"])
|
|
587
|
+
if data.get("next_cursor") is not None
|
|
588
|
+
else None,
|
|
589
|
+
notice=read_str(data["notice"]),
|
|
590
|
+
result=read_str(data["result"]) if data.get("result") is not None else None,
|
|
591
|
+
symbols=[read_str(item0) for item0 in read_list(data["symbols"])],
|
|
592
|
+
to=read_str(data["to"]),
|
|
593
|
+
meta=meta if meta is not None else ResponseMeta(),
|
|
594
|
+
)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
def decode_TimeseriesRow(
|
|
598
|
+
value: object, meta: ResponseMeta | None = None, raw_body: bytes = b""
|
|
599
|
+
) -> TimeseriesRow:
|
|
600
|
+
data = read_object(value)
|
|
601
|
+
return TimeseriesRow(
|
|
602
|
+
derived_symbols=[
|
|
603
|
+
read_str(item0) for item0 in read_list(data["derived_symbols"])
|
|
604
|
+
],
|
|
605
|
+
effective_at={
|
|
606
|
+
key0: read_str(item0)
|
|
607
|
+
for key0, item0 in read_object(data["effective_at"]).items()
|
|
608
|
+
},
|
|
609
|
+
market_session=read_str(data["market_session"]),
|
|
610
|
+
rates={
|
|
611
|
+
key0: read_decimal_number(item0)
|
|
612
|
+
for key0, item0 in read_object(data["rates"]).items()
|
|
613
|
+
},
|
|
614
|
+
source=read_str(data["source"]),
|
|
615
|
+
source_type=read_str(data["source_type"]),
|
|
616
|
+
timestamp=read_str(data["timestamp"]),
|
|
617
|
+
)
|