UncountablePythonSDK 0.0.116__py3-none-any.whl → 0.0.117__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.

Potentially problematic release.


This version of UncountablePythonSDK might be problematic. Click here for more details.

@@ -479,9 +479,18 @@ def _emit_type(
479
479
  return
480
480
 
481
481
  if isinstance(stype, builder.SpecTypeDefnUnion):
482
+ converted_discriminator_map: dict[str, OpenAPIRefType] = dict()
483
+ if stype.discriminator_map is not None:
484
+ for discriminator_value, base_type in stype.discriminator_map.items():
485
+ converted_base_type = open_api_type(ctx, base_type, config=config)
486
+ assert isinstance(converted_base_type, OpenAPIRefType)
487
+ converted_discriminator_map[discriminator_value] = converted_base_type
482
488
  ctx.types[stype.name] = OpenAPIUnionType(
483
489
  [open_api_type(ctx, p, config=config) for p in stype.types],
484
- discrimnator=stype.discriminator,
490
+ discriminator=stype.discriminator,
491
+ discriminator_map=converted_discriminator_map
492
+ if stype.discriminator_map is not None
493
+ else None,
485
494
  )
486
495
  return
487
496
 
@@ -223,19 +223,26 @@ class OpenAPIUnionType(OpenAPIType):
223
223
  base_types: list[OpenAPIType],
224
224
  description: str | None = None,
225
225
  nullable: bool = False,
226
- discrimnator: str | None = None,
227
- discriminator_map: dict[str, OpenAPIType] | None = None,
226
+ discriminator: str | None = None,
227
+ discriminator_map: dict[str, OpenAPIRefType] | None = None,
228
228
  ) -> None:
229
229
  self.base_types = base_types
230
- self._discriminator = discrimnator
230
+ self._discriminator = discriminator
231
+ self._discriminator_map = discriminator_map
231
232
  super().__init__(description=description, nullable=nullable)
232
233
 
233
234
  def asdict(self) -> dict[str, object]:
234
235
  # TODO: use parents description and nullable
235
236
  return {
236
237
  "oneOf": [base_type.asdict() for base_type in self.base_types],
237
- "discriminator": {"propertyName": self._discriminator}
238
- if self._discriminator is not None
238
+ "discriminator": {
239
+ "propertyName": self._discriminator,
240
+ "mapping": {
241
+ discriminator_value: base_type.source
242
+ for discriminator_value, base_type in self._discriminator_map.items()
243
+ },
244
+ }
245
+ if self._discriminator is not None and self._discriminator_map is not None
239
246
  else None,
240
247
  }
241
248
 
@@ -63,6 +63,7 @@ from . import identifier_t as identifier_t
63
63
  from . import input_attributes_t as input_attributes_t
64
64
  from . import inputs_t as inputs_t
65
65
  from . import integration_server_t as integration_server_t
66
+ from . import integrations_t as integrations_t
66
67
  from .api.uploader import invoke_uploader as invoke_uploader_t
67
68
  from . import job_definition_t as job_definition_t
68
69
  from .api.entity import list_entities as list_entities_t
@@ -76,6 +77,7 @@ from . import overrides_t as overrides_t
76
77
  from . import permissions_t as permissions_t
77
78
  from . import phases_t as phases_t
78
79
  from . import post_base_t as post_base_t
80
+ from .api.integrations import publish_realtime_data as publish_realtime_data_t
79
81
  from . import queued_job_t as queued_job_t
80
82
  from . import recipe_identifiers_t as recipe_identifiers_t
81
83
  from . import recipe_inputs_t as recipe_inputs_t
@@ -180,6 +182,7 @@ __all__: list[str] = [
180
182
  "input_attributes_t",
181
183
  "inputs_t",
182
184
  "integration_server_t",
185
+ "integrations_t",
183
186
  "invoke_uploader_t",
184
187
  "job_definition_t",
185
188
  "list_entities_t",
@@ -193,6 +196,7 @@ __all__: list[str] = [
193
196
  "permissions_t",
194
197
  "phases_t",
195
198
  "post_base_t",
199
+ "publish_realtime_data_t",
196
200
  "queued_job_t",
197
201
  "recipe_identifiers_t",
198
202
  "recipe_inputs_t",
@@ -0,0 +1 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,41 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
2
+ # ruff: noqa: E402 Q003
3
+ # fmt: off
4
+ # isort: skip_file
5
+ from __future__ import annotations
6
+ import typing # noqa: F401
7
+ import datetime # noqa: F401
8
+ from decimal import Decimal # noqa: F401
9
+ import dataclasses
10
+ from pkgs.serialization import serial_class
11
+ from ... import base_t
12
+ from ... import integrations_t
13
+
14
+ __all__: list[str] = [
15
+ "Arguments",
16
+ "Data",
17
+ "ENDPOINT_METHOD",
18
+ "ENDPOINT_PATH",
19
+ ]
20
+
21
+ ENDPOINT_METHOD = "POST"
22
+ ENDPOINT_PATH = "api/external/integrations/publish_realtime_data"
23
+
24
+
25
+ # DO NOT MODIFY -- This file is generated by type_spec
26
+ @serial_class(
27
+ named_type_path="sdk.api.integrations.publish_realtime_data.Arguments",
28
+ )
29
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
30
+ class Arguments:
31
+ data_package: integrations_t.DataPackage
32
+
33
+
34
+ # DO NOT MODIFY -- This file is generated by type_spec
35
+ @serial_class(
36
+ named_type_path="sdk.api.integrations.publish_realtime_data.Data",
37
+ )
38
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
39
+ class Data:
40
+ pass
41
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,10 @@
1
+ # ruff: noqa: E402 Q003
2
+ # fmt: off
3
+ # isort: skip_file
4
+ # DO NOT MODIFY -- This file is generated by type_spec
5
+ # Kept only for SDK backwards compatibility
6
+ from .integrations_t import DataPackageType as DataPackageType
7
+ from .integrations_t import DataPackageBase as DataPackageBase
8
+ from .integrations_t import DataPackageNumericReading as DataPackageNumericReading
9
+ from .integrations_t import DataPackage as DataPackage
10
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,62 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
2
+ # ruff: noqa: E402 Q003
3
+ # fmt: off
4
+ # isort: skip_file
5
+ from __future__ import annotations
6
+ import typing # noqa: F401
7
+ import datetime # noqa: F401
8
+ from decimal import Decimal # noqa: F401
9
+ from enum import StrEnum
10
+ import dataclasses
11
+ from pkgs.serialization import serial_class
12
+ from pkgs.serialization import serial_union_annotation
13
+ from . import base_t
14
+ from . import entity_t
15
+
16
+ __all__: list[str] = [
17
+ "DataPackage",
18
+ "DataPackageBase",
19
+ "DataPackageNumericReading",
20
+ "DataPackageType",
21
+ ]
22
+
23
+
24
+ # DO NOT MODIFY -- This file is generated by type_spec
25
+ class DataPackageType(StrEnum):
26
+ NUMERIC_READING = "numeric_reading"
27
+
28
+
29
+ # DO NOT MODIFY -- This file is generated by type_spec
30
+ @serial_class(
31
+ named_type_path="sdk.integrations.DataPackageBase",
32
+ )
33
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
34
+ class DataPackageBase:
35
+ type: DataPackageType
36
+
37
+
38
+ # DO NOT MODIFY -- This file is generated by type_spec
39
+ @serial_class(
40
+ named_type_path="sdk.integrations.DataPackageNumericReading",
41
+ to_string_values={"value"},
42
+ parse_require={"type"},
43
+ )
44
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
45
+ class DataPackageNumericReading(DataPackageBase):
46
+ type: typing.Literal[DataPackageType.NUMERIC_READING] = DataPackageType.NUMERIC_READING
47
+ value: Decimal
48
+ target_entity: entity_t.EntityIdentifier
49
+
50
+
51
+ # DO NOT MODIFY -- This file is generated by type_spec
52
+ DataPackage = typing.Annotated[
53
+ typing.Union[DataPackageNumericReading],
54
+ serial_union_annotation(
55
+ named_type_path="sdk.integrations.DataPackage",
56
+ discriminator="type",
57
+ discriminator_map={
58
+ "numeric_reading": DataPackageNumericReading,
59
+ },
60
+ ),
61
+ ]
62
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.116
3
+ Version: 0.0.117
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -68,14 +68,14 @@ pkgs/type_spec/builder.py,sha256=17_hkJI5jDb_IGOHZCiZDJ8_er-amVH0-WRpqJb7hEE,543
68
68
  pkgs/type_spec/config.py,sha256=m0Rky7Rg2jMglDPQChF30p5h5P86Ap1GObwzLzmypNE,5829
69
69
  pkgs/type_spec/cross_output_links.py,sha256=ttFNfuQmR3sNnPSeUER5IPgLiYc-FB5gjlf7RyFYMpc,3293
70
70
  pkgs/type_spec/emit_io_ts.py,sha256=CUvBs0boB_X-Kndh66yYcqFfq3oC_LGs8YffLkJ0ZXA,5707
71
- pkgs/type_spec/emit_open_api.py,sha256=5M0lAEbjm0bRPjuGpChMS1eB4oCkb2Hd3e7mr-rLv0Y,26345
71
+ pkgs/type_spec/emit_open_api.py,sha256=-2mNpucrEbWNXGZ2xAlqfouPPDP_yOkZVC_ycWpC8UE,26922
72
72
  pkgs/type_spec/emit_open_api_util.py,sha256=bTmRvrGP82-eB75hwf9ySI7pDEC87FNQTF18VKEWSXY,2367
73
73
  pkgs/type_spec/emit_python.py,sha256=aURsc-wWdamVDCrIWxA7s8_MLAMjLdXZor6ykkibzXY,52707
74
74
  pkgs/type_spec/emit_typescript.py,sha256=FINir79bz4tJYgJuUylNJFvqChzaFlHNCfZ5D7A6B1I,11447
75
75
  pkgs/type_spec/emit_typescript_util.py,sha256=ChP4oF2ZJoL0qErGCL0nscj0w_yH6TBgE92MtQS8nPI,11638
76
76
  pkgs/type_spec/load_types.py,sha256=JL7tX2H_cy3p5HjGuvNFJlY4pDSbDVnYFsh9mK16-ic,4302
77
77
  pkgs/type_spec/non_discriminated_union_exceptions.py,sha256=JB4WNDJWc3e9WMOabX4aTd0-6K7n1hctIW2lGf1bYts,612
78
- pkgs/type_spec/open_api_util.py,sha256=muEX3hYIhlLFA9XDfMruk2687w6bKrZnluIVVqEtDao,7642
78
+ pkgs/type_spec/open_api_util.py,sha256=r4rryE95valu4kmHaMAbXQ5PMwbUnnwYv4Gh6_CwiSU,7966
79
79
  pkgs/type_spec/test.py,sha256=4ueujBq-pEgnX3Z69HyPmD-bullFXmpixcpVzfOkhP4,489
80
80
  pkgs/type_spec/util.py,sha256=S_SGTJU192x-wIbngVUTvXhQENMbBfxluigLmnItGI8,4848
81
81
  pkgs/type_spec/actions_registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -140,7 +140,7 @@ uncountable/integration/queue_runner/datastore/model.py,sha256=8-RI5A2yPZVGBLWIN
140
140
  uncountable/integration/secret_retrieval/__init__.py,sha256=3QXVj35w8rRMxVvmmsViFYDi3lcb3g70incfalOEm6o,87
141
141
  uncountable/integration/secret_retrieval/retrieve_secret.py,sha256=LBEf18KHtXZxg-ZZ80stJ1vW39AWf0CQllP6pNu3Eq8,2994
142
142
  uncountable/integration/webhook_server/entrypoint.py,sha256=NQawXl_JCRojdVniS5RF7dobQQKW_Wy03bwy-uXknuA,3441
143
- uncountable/types/__init__.py,sha256=eqeDMCXTr9Mwo10RSGMa4znfu_7TVp_0gYJxPKmLCfQ,9990
143
+ uncountable/types/__init__.py,sha256=EZC_LgnO80PfE3SW4Sg95Ew3iUORmT_7oz-6u4zTulY,10169
144
144
  uncountable/types/async_batch.py,sha256=yCCWrrLQfxXVqZp-KskxLBNkNmuELdz4PJjx8ULppgs,662
145
145
  uncountable/types/async_batch_processor.py,sha256=h_8Snzt3lbEFlZAZFByt4Hg4dv2YlxMijHjTHjZ0aXY,22062
146
146
  uncountable/types/async_batch_t.py,sha256=JuswurXlYW38MfAXJ0UWb7hE2rmzFaHBAsNhRYAyMD4,3779
@@ -183,6 +183,8 @@ uncountable/types/inputs.py,sha256=3ghg39_oiLF5HqWF_wNwYv4HMR1lrKLfeRLn5ptIGw4,4
183
183
  uncountable/types/inputs_t.py,sha256=eSVA7LNgLI3ja83GJm4sA9KhPICVV4zj2Dd4OhbuY9g,2158
184
184
  uncountable/types/integration_server.py,sha256=VonA8h8TGnVBiss5W8-K82lA01JQa7TLk0ubFo8iiBQ,364
185
185
  uncountable/types/integration_server_t.py,sha256=pgtoyuW6QvGRawidJZFB-WnOdwCE4OIoJAvGfussZKU,1304
186
+ uncountable/types/integrations.py,sha256=0fOhtbLIOl9w1GP9J3PTagRU8mjOKV48JNLLH3SJQP0,472
187
+ uncountable/types/integrations_t.py,sha256=ihyhuMDKtJarQ19OppS0fYpJUYd8o5-w6YCDE440O-w,1871
186
188
  uncountable/types/job_definition.py,sha256=hYp5jPYLLYm3NKEqzQrQfXL0Ms5KgEQGTON13YWSPYk,1804
187
189
  uncountable/types/job_definition_t.py,sha256=E4IQvcYF3VDHbwRlvopy8y-HNAyEMZpwy7jkmp74fgQ,9563
188
190
  uncountable/types/outputs.py,sha256=I6zP2WHXg_jXgMqmuEJuJOlsjKjQGHjfs1JOwW9YxBM,260
@@ -268,6 +270,8 @@ uncountable/types/api/inputs/set_input_attribute_values.py,sha256=Tgd3KofNXYBj2u
268
270
  uncountable/types/api/inputs/set_input_category.py,sha256=6e1L0RQU6nt51PTZ99Ca4ZfIxIcpa0pXBDCwRFxTKPs,1283
269
271
  uncountable/types/api/inputs/set_input_subcategories.py,sha256=w5U6eXes5KquPW1UcYPRHimrfY_cN-K93IrpOw1Gl7s,1320
270
272
  uncountable/types/api/inputs/set_intermediate_type.py,sha256=S1RLI2RtrRze0NdMUfK2nwR4Twn_DnLnWNsg0-ivi_A,1431
273
+ uncountable/types/api/integrations/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
274
+ uncountable/types/api/integrations/publish_realtime_data.py,sha256=-5r2U78AwKUCpModcUIchVIZ9b7L-Ln6O6T-9d57M2A,1181
271
275
  uncountable/types/api/material_families/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
272
276
  uncountable/types/api/material_families/update_entity_material_families.py,sha256=qWJgAKH0MayadXvxckePCdo9yd34QXOmGZ7cKz5VLNo,1761
273
277
  uncountable/types/api/outputs/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
@@ -319,7 +323,7 @@ uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr
319
323
  uncountable/types/api/triggers/run_trigger.py,sha256=dgDX_sRWSJ36UuzMZhG25oHV1HIOUKYY2G3fjKugZrw,1204
320
324
  uncountable/types/api/uploader/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
321
325
  uncountable/types/api/uploader/invoke_uploader.py,sha256=Bj7Dq4A90k00suacwk3bLA_dCb2aovS1kAbVam2AQnM,1395
322
- uncountablepythonsdk-0.0.116.dist-info/METADATA,sha256=oPQJIEgmWPjJGw_pV9kIAdtXYNfSegMl15O4xPvJ080,2143
323
- uncountablepythonsdk-0.0.116.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
324
- uncountablepythonsdk-0.0.116.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
325
- uncountablepythonsdk-0.0.116.dist-info/RECORD,,
326
+ uncountablepythonsdk-0.0.117.dist-info/METADATA,sha256=tj3OqRKTNxJzMEkVnW6fwy_8S1OUT-00sE7vV4W9lag,2143
327
+ uncountablepythonsdk-0.0.117.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
328
+ uncountablepythonsdk-0.0.117.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
329
+ uncountablepythonsdk-0.0.117.dist-info/RECORD,,