UncountablePythonSDK 0.0.126__py3-none-any.whl → 0.0.142.dev0__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.

Files changed (84) hide show
  1. docs/requirements.txt +1 -1
  2. examples/integration-server/jobs/materials_auto/example_cron.py +1 -1
  3. examples/integration-server/jobs/materials_auto/example_instrument.py +68 -38
  4. examples/integration-server/jobs/materials_auto/example_parse.py +140 -0
  5. examples/integration-server/jobs/materials_auto/example_predictions.py +61 -0
  6. examples/integration-server/jobs/materials_auto/example_runsheet_wh.py +57 -16
  7. examples/integration-server/jobs/materials_auto/profile.yaml +18 -0
  8. examples/integration-server/pyproject.toml +4 -4
  9. pkgs/argument_parser/argument_parser.py +20 -1
  10. pkgs/serialization_util/serialization_helpers.py +3 -1
  11. pkgs/type_spec/builder.py +43 -13
  12. pkgs/type_spec/builder_types.py +9 -0
  13. pkgs/type_spec/cross_output_links.py +2 -10
  14. pkgs/type_spec/emit_open_api.py +0 -12
  15. pkgs/type_spec/emit_python.py +72 -11
  16. pkgs/type_spec/emit_typescript.py +2 -2
  17. pkgs/type_spec/emit_typescript_util.py +28 -6
  18. pkgs/type_spec/load_types.py +1 -1
  19. pkgs/type_spec/parts/base.ts.prepart +3 -0
  20. pkgs/type_spec/type_info/emit_type_info.py +27 -3
  21. pkgs/type_spec/value_spec/__main__.py +2 -2
  22. uncountable/core/client.py +10 -3
  23. uncountable/integration/cli.py +89 -2
  24. uncountable/integration/executors/executors.py +1 -2
  25. uncountable/integration/executors/generic_upload_executor.py +1 -1
  26. uncountable/integration/job.py +3 -3
  27. uncountable/integration/queue_runner/command_server/__init__.py +4 -0
  28. uncountable/integration/queue_runner/command_server/command_client.py +63 -0
  29. uncountable/integration/queue_runner/command_server/command_server.py +77 -5
  30. uncountable/integration/queue_runner/command_server/protocol/command_server.proto +33 -0
  31. uncountable/integration/queue_runner/command_server/protocol/command_server_pb2.py +27 -13
  32. uncountable/integration/queue_runner/command_server/protocol/command_server_pb2.pyi +53 -1
  33. uncountable/integration/queue_runner/command_server/protocol/command_server_pb2_grpc.py +135 -0
  34. uncountable/integration/queue_runner/command_server/types.py +44 -1
  35. uncountable/integration/queue_runner/datastore/datastore_sqlite.py +132 -8
  36. uncountable/integration/queue_runner/datastore/interface.py +3 -0
  37. uncountable/integration/queue_runner/datastore/model.py +8 -1
  38. uncountable/integration/queue_runner/job_scheduler.py +78 -3
  39. uncountable/integration/queue_runner/types.py +2 -0
  40. uncountable/integration/queue_runner/worker.py +28 -26
  41. uncountable/integration/scheduler.py +64 -13
  42. uncountable/integration/server.py +36 -6
  43. uncountable/integration/telemetry.py +120 -7
  44. uncountable/integration/webhook_server/entrypoint.py +2 -0
  45. uncountable/types/__init__.py +18 -0
  46. uncountable/types/api/entity/list_aggregate.py +79 -0
  47. uncountable/types/api/entity/list_entities.py +25 -0
  48. uncountable/types/api/entity/set_barcode.py +43 -0
  49. uncountable/types/api/entity/transition_entity_phase.py +2 -1
  50. uncountable/types/api/files/download_file.py +15 -1
  51. uncountable/types/api/integrations/push_notification.py +2 -0
  52. uncountable/types/api/integrations/register_sockets_token.py +41 -0
  53. uncountable/types/api/listing/__init__.py +1 -0
  54. uncountable/types/api/listing/fetch_listing.py +57 -0
  55. uncountable/types/api/notebooks/__init__.py +1 -0
  56. uncountable/types/api/notebooks/add_notebook_content.py +119 -0
  57. uncountable/types/api/outputs/get_output_organization.py +1 -1
  58. uncountable/types/api/recipes/edit_recipe_inputs.py +1 -1
  59. uncountable/types/api/recipes/get_recipes_data.py +29 -0
  60. uncountable/types/api/recipes/lock_recipes.py +2 -1
  61. uncountable/types/api/recipes/set_recipe_total.py +59 -0
  62. uncountable/types/api/recipes/unlock_recipes.py +2 -1
  63. uncountable/types/api/runsheet/export_default_runsheet.py +44 -0
  64. uncountable/types/api/uploader/complete_async_parse.py +4 -0
  65. uncountable/types/async_batch_processor.py +222 -0
  66. uncountable/types/async_batch_t.py +4 -0
  67. uncountable/types/client_base.py +367 -2
  68. uncountable/types/client_config.py +1 -0
  69. uncountable/types/client_config_t.py +10 -0
  70. uncountable/types/entity_t.py +3 -1
  71. uncountable/types/integration_server_t.py +2 -0
  72. uncountable/types/listing.py +46 -0
  73. uncountable/types/listing_t.py +533 -0
  74. uncountable/types/notices.py +8 -0
  75. uncountable/types/notices_t.py +37 -0
  76. uncountable/types/queued_job.py +1 -0
  77. uncountable/types/queued_job_t.py +9 -0
  78. uncountable/types/sockets.py +9 -0
  79. uncountable/types/sockets_t.py +99 -0
  80. uncountable/types/uploader_t.py +3 -2
  81. {uncountablepythonsdk-0.0.126.dist-info → uncountablepythonsdk-0.0.142.dev0.dist-info}/METADATA +4 -2
  82. {uncountablepythonsdk-0.0.126.dist-info → uncountablepythonsdk-0.0.142.dev0.dist-info}/RECORD +84 -68
  83. {uncountablepythonsdk-0.0.126.dist-info → uncountablepythonsdk-0.0.142.dev0.dist-info}/WHEEL +0 -0
  84. {uncountablepythonsdk-0.0.126.dist-info → uncountablepythonsdk-0.0.142.dev0.dist-info}/top_level.txt +0 -0
@@ -4,4 +4,5 @@
4
4
  # DO NOT MODIFY -- This file is generated by type_spec
5
5
  # Kept only for SDK backwards compatibility
6
6
  from .client_config_t import ClientConfigOptions as ClientConfigOptions
7
+ from .client_config_t import RequestOptions as RequestOptions
7
8
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -12,6 +12,7 @@ from . import base_t
12
12
 
13
13
  __all__: list[str] = [
14
14
  "ClientConfigOptions",
15
+ "RequestOptions",
15
16
  ]
16
17
 
17
18
 
@@ -23,4 +24,13 @@ __all__: list[str] = [
23
24
  class ClientConfigOptions:
24
25
  allow_insecure_tls: bool = False
25
26
  extra_headers: dict[str, str] | None = None
27
+
28
+
29
+ # DO NOT MODIFY -- This file is generated by type_spec
30
+ @serial_class(
31
+ named_type_path="sdk.client_config.RequestOptions",
32
+ )
33
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
34
+ class RequestOptions:
35
+ timeout_secs: int | None = None
26
36
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -32,6 +32,7 @@ __all__: list[str] = [
32
32
  "annotation_type": "Annotation Type",
33
33
  "approval": "Approval",
34
34
  "async_job": "Async Job",
35
+ "barcode": "Barcode",
35
36
  "calculation": "Calculation",
36
37
  "calendar": "Calendar",
37
38
  "calendar_event": "Calendar Event",
@@ -217,6 +218,7 @@ class EntityType(StrEnum):
217
218
  ANNOTATION_TYPE = "annotation_type"
218
219
  APPROVAL = "approval"
219
220
  ASYNC_JOB = "async_job"
221
+ BARCODE = "barcode"
220
222
  CALCULATION = "calculation"
221
223
  CALENDAR = "calendar"
222
224
  CALENDAR_EVENT = "calendar_event"
@@ -398,7 +400,7 @@ class EntityType(StrEnum):
398
400
 
399
401
  # DO NOT MODIFY -- This file is generated by type_spec
400
402
  LimitedEntityType = typing.Annotated[
401
- typing.Literal[EntityType.LAB_REQUEST] | typing.Literal[EntityType.APPROVAL] | typing.Literal[EntityType.CUSTOM_ENTITY] | typing.Literal[EntityType.INGREDIENT_ATTRIBUTE] | typing.Literal[EntityType.INVENTORY_AMOUNT] | typing.Literal[EntityType.TASK] | typing.Literal[EntityType.PROJECT] | typing.Literal[EntityType.EQUIPMENT] | typing.Literal[EntityType.INV_LOCAL_LOCATIONS] | typing.Literal[EntityType.FIELD_OPTION_SET] | typing.Literal[EntityType.WEBHOOK] | typing.Literal[EntityType.SPECS] | typing.Literal[EntityType.GOAL] | typing.Literal[EntityType.INGREDIENT_TAG_MAP] | typing.Literal[EntityType.INGREDIENT_TAG] | typing.Literal[EntityType.CONDITION_PARAMETER] | typing.Literal[EntityType.OUTPUT] | typing.Literal[EntityType.OUTPUT_CONDITION_PARAMETER] | typing.Literal[EntityType.ASYNC_JOB] | typing.Literal[EntityType.CONSTRAINT] | typing.Literal[EntityType.INGREDIENT_CATEGORY_ALL] | typing.Literal[EntityType.TIME_SERIES_SEGMENT] | typing.Literal[EntityType.EQUIPMENT_MAINTENANCE] | typing.Literal[EntityType.MAINTENANCE_SCHEDULE] | typing.Literal[EntityType.CONDITION_PARAMETER_RULE] | typing.Literal[EntityType.INGREDIENT] | typing.Literal[EntityType.TIMESHEET_ENTRY] | typing.Literal[EntityType.SAVE] | typing.Literal[EntityType.RECIPE_CHECK],
403
+ typing.Literal[EntityType.LAB_REQUEST] | typing.Literal[EntityType.APPROVAL] | typing.Literal[EntityType.CUSTOM_ENTITY] | typing.Literal[EntityType.INGREDIENT_ATTRIBUTE] | typing.Literal[EntityType.INVENTORY_AMOUNT] | typing.Literal[EntityType.TASK] | typing.Literal[EntityType.PROJECT] | typing.Literal[EntityType.EQUIPMENT] | typing.Literal[EntityType.INV_LOCAL_LOCATIONS] | typing.Literal[EntityType.FIELD_OPTION_SET] | typing.Literal[EntityType.WEBHOOK] | typing.Literal[EntityType.SPECS] | typing.Literal[EntityType.GOAL] | typing.Literal[EntityType.INGREDIENT_TAG_MAP] | typing.Literal[EntityType.INGREDIENT_TAG] | typing.Literal[EntityType.CONDITION_PARAMETER] | typing.Literal[EntityType.NOTEBOOK] | typing.Literal[EntityType.OUTPUT] | typing.Literal[EntityType.OUTPUT_CONDITION_PARAMETER] | typing.Literal[EntityType.ASYNC_JOB] | typing.Literal[EntityType.CONSTRAINT] | typing.Literal[EntityType.INGREDIENT_CATEGORY_ALL] | typing.Literal[EntityType.TIME_SERIES_SEGMENT] | typing.Literal[EntityType.EQUIPMENT_MAINTENANCE] | typing.Literal[EntityType.MAINTENANCE_SCHEDULE] | typing.Literal[EntityType.CONDITION_PARAMETER_RULE] | typing.Literal[EntityType.INGREDIENT] | typing.Literal[EntityType.TIMESHEET_ENTRY] | typing.Literal[EntityType.SAVE] | typing.Literal[EntityType.RECIPE_CHECK] | typing.Literal[EntityType.EXPERIMENT_GROUP_MEMBER],
402
404
  serial_alias_annotation(
403
405
  named_type_path="sdk.entity.LimitedEntityType",
404
406
  ),
@@ -26,6 +26,8 @@ class IntegrationEnvironment(StrEnum):
26
26
  DEV = "dev"
27
27
  TEST = "test"
28
28
  PROD = "prod"
29
+ STG = "stg"
30
+ SBX = "sbx"
29
31
 
30
32
 
31
33
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,46 @@
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 .listing_t import ColumnType as ColumnType
7
+ from .listing_t import ColumnIdentifierEntityRefName as ColumnIdentifierEntityRefName
8
+ from .listing_t import ColumnIdentifierTransitive as ColumnIdentifierTransitive
9
+ from .listing_t import LoadAggregateType as LoadAggregateType
10
+ from .listing_t import LoadAggregateGroupBy as LoadAggregateGroupBy
11
+ from .listing_t import LoadAggregateCollect as LoadAggregateCollect
12
+ from .listing_t import LoadAggregateCollectDistinct as LoadAggregateCollectDistinct
13
+ from .listing_t import LoadAggregateCount as LoadAggregateCount
14
+ from .listing_t import LoadAggregateCountDistinct as LoadAggregateCountDistinct
15
+ from .listing_t import LoadAggregateFirst as LoadAggregateFirst
16
+ from .listing_t import LoadAggregateUniqueValue as LoadAggregateUniqueValue
17
+ from .listing_t import LoadAggregateMin as LoadAggregateMin
18
+ from .listing_t import LoadAggregateMax as LoadAggregateMax
19
+ from .listing_t import LoadAggregateMean as LoadAggregateMean
20
+ from .listing_t import LoadAggregateStddev as LoadAggregateStddev
21
+ from .listing_t import LoadAggregateSum as LoadAggregateSum
22
+ from .listing_t import DateGroupType as DateGroupType
23
+ from .listing_t import LoadAggregateGroupByDate as LoadAggregateGroupByDate
24
+ from .listing_t import AggregateLoadTypes as AggregateLoadTypes
25
+ from .listing_t import ColumnIdentifierTransitiveAggregate as ColumnIdentifierTransitiveAggregate
26
+ from .listing_t import ColumnIdentifier as ColumnIdentifier
27
+ from .listing_t import FilterRelation as FilterRelation
28
+ from .listing_t import FilterSpecBase as FilterSpecBase
29
+ from .listing_t import FilterScalarType as FilterScalarType
30
+ from .listing_t import FilterIdType as FilterIdType
31
+ from .listing_t import StringFilterValue as StringFilterValue
32
+ from .listing_t import FilterSpecEquals as FilterSpecEquals
33
+ from .listing_t import FilterSpecInclude as FilterSpecInclude
34
+ from .listing_t import FilterSpecIStrContains as FilterSpecIStrContains
35
+ from .listing_t import FilterSpecIStrStartsWith as FilterSpecIStrStartsWith
36
+ from .listing_t import FilterSpecExists as FilterSpecExists
37
+ from .listing_t import FilterSpecGreater as FilterSpecGreater
38
+ from .listing_t import FilterSpecLess as FilterSpecLess
39
+ from .listing_t import FilterSpecGeq as FilterSpecGeq
40
+ from .listing_t import FilterSpecLeq as FilterSpecLeq
41
+ from .listing_t import FilterSpec as FilterSpec
42
+ from .listing_t import FilterNodeType as FilterNodeType
43
+ from .listing_t import FilterNodeBase as FilterNodeBase
44
+ from .listing_t import FilterNodeColumnAnd as FilterNodeColumnAnd
45
+ from .listing_t import FilterNode as FilterNode
46
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,533 @@
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 pkgs.serialization import serial_alias_annotation
14
+ from pkgs.serialization import serial_string_enum
15
+ from . import base_t
16
+ from . import entity_t
17
+
18
+ __all__: list[str] = [
19
+ "AggregateLoadTypes",
20
+ "ColumnIdentifier",
21
+ "ColumnIdentifierEntityRefName",
22
+ "ColumnIdentifierTransitive",
23
+ "ColumnIdentifierTransitiveAggregate",
24
+ "ColumnType",
25
+ "DateGroupType",
26
+ "FilterIdType",
27
+ "FilterNode",
28
+ "FilterNodeBase",
29
+ "FilterNodeColumnAnd",
30
+ "FilterNodeType",
31
+ "FilterRelation",
32
+ "FilterScalarType",
33
+ "FilterSpec",
34
+ "FilterSpecBase",
35
+ "FilterSpecEquals",
36
+ "FilterSpecExists",
37
+ "FilterSpecGeq",
38
+ "FilterSpecGreater",
39
+ "FilterSpecIStrContains",
40
+ "FilterSpecIStrStartsWith",
41
+ "FilterSpecInclude",
42
+ "FilterSpecLeq",
43
+ "FilterSpecLess",
44
+ "LoadAggregateCollect",
45
+ "LoadAggregateCollectDistinct",
46
+ "LoadAggregateCount",
47
+ "LoadAggregateCountDistinct",
48
+ "LoadAggregateFirst",
49
+ "LoadAggregateGroupBy",
50
+ "LoadAggregateGroupByDate",
51
+ "LoadAggregateMax",
52
+ "LoadAggregateMean",
53
+ "LoadAggregateMin",
54
+ "LoadAggregateStddev",
55
+ "LoadAggregateSum",
56
+ "LoadAggregateType",
57
+ "LoadAggregateUniqueValue",
58
+ "StringFilterValue",
59
+ ]
60
+
61
+
62
+ # DO NOT MODIFY -- This file is generated by type_spec
63
+ class ColumnType(StrEnum):
64
+ ENTITY_REF_NAME = "entity_ref_name"
65
+ TRANSITIVE = "transitive"
66
+ TRANSITIVE_AGGREGATE = "transitive_aggregate"
67
+
68
+
69
+ # DO NOT MODIFY -- This file is generated by type_spec
70
+ @serial_class(
71
+ named_type_path="sdk.listing.ColumnIdentifierEntityRefName",
72
+ parse_require={"type"},
73
+ )
74
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
75
+ class ColumnIdentifierEntityRefName:
76
+ type: typing.Literal[ColumnType.ENTITY_REF_NAME] = ColumnType.ENTITY_REF_NAME
77
+ entity_type: entity_t.EntityType
78
+ ref_name: str
79
+
80
+
81
+ # DO NOT MODIFY -- This file is generated by type_spec
82
+ @serial_class(
83
+ named_type_path="sdk.listing.ColumnIdentifierTransitive",
84
+ parse_require={"type"},
85
+ )
86
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
87
+ class ColumnIdentifierTransitive:
88
+ type: typing.Literal[ColumnType.TRANSITIVE] = ColumnType.TRANSITIVE
89
+ entity_type: entity_t.EntityType
90
+ via: ColumnIdentifier
91
+ target: ColumnIdentifier
92
+
93
+
94
+ # DO NOT MODIFY -- This file is generated by type_spec
95
+ @serial_string_enum(
96
+ labels={
97
+ "group_by": "Group By",
98
+ "group_by_date": "Group By Date",
99
+ "collect": "Collect",
100
+ "collect_distinct": "Distinct",
101
+ "count": "Count",
102
+ "count_distinct": "Count Distinct",
103
+ "first": "First",
104
+ "unique_value": "Unique Value",
105
+ "min": "Minimum",
106
+ "max": "Maximum",
107
+ "mean": "Mean",
108
+ "stddev": "Standard Deviation",
109
+ "sum": "Sum",
110
+ },
111
+ )
112
+ class LoadAggregateType(StrEnum):
113
+ GROUP_BY = "group_by"
114
+ GROUP_BY_DATE = "group_by_date"
115
+ COLLECT = "collect"
116
+ COLLECT_DISTINCT = "collect_distinct"
117
+ COUNT = "count"
118
+ COUNT_DISTINCT = "count_distinct"
119
+ FIRST = "first"
120
+ UNIQUE_VALUE = "unique_value"
121
+ MIN = "min"
122
+ MAX = "max"
123
+ MEAN = "mean"
124
+ STDDEV = "stddev"
125
+ SUM = "sum"
126
+
127
+
128
+ # DO NOT MODIFY -- This file is generated by type_spec
129
+ @serial_class(
130
+ named_type_path="sdk.listing.LoadAggregateGroupBy",
131
+ parse_require={"type"},
132
+ )
133
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
134
+ class LoadAggregateGroupBy:
135
+ type: typing.Literal[LoadAggregateType.GROUP_BY] = LoadAggregateType.GROUP_BY
136
+
137
+
138
+ # DO NOT MODIFY -- This file is generated by type_spec
139
+ @serial_class(
140
+ named_type_path="sdk.listing.LoadAggregateCollect",
141
+ parse_require={"type"},
142
+ )
143
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
144
+ class LoadAggregateCollect:
145
+ type: typing.Literal[LoadAggregateType.COLLECT] = LoadAggregateType.COLLECT
146
+
147
+
148
+ # DO NOT MODIFY -- This file is generated by type_spec
149
+ @serial_class(
150
+ named_type_path="sdk.listing.LoadAggregateCollectDistinct",
151
+ parse_require={"type"},
152
+ )
153
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
154
+ class LoadAggregateCollectDistinct:
155
+ type: typing.Literal[LoadAggregateType.COLLECT_DISTINCT] = LoadAggregateType.COLLECT_DISTINCT
156
+
157
+
158
+ # DO NOT MODIFY -- This file is generated by type_spec
159
+ @serial_class(
160
+ named_type_path="sdk.listing.LoadAggregateCount",
161
+ parse_require={"type"},
162
+ )
163
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
164
+ class LoadAggregateCount:
165
+ type: typing.Literal[LoadAggregateType.COUNT] = LoadAggregateType.COUNT
166
+
167
+
168
+ # DO NOT MODIFY -- This file is generated by type_spec
169
+ @serial_class(
170
+ named_type_path="sdk.listing.LoadAggregateCountDistinct",
171
+ parse_require={"type"},
172
+ )
173
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
174
+ class LoadAggregateCountDistinct:
175
+ type: typing.Literal[LoadAggregateType.COUNT_DISTINCT] = LoadAggregateType.COUNT_DISTINCT
176
+
177
+
178
+ # DO NOT MODIFY -- This file is generated by type_spec
179
+ @serial_class(
180
+ named_type_path="sdk.listing.LoadAggregateFirst",
181
+ parse_require={"type"},
182
+ )
183
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
184
+ class LoadAggregateFirst:
185
+ type: typing.Literal[LoadAggregateType.FIRST] = LoadAggregateType.FIRST
186
+
187
+
188
+ # DO NOT MODIFY -- This file is generated by type_spec
189
+ @serial_class(
190
+ named_type_path="sdk.listing.LoadAggregateUniqueValue",
191
+ parse_require={"type"},
192
+ )
193
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
194
+ class LoadAggregateUniqueValue:
195
+ type: typing.Literal[LoadAggregateType.UNIQUE_VALUE] = LoadAggregateType.UNIQUE_VALUE
196
+
197
+
198
+ # DO NOT MODIFY -- This file is generated by type_spec
199
+ @serial_class(
200
+ named_type_path="sdk.listing.LoadAggregateMin",
201
+ parse_require={"type"},
202
+ )
203
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
204
+ class LoadAggregateMin:
205
+ type: typing.Literal[LoadAggregateType.MIN] = LoadAggregateType.MIN
206
+
207
+
208
+ # DO NOT MODIFY -- This file is generated by type_spec
209
+ @serial_class(
210
+ named_type_path="sdk.listing.LoadAggregateMax",
211
+ parse_require={"type"},
212
+ )
213
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
214
+ class LoadAggregateMax:
215
+ type: typing.Literal[LoadAggregateType.MAX] = LoadAggregateType.MAX
216
+
217
+
218
+ # DO NOT MODIFY -- This file is generated by type_spec
219
+ @serial_class(
220
+ named_type_path="sdk.listing.LoadAggregateMean",
221
+ parse_require={"type"},
222
+ )
223
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
224
+ class LoadAggregateMean:
225
+ type: typing.Literal[LoadAggregateType.MEAN] = LoadAggregateType.MEAN
226
+
227
+
228
+ # DO NOT MODIFY -- This file is generated by type_spec
229
+ @serial_class(
230
+ named_type_path="sdk.listing.LoadAggregateStddev",
231
+ parse_require={"type"},
232
+ )
233
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
234
+ class LoadAggregateStddev:
235
+ type: typing.Literal[LoadAggregateType.STDDEV] = LoadAggregateType.STDDEV
236
+
237
+
238
+ # DO NOT MODIFY -- This file is generated by type_spec
239
+ @serial_class(
240
+ named_type_path="sdk.listing.LoadAggregateSum",
241
+ parse_require={"type"},
242
+ )
243
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
244
+ class LoadAggregateSum:
245
+ type: typing.Literal[LoadAggregateType.SUM] = LoadAggregateType.SUM
246
+
247
+
248
+ # DO NOT MODIFY -- This file is generated by type_spec
249
+ class DateGroupType(StrEnum):
250
+ DAY = "day"
251
+ WEEK = "week"
252
+ MONTH = "month"
253
+ QUARTER = "quarter"
254
+ YEAR = "year"
255
+
256
+
257
+ # DO NOT MODIFY -- This file is generated by type_spec
258
+ @serial_class(
259
+ named_type_path="sdk.listing.LoadAggregateGroupByDate",
260
+ parse_require={"type"},
261
+ )
262
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
263
+ class LoadAggregateGroupByDate:
264
+ type: typing.Literal[LoadAggregateType.GROUP_BY_DATE] = LoadAggregateType.GROUP_BY_DATE
265
+ date_group: DateGroupType
266
+ user_timezone: str | None = None
267
+
268
+
269
+ # DO NOT MODIFY -- This file is generated by type_spec
270
+ AggregateLoadTypes = typing.Annotated[
271
+ LoadAggregateGroupByDate | LoadAggregateGroupBy | LoadAggregateCollect | LoadAggregateCollectDistinct | LoadAggregateCount | LoadAggregateCountDistinct | LoadAggregateFirst | LoadAggregateUniqueValue | LoadAggregateMin | LoadAggregateMax | LoadAggregateMean | LoadAggregateStddev | LoadAggregateSum,
272
+ serial_union_annotation(
273
+ named_type_path="sdk.listing.AggregateLoadTypes",
274
+ discriminator="type",
275
+ discriminator_map={
276
+ "group_by_date": LoadAggregateGroupByDate,
277
+ "group_by": LoadAggregateGroupBy,
278
+ "collect": LoadAggregateCollect,
279
+ "collect_distinct": LoadAggregateCollectDistinct,
280
+ "count": LoadAggregateCount,
281
+ "count_distinct": LoadAggregateCountDistinct,
282
+ "first": LoadAggregateFirst,
283
+ "unique_value": LoadAggregateUniqueValue,
284
+ "min": LoadAggregateMin,
285
+ "max": LoadAggregateMax,
286
+ "mean": LoadAggregateMean,
287
+ "stddev": LoadAggregateStddev,
288
+ "sum": LoadAggregateSum,
289
+ },
290
+ ),
291
+ ]
292
+
293
+
294
+ # DO NOT MODIFY -- This file is generated by type_spec
295
+ @serial_class(
296
+ named_type_path="sdk.listing.ColumnIdentifierTransitiveAggregate",
297
+ parse_require={"type"},
298
+ )
299
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
300
+ class ColumnIdentifierTransitiveAggregate:
301
+ type: typing.Literal[ColumnType.TRANSITIVE_AGGREGATE] = ColumnType.TRANSITIVE_AGGREGATE
302
+ entity_type: entity_t.EntityType
303
+ via: ColumnIdentifier
304
+ target: ColumnIdentifier
305
+ aggregate: AggregateLoadTypes
306
+ filters: FilterNode | None = None
307
+
308
+
309
+ # DO NOT MODIFY -- This file is generated by type_spec
310
+ ColumnIdentifier = typing.Annotated[
311
+ ColumnIdentifierEntityRefName | ColumnIdentifierTransitive | ColumnIdentifierTransitiveAggregate,
312
+ serial_union_annotation(
313
+ named_type_path="sdk.listing.ColumnIdentifier",
314
+ discriminator="type",
315
+ discriminator_map={
316
+ "entity_ref_name": ColumnIdentifierEntityRefName,
317
+ "transitive": ColumnIdentifierTransitive,
318
+ "transitive_aggregate": ColumnIdentifierTransitiveAggregate,
319
+ },
320
+ ),
321
+ ]
322
+
323
+
324
+ # DO NOT MODIFY -- This file is generated by type_spec
325
+ class FilterRelation(StrEnum):
326
+ EQUALS = "equals"
327
+ GREATER = "greater"
328
+ GEQ = "geq"
329
+ LESS = "less"
330
+ LEQ = "leq"
331
+ ISTR_CONTAINS = "istr_contains"
332
+ ISTR_STARTS_WITH = "istr_starts_with"
333
+ INCLUDE = "include"
334
+ EXISTS = "exists"
335
+
336
+
337
+ # DO NOT MODIFY -- This file is generated by type_spec
338
+ @serial_class(
339
+ named_type_path="sdk.listing.FilterSpecBase",
340
+ )
341
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
342
+ class FilterSpecBase:
343
+ relation: FilterRelation
344
+ column: ColumnIdentifier
345
+
346
+
347
+ # DO NOT MODIFY -- This file is generated by type_spec
348
+ FilterScalarType = typing.Annotated[
349
+ str | int | Decimal,
350
+ serial_alias_annotation(
351
+ named_type_path="sdk.listing.FilterScalarType",
352
+ ),
353
+ ]
354
+
355
+
356
+ # DO NOT MODIFY -- This file is generated by type_spec
357
+ FilterIdType = typing.Annotated[
358
+ base_t.ObjectId | str,
359
+ serial_alias_annotation(
360
+ named_type_path="sdk.listing.FilterIdType",
361
+ ),
362
+ ]
363
+
364
+
365
+ # DO NOT MODIFY -- This file is generated by type_spec
366
+ StringFilterValue = typing.Annotated[
367
+ typing.Union[str],
368
+ serial_alias_annotation(
369
+ named_type_path="sdk.listing.StringFilterValue",
370
+ ),
371
+ ]
372
+
373
+
374
+ # DO NOT MODIFY -- This file is generated by type_spec
375
+ @serial_class(
376
+ named_type_path="sdk.listing.FilterSpecEquals",
377
+ parse_require={"relation"},
378
+ )
379
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
380
+ class FilterSpecEquals(FilterSpecBase):
381
+ relation: typing.Literal[FilterRelation.EQUALS] = FilterRelation.EQUALS
382
+ value: FilterScalarType
383
+
384
+
385
+ # DO NOT MODIFY -- This file is generated by type_spec
386
+ @serial_class(
387
+ named_type_path="sdk.listing.FilterSpecInclude",
388
+ parse_require={"relation"},
389
+ )
390
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
391
+ class FilterSpecInclude(FilterSpecBase):
392
+ relation: typing.Literal[FilterRelation.INCLUDE] = FilterRelation.INCLUDE
393
+ value: FilterIdType | tuple[FilterIdType, ...]
394
+
395
+
396
+ # DO NOT MODIFY -- This file is generated by type_spec
397
+ @serial_class(
398
+ named_type_path="sdk.listing.FilterSpecIStrContains",
399
+ parse_require={"relation"},
400
+ )
401
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
402
+ class FilterSpecIStrContains(FilterSpecBase):
403
+ relation: typing.Literal[FilterRelation.ISTR_CONTAINS] = FilterRelation.ISTR_CONTAINS
404
+ value: str
405
+
406
+
407
+ # DO NOT MODIFY -- This file is generated by type_spec
408
+ @serial_class(
409
+ named_type_path="sdk.listing.FilterSpecIStrStartsWith",
410
+ parse_require={"relation"},
411
+ )
412
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
413
+ class FilterSpecIStrStartsWith(FilterSpecBase):
414
+ relation: typing.Literal[FilterRelation.ISTR_STARTS_WITH] = FilterRelation.ISTR_STARTS_WITH
415
+ value: str
416
+
417
+
418
+ # DO NOT MODIFY -- This file is generated by type_spec
419
+ @serial_class(
420
+ named_type_path="sdk.listing.FilterSpecExists",
421
+ parse_require={"relation"},
422
+ )
423
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
424
+ class FilterSpecExists(FilterSpecBase):
425
+ relation: typing.Literal[FilterRelation.EXISTS] = FilterRelation.EXISTS
426
+
427
+
428
+ # DO NOT MODIFY -- This file is generated by type_spec
429
+ @serial_class(
430
+ named_type_path="sdk.listing.FilterSpecGreater",
431
+ to_string_values={"value"},
432
+ parse_require={"relation"},
433
+ )
434
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
435
+ class FilterSpecGreater(FilterSpecBase):
436
+ relation: typing.Literal[FilterRelation.GREATER] = FilterRelation.GREATER
437
+ value: Decimal
438
+
439
+
440
+ # DO NOT MODIFY -- This file is generated by type_spec
441
+ @serial_class(
442
+ named_type_path="sdk.listing.FilterSpecLess",
443
+ to_string_values={"value"},
444
+ parse_require={"relation"},
445
+ )
446
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
447
+ class FilterSpecLess(FilterSpecBase):
448
+ relation: typing.Literal[FilterRelation.LESS] = FilterRelation.LESS
449
+ value: Decimal
450
+
451
+
452
+ # DO NOT MODIFY -- This file is generated by type_spec
453
+ @serial_class(
454
+ named_type_path="sdk.listing.FilterSpecGeq",
455
+ to_string_values={"value"},
456
+ parse_require={"relation"},
457
+ )
458
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
459
+ class FilterSpecGeq(FilterSpecBase):
460
+ relation: typing.Literal[FilterRelation.GEQ] = FilterRelation.GEQ
461
+ value: Decimal
462
+
463
+
464
+ # DO NOT MODIFY -- This file is generated by type_spec
465
+ @serial_class(
466
+ named_type_path="sdk.listing.FilterSpecLeq",
467
+ to_string_values={"value"},
468
+ parse_require={"relation"},
469
+ )
470
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
471
+ class FilterSpecLeq(FilterSpecBase):
472
+ relation: typing.Literal[FilterRelation.LEQ] = FilterRelation.LEQ
473
+ value: Decimal
474
+
475
+
476
+ # DO NOT MODIFY -- This file is generated by type_spec
477
+ FilterSpec = typing.Annotated[
478
+ FilterSpecEquals | FilterSpecGreater | FilterSpecGeq | FilterSpecLeq | FilterSpecIStrContains | FilterSpecIStrStartsWith | FilterSpecInclude | FilterSpecExists | FilterSpecLess,
479
+ serial_union_annotation(
480
+ named_type_path="sdk.listing.FilterSpec",
481
+ discriminator="relation",
482
+ discriminator_map={
483
+ "equals": FilterSpecEquals,
484
+ "greater": FilterSpecGreater,
485
+ "geq": FilterSpecGeq,
486
+ "leq": FilterSpecLeq,
487
+ "istr_contains": FilterSpecIStrContains,
488
+ "istr_starts_with": FilterSpecIStrStartsWith,
489
+ "include": FilterSpecInclude,
490
+ "exists": FilterSpecExists,
491
+ "less": FilterSpecLess,
492
+ },
493
+ ),
494
+ ]
495
+
496
+
497
+ # DO NOT MODIFY -- This file is generated by type_spec
498
+ class FilterNodeType(StrEnum):
499
+ COLUMN_AND = "column_and"
500
+
501
+
502
+ # DO NOT MODIFY -- This file is generated by type_spec
503
+ @serial_class(
504
+ named_type_path="sdk.listing.FilterNodeBase",
505
+ )
506
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
507
+ class FilterNodeBase:
508
+ type: FilterNodeType
509
+
510
+
511
+ # DO NOT MODIFY -- This file is generated by type_spec
512
+ @serial_class(
513
+ named_type_path="sdk.listing.FilterNodeColumnAnd",
514
+ parse_require={"type"},
515
+ )
516
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True, frozen=True, eq=True) # type: ignore[literal-required]
517
+ class FilterNodeColumnAnd:
518
+ type: typing.Literal[FilterNodeType.COLUMN_AND] = FilterNodeType.COLUMN_AND
519
+ filters: tuple[FilterSpec, ...]
520
+
521
+
522
+ # DO NOT MODIFY -- This file is generated by type_spec
523
+ FilterNode = typing.Annotated[
524
+ typing.Union[FilterNodeColumnAnd],
525
+ serial_union_annotation(
526
+ named_type_path="sdk.listing.FilterNode",
527
+ discriminator="type",
528
+ discriminator_map={
529
+ "column_and": FilterNodeColumnAnd,
530
+ },
531
+ ),
532
+ ]
533
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,8 @@
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 .notices_t import NoticeType as NoticeType
7
+ from .notices_t import NotificationNoticeConfiguration as NotificationNoticeConfiguration
8
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,37 @@
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 . import base_t
13
+
14
+ __all__: list[str] = [
15
+ "NoticeType",
16
+ "NotificationNoticeConfiguration",
17
+ ]
18
+
19
+
20
+ # DO NOT MODIFY -- This file is generated by type_spec
21
+ class NoticeType(StrEnum):
22
+ ERROR = "error"
23
+ WARNING = "warning"
24
+ INFO = "info"
25
+ SUCCESS = "success"
26
+ DEBUG = "debug"
27
+ PLAIN = "plain"
28
+
29
+
30
+ # DO NOT MODIFY -- This file is generated by type_spec
31
+ @serial_class(
32
+ named_type_path="sdk.notices.NotificationNoticeConfiguration",
33
+ )
34
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
35
+ class NotificationNoticeConfiguration:
36
+ notice_type: NoticeType | None = None
37
+ # DO NOT MODIFY -- This file is generated by type_spec