UncountablePythonSDK 0.0.115__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 (119) hide show
  1. docs/conf.py +52 -5
  2. docs/index.md +107 -4
  3. docs/integration_examples/create_ingredient.md +43 -0
  4. docs/integration_examples/create_output.md +56 -0
  5. docs/integration_examples/index.md +6 -0
  6. docs/justfile +1 -1
  7. docs/requirements.txt +3 -2
  8. examples/basic_auth.py +7 -0
  9. examples/integration-server/jobs/materials_auto/example_cron.py +3 -0
  10. examples/integration-server/jobs/materials_auto/example_http.py +19 -7
  11. examples/integration-server/jobs/materials_auto/example_instrument.py +100 -0
  12. examples/integration-server/jobs/materials_auto/example_parse.py +140 -0
  13. examples/integration-server/jobs/materials_auto/example_predictions.py +61 -0
  14. examples/integration-server/jobs/materials_auto/example_runsheet_wh.py +57 -16
  15. examples/integration-server/jobs/materials_auto/profile.yaml +27 -0
  16. examples/integration-server/pyproject.toml +4 -4
  17. examples/oauth.py +7 -0
  18. pkgs/argument_parser/__init__.py +1 -0
  19. pkgs/argument_parser/_is_namedtuple.py +3 -0
  20. pkgs/argument_parser/argument_parser.py +22 -3
  21. pkgs/serialization_util/serialization_helpers.py +3 -1
  22. pkgs/type_spec/builder.py +66 -19
  23. pkgs/type_spec/builder_types.py +9 -0
  24. pkgs/type_spec/config.py +26 -5
  25. pkgs/type_spec/cross_output_links.py +10 -16
  26. pkgs/type_spec/emit_open_api.py +72 -22
  27. pkgs/type_spec/emit_open_api_util.py +1 -0
  28. pkgs/type_spec/emit_python.py +76 -12
  29. pkgs/type_spec/emit_typescript.py +48 -32
  30. pkgs/type_spec/emit_typescript_util.py +44 -6
  31. pkgs/type_spec/load_types.py +2 -2
  32. pkgs/type_spec/open_api_util.py +16 -1
  33. pkgs/type_spec/parts/base.ts.prepart +4 -0
  34. pkgs/type_spec/type_info/emit_type_info.py +37 -4
  35. pkgs/type_spec/ui_entry_actions/generate_ui_entry_actions.py +1 -0
  36. pkgs/type_spec/value_spec/__main__.py +2 -2
  37. pkgs/type_spec/value_spec/emit_python.py +6 -1
  38. uncountable/core/client.py +10 -3
  39. uncountable/integration/cli.py +175 -23
  40. uncountable/integration/executors/executors.py +1 -2
  41. uncountable/integration/executors/generic_upload_executor.py +1 -1
  42. uncountable/integration/http_server/types.py +3 -1
  43. uncountable/integration/job.py +35 -3
  44. uncountable/integration/queue_runner/command_server/__init__.py +4 -0
  45. uncountable/integration/queue_runner/command_server/command_client.py +89 -0
  46. uncountable/integration/queue_runner/command_server/command_server.py +117 -5
  47. uncountable/integration/queue_runner/command_server/constants.py +4 -0
  48. uncountable/integration/queue_runner/command_server/protocol/command_server.proto +51 -0
  49. uncountable/integration/queue_runner/command_server/protocol/command_server_pb2.py +34 -11
  50. uncountable/integration/queue_runner/command_server/protocol/command_server_pb2.pyi +102 -1
  51. uncountable/integration/queue_runner/command_server/protocol/command_server_pb2_grpc.py +180 -0
  52. uncountable/integration/queue_runner/command_server/types.py +44 -1
  53. uncountable/integration/queue_runner/datastore/datastore_sqlite.py +189 -8
  54. uncountable/integration/queue_runner/datastore/interface.py +13 -0
  55. uncountable/integration/queue_runner/datastore/model.py +8 -1
  56. uncountable/integration/queue_runner/job_scheduler.py +85 -21
  57. uncountable/integration/queue_runner/queue_runner.py +10 -2
  58. uncountable/integration/queue_runner/types.py +2 -0
  59. uncountable/integration/queue_runner/worker.py +28 -29
  60. uncountable/integration/scheduler.py +121 -23
  61. uncountable/integration/server.py +36 -6
  62. uncountable/integration/telemetry.py +129 -8
  63. uncountable/integration/webhook_server/entrypoint.py +2 -0
  64. uncountable/types/__init__.py +38 -0
  65. uncountable/types/api/entity/create_or_update_entity.py +1 -0
  66. uncountable/types/api/entity/export_entities.py +13 -0
  67. uncountable/types/api/entity/list_aggregate.py +79 -0
  68. uncountable/types/api/entity/list_entities.py +25 -0
  69. uncountable/types/api/entity/set_barcode.py +43 -0
  70. uncountable/types/api/entity/transition_entity_phase.py +2 -1
  71. uncountable/types/api/files/download_file.py +15 -1
  72. uncountable/types/api/integrations/__init__.py +1 -0
  73. uncountable/types/api/integrations/publish_realtime_data.py +41 -0
  74. uncountable/types/api/integrations/push_notification.py +49 -0
  75. uncountable/types/api/integrations/register_sockets_token.py +41 -0
  76. uncountable/types/api/listing/__init__.py +1 -0
  77. uncountable/types/api/listing/fetch_listing.py +57 -0
  78. uncountable/types/api/notebooks/__init__.py +1 -0
  79. uncountable/types/api/notebooks/add_notebook_content.py +119 -0
  80. uncountable/types/api/outputs/get_output_organization.py +173 -0
  81. uncountable/types/api/recipes/edit_recipe_inputs.py +1 -1
  82. uncountable/types/api/recipes/get_recipe_output_metadata.py +2 -2
  83. uncountable/types/api/recipes/get_recipes_data.py +29 -0
  84. uncountable/types/api/recipes/lock_recipes.py +2 -1
  85. uncountable/types/api/recipes/set_recipe_total.py +59 -0
  86. uncountable/types/api/recipes/unlock_recipes.py +2 -1
  87. uncountable/types/api/runsheet/export_default_runsheet.py +44 -0
  88. uncountable/types/api/uploader/complete_async_parse.py +46 -0
  89. uncountable/types/api/user/__init__.py +1 -0
  90. uncountable/types/api/user/get_current_user_info.py +40 -0
  91. uncountable/types/async_batch_processor.py +266 -0
  92. uncountable/types/async_batch_t.py +5 -0
  93. uncountable/types/client_base.py +432 -2
  94. uncountable/types/client_config.py +1 -0
  95. uncountable/types/client_config_t.py +10 -0
  96. uncountable/types/entity_t.py +9 -1
  97. uncountable/types/exports_t.py +1 -0
  98. uncountable/types/integration_server_t.py +2 -0
  99. uncountable/types/integration_session.py +10 -0
  100. uncountable/types/integration_session_t.py +60 -0
  101. uncountable/types/integrations.py +10 -0
  102. uncountable/types/integrations_t.py +62 -0
  103. uncountable/types/listing.py +46 -0
  104. uncountable/types/listing_t.py +533 -0
  105. uncountable/types/notices.py +8 -0
  106. uncountable/types/notices_t.py +37 -0
  107. uncountable/types/notifications.py +11 -0
  108. uncountable/types/notifications_t.py +74 -0
  109. uncountable/types/queued_job.py +2 -0
  110. uncountable/types/queued_job_t.py +20 -2
  111. uncountable/types/sockets.py +20 -0
  112. uncountable/types/sockets_t.py +169 -0
  113. uncountable/types/uploader.py +24 -0
  114. uncountable/types/uploader_t.py +222 -0
  115. {uncountablepythonsdk-0.0.115.dist-info → uncountablepythonsdk-0.0.142.dev0.dist-info}/METADATA +5 -2
  116. {uncountablepythonsdk-0.0.115.dist-info → uncountablepythonsdk-0.0.142.dev0.dist-info}/RECORD +118 -79
  117. docs/quickstart.md +0 -19
  118. {uncountablepythonsdk-0.0.115.dist-info → uncountablepythonsdk-0.0.142.dev0.dist-info}/WHEEL +0 -0
  119. {uncountablepythonsdk-0.0.115.dist-info → uncountablepythonsdk-0.0.142.dev0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,59 @@
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 async_batch_t
12
+ from ... import base_t
13
+ from ... import identifier_t
14
+ from ... import recipe_inputs_t
15
+ from ... import recipe_workflow_steps_t
16
+
17
+ __all__: list[str] = [
18
+ "Arguments",
19
+ "Data",
20
+ "ENDPOINT_METHOD",
21
+ "ENDPOINT_PATH",
22
+ "ValueNumeric",
23
+ ]
24
+
25
+ ENDPOINT_METHOD = "POST"
26
+ ENDPOINT_PATH = "api/external/recipes/set_recipe_total"
27
+
28
+
29
+ # DO NOT MODIFY -- This file is generated by type_spec
30
+ @serial_class(
31
+ named_type_path="sdk.api.recipes.set_recipe_total.ValueNumeric",
32
+ to_string_values={"value"},
33
+ )
34
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
35
+ class ValueNumeric:
36
+ value: Decimal
37
+ quantity_basis: recipe_inputs_t.QuantityBasis
38
+
39
+
40
+ # DO NOT MODIFY -- This file is generated by type_spec
41
+ @serial_class(
42
+ named_type_path="sdk.api.recipes.set_recipe_total.Arguments",
43
+ )
44
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
45
+ class Arguments:
46
+ recipe_key: identifier_t.IdentifierKey
47
+ value: ValueNumeric
48
+ recipe_workflow_step_identifier: recipe_workflow_steps_t.RecipeWorkflowStepIdentifier | None = None
49
+ calculation_key: identifier_t.IdentifierKey | None = None
50
+
51
+
52
+ # DO NOT MODIFY -- This file is generated by type_spec
53
+ @serial_class(
54
+ named_type_path="sdk.api.recipes.set_recipe_total.Data",
55
+ )
56
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
57
+ class Data(async_batch_t.AsyncBatchActionReturn):
58
+ pass
59
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -9,6 +9,7 @@ from decimal import Decimal # noqa: F401
9
9
  from enum import StrEnum
10
10
  import dataclasses
11
11
  from pkgs.serialization import serial_class
12
+ from ... import async_batch_t
12
13
  from ... import base_t
13
14
  from ... import identifier_t
14
15
 
@@ -45,6 +46,6 @@ class Arguments:
45
46
  named_type_path="sdk.api.recipes.unlock_recipes.Data",
46
47
  )
47
48
  @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
48
- class Data:
49
+ class Data(async_batch_t.AsyncBatchActionReturn):
49
50
  pass
50
51
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,44 @@
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 entity_t
13
+ from ... import identifier_t
14
+
15
+ __all__: list[str] = [
16
+ "Arguments",
17
+ "Data",
18
+ "ENDPOINT_METHOD",
19
+ "ENDPOINT_PATH",
20
+ ]
21
+
22
+ ENDPOINT_METHOD = "POST"
23
+ ENDPOINT_PATH = "api/external/runsheet/export_default_runsheet"
24
+
25
+
26
+ # DO NOT MODIFY -- This file is generated by type_spec
27
+ @serial_class(
28
+ named_type_path="sdk.api.runsheet.export_default_runsheet.Arguments",
29
+ )
30
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
31
+ class Arguments:
32
+ entities: list[identifier_t.IdentifierKey]
33
+ entity_type: entity_t.EntityType = entity_t.EntityType.RECIPE
34
+ runsheet_key: identifier_t.IdentifierKey
35
+
36
+
37
+ # DO NOT MODIFY -- This file is generated by type_spec
38
+ @serial_class(
39
+ named_type_path="sdk.api.runsheet.export_default_runsheet.Data",
40
+ )
41
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
42
+ class Data:
43
+ text_document_id: base_t.ObjectId
44
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,46 @@
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 async_batch_t
12
+ from ... import base_t
13
+ from ... import generic_upload_t
14
+ from ... import identifier_t
15
+ from ... import uploader_t
16
+
17
+ __all__: list[str] = [
18
+ "Arguments",
19
+ "Data",
20
+ "ENDPOINT_METHOD",
21
+ "ENDPOINT_PATH",
22
+ ]
23
+
24
+ ENDPOINT_METHOD = "POST"
25
+ ENDPOINT_PATH = "api/external/uploader/complete_async_parse"
26
+
27
+
28
+ # DO NOT MODIFY -- This file is generated by type_spec
29
+ @serial_class(
30
+ named_type_path="sdk.api.uploader.complete_async_parse.Arguments",
31
+ )
32
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
33
+ class Arguments:
34
+ parsed_file_data: list[uploader_t.ParsedFileData]
35
+ async_job_key: identifier_t.IdentifierKey
36
+ upload_destination: generic_upload_t.UploadDestinationRecipe
37
+
38
+
39
+ # DO NOT MODIFY -- This file is generated by type_spec
40
+ @serial_class(
41
+ named_type_path="sdk.api.uploader.complete_async_parse.Data",
42
+ )
43
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
44
+ class Data(async_batch_t.AsyncBatchActionReturn):
45
+ pass
46
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1 @@
1
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -0,0 +1,40 @@
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
+
13
+ __all__: list[str] = [
14
+ "Arguments",
15
+ "Data",
16
+ "ENDPOINT_METHOD",
17
+ "ENDPOINT_PATH",
18
+ ]
19
+
20
+ ENDPOINT_METHOD = "GET"
21
+ ENDPOINT_PATH = "api/external/user/get_current_user_info"
22
+
23
+
24
+ # DO NOT MODIFY -- This file is generated by type_spec
25
+ @serial_class(
26
+ named_type_path="sdk.api.user.get_current_user_info.Arguments",
27
+ )
28
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
29
+ class Arguments:
30
+ pass
31
+
32
+
33
+ # DO NOT MODIFY -- This file is generated by type_spec
34
+ @serial_class(
35
+ named_type_path="sdk.api.user.get_current_user_info.Data",
36
+ )
37
+ @dataclasses.dataclass(slots=base_t.ENABLE_SLOTS, kw_only=True) # type: ignore[literal-required]
38
+ class Data:
39
+ user_id: base_t.ObjectId
40
+ # DO NOT MODIFY -- This file is generated by type_spec
@@ -13,6 +13,8 @@ import uncountable.types.api.recipes.associate_recipe_as_lot as associate_recipe
13
13
  from uncountable.types import async_batch_t
14
14
  from uncountable.types import base_t
15
15
  import uncountable.types.api.recipes.clear_recipe_outputs as clear_recipe_outputs_t
16
+ from uncountable.types import client_config_t
17
+ import uncountable.types.api.uploader.complete_async_parse as complete_async_parse_t
16
18
  import uncountable.types.api.runsheet.complete_async_upload as complete_async_upload_t
17
19
  import uncountable.types.api.recipes.create_mix_order as create_mix_order_t
18
20
  import uncountable.types.api.entity.create_or_update_entity as create_or_update_entity_t
@@ -24,12 +26,20 @@ from uncountable.types import generic_upload_t
24
26
  import uncountable.types.api.entity.grant_entity_permissions as grant_entity_permissions_t
25
27
  from uncountable.types import identifier_t
26
28
  import uncountable.types.api.uploader.invoke_uploader as invoke_uploader_t
29
+ import uncountable.types.api.recipes.lock_recipes as lock_recipes_t
27
30
  import uncountable.types.api.entity.lookup_entity as lookup_entity_t
31
+ from uncountable.types import notices_t
32
+ from uncountable.types import notifications_t
33
+ import uncountable.types.api.integrations.push_notification as push_notification_t
28
34
  from uncountable.types import recipe_identifiers_t
29
35
  from uncountable.types import recipe_metadata_t
30
36
  from uncountable.types import recipe_workflow_steps_t
37
+ import uncountable.types.api.entity.set_barcode as set_barcode_t
31
38
  import uncountable.types.api.entity.set_entity_field_values as set_entity_field_values_t
32
39
  import uncountable.types.api.recipes.set_recipe_metadata as set_recipe_metadata_t
40
+ import uncountable.types.api.entity.transition_entity_phase as transition_entity_phase_t
41
+ import uncountable.types.api.recipes.unlock_recipes as unlock_recipes_t
42
+ from uncountable.types import uploader_t
33
43
  import uncountable.types.api.condition_parameters.upsert_condition_match as upsert_condition_match_t
34
44
  import uuid
35
45
  from abc import ABC, abstractmethod
@@ -51,6 +61,7 @@ class AsyncBatchProcessorBase(ABC):
51
61
  equipment_key: identifier_t.IdentifierKey,
52
62
  material_family_ids: list[base_t.ObjectId],
53
63
  depends_on: list[str] | None = None,
64
+ _request_options: client_config_t.RequestOptions | None = None,
54
65
  ) -> async_batch_t.QueuedAsyncBatchRequest:
55
66
  """Create or return the input association for equipment
56
67
 
@@ -87,6 +98,7 @@ class AsyncBatchProcessorBase(ABC):
87
98
  input_key: identifier_t.IdentifierKey | None = None,
88
99
  show_in_listings: bool | None = None,
89
100
  depends_on: list[str] | None = None,
101
+ _request_options: client_config_t.RequestOptions | None = None,
90
102
  ) -> async_batch_t.QueuedAsyncBatchRequest:
91
103
  """Create or return the input association for a recipe
92
104
 
@@ -124,6 +136,7 @@ class AsyncBatchProcessorBase(ABC):
124
136
  recipe_key: identifier_t.IdentifierKey,
125
137
  ingredient_key: identifier_t.IdentifierKey,
126
138
  depends_on: list[str] | None = None,
139
+ _request_options: client_config_t.RequestOptions | None = None,
127
140
  ) -> async_batch_t.QueuedAsyncBatchRequest:
128
141
  """Create a new lot association for the provided recipe with the provided ingredient
129
142
 
@@ -158,6 +171,7 @@ class AsyncBatchProcessorBase(ABC):
158
171
  *,
159
172
  recipe_key: identifier_t.IdentifierKey,
160
173
  depends_on: list[str] | None = None,
174
+ _request_options: client_config_t.RequestOptions | None = None,
161
175
  ) -> async_batch_t.QueuedAsyncBatchRequest:
162
176
  """Clears all output values & output metadata for a given recipe
163
177
 
@@ -185,12 +199,49 @@ class AsyncBatchProcessorBase(ABC):
185
199
  batch_reference=req.batch_reference,
186
200
  )
187
201
 
202
+ def complete_async_parse(
203
+ self,
204
+ *,
205
+ parsed_file_data: list[uploader_t.ParsedFileData],
206
+ async_job_key: identifier_t.IdentifierKey,
207
+ upload_destination: generic_upload_t.UploadDestinationRecipe,
208
+ depends_on: list[str] | None = None,
209
+ _request_options: client_config_t.RequestOptions | None = None,
210
+ ) -> async_batch_t.QueuedAsyncBatchRequest:
211
+ """Parses uploaded files asynchronously
212
+
213
+ :param depends_on: A list of batch reference keys to process before processing this request
214
+ """
215
+ args = complete_async_parse_t.Arguments(
216
+ parsed_file_data=parsed_file_data,
217
+ async_job_key=async_job_key,
218
+ upload_destination=upload_destination,
219
+ )
220
+ json_data = serialize_for_api(args)
221
+
222
+ batch_reference = str(uuid.uuid4())
223
+
224
+ req = async_batch_t.AsyncBatchRequest(
225
+ path=async_batch_t.AsyncBatchRequestPath.COMPLETE_ASYNC_PARSE,
226
+ data=json_data,
227
+ depends_on=depends_on,
228
+ batch_reference=batch_reference,
229
+ )
230
+
231
+ self._enqueue(req)
232
+
233
+ return async_batch_t.QueuedAsyncBatchRequest(
234
+ path=req.path,
235
+ batch_reference=req.batch_reference,
236
+ )
237
+
188
238
  def complete_async_upload(
189
239
  self,
190
240
  *,
191
241
  async_job_id: base_t.ObjectId,
192
242
  file_id: base_t.ObjectId,
193
243
  depends_on: list[str] | None = None,
244
+ _request_options: client_config_t.RequestOptions | None = None,
194
245
  ) -> async_batch_t.QueuedAsyncBatchRequest:
195
246
  """Processes an file id with a given async job id to be uploaded asynchronously
196
247
 
@@ -224,6 +275,7 @@ class AsyncBatchProcessorBase(ABC):
224
275
  recipe_key: identifier_t.IdentifierKey,
225
276
  recipe_workflow_step_identifier: recipe_workflow_steps_t.RecipeWorkflowStepIdentifier,
226
277
  depends_on: list[str] | None = None,
278
+ _request_options: client_config_t.RequestOptions | None = None,
227
279
  ) -> async_batch_t.QueuedAsyncBatchRequest:
228
280
  """Creates mix order on a recipe workflow step
229
281
 
@@ -258,10 +310,13 @@ class AsyncBatchProcessorBase(ABC):
258
310
  definition_key: identifier_t.IdentifierKey,
259
311
  field_values: list[field_values_t.FieldArgumentValue],
260
312
  entity_key: identifier_t.IdentifierKey | None = None,
313
+ on_create_init_field_values: list[field_values_t.FieldArgumentValue] | None = None,
261
314
  depends_on: list[str] | None = None,
315
+ _request_options: client_config_t.RequestOptions | None = None,
262
316
  ) -> async_batch_t.QueuedAsyncBatchRequest:
263
317
  """Creates or updates field values for an entity
264
318
 
319
+ :param on_create_init_field_values: Field values set only when the entity is created (will be ignored if entity already exists)
265
320
  :param depends_on: A list of batch reference keys to process before processing this request
266
321
  """
267
322
  args = create_or_update_entity_t.Arguments(
@@ -269,6 +324,7 @@ class AsyncBatchProcessorBase(ABC):
269
324
  entity_type=entity_type,
270
325
  definition_key=definition_key,
271
326
  field_values=field_values,
327
+ on_create_init_field_values=on_create_init_field_values,
272
328
  )
273
329
  json_data = serialize_for_api(args)
274
330
 
@@ -300,6 +356,7 @@ class AsyncBatchProcessorBase(ABC):
300
356
  identifiers: recipe_identifiers_t.RecipeIdentifiers | None = None,
301
357
  definition_key: identifier_t.IdentifierKey | None = None,
302
358
  depends_on: list[str] | None = None,
359
+ _request_options: client_config_t.RequestOptions | None = None,
303
360
  ) -> async_batch_t.QueuedAsyncBatchRequest:
304
361
  """Returns the id of the recipe being created.
305
362
 
@@ -348,6 +405,7 @@ class AsyncBatchProcessorBase(ABC):
348
405
  recipe_workflow_step_identifier: recipe_workflow_steps_t.RecipeWorkflowStepIdentifier,
349
406
  edits: list[edit_recipe_inputs_t.RecipeInputEdit],
350
407
  depends_on: list[str] | None = None,
408
+ _request_options: client_config_t.RequestOptions | None = None,
351
409
  ) -> async_batch_t.QueuedAsyncBatchRequest:
352
410
  """Clear, update, or add inputs on a recipe
353
411
 
@@ -387,6 +445,7 @@ class AsyncBatchProcessorBase(ABC):
387
445
  user_group_keys: list[identifier_t.IdentifierKey] | None = None,
388
446
  all_users: bool | None = None,
389
447
  depends_on: list[str] | None = None,
448
+ _request_options: client_config_t.RequestOptions | None = None,
390
449
  ) -> async_batch_t.QueuedAsyncBatchRequest:
391
450
  """Grant entity permissions to a list of users or user groups or to all users.
392
451
 
@@ -426,6 +485,7 @@ class AsyncBatchProcessorBase(ABC):
426
485
  file_id: base_t.ObjectId | None = None,
427
486
  file_ids: list[base_t.ObjectId] | None = None,
428
487
  depends_on: list[str] | None = None,
488
+ _request_options: client_config_t.RequestOptions | None = None,
429
489
  ) -> async_batch_t.QueuedAsyncBatchRequest:
430
490
  """Runs a file through an uploader.
431
491
 
@@ -456,12 +516,61 @@ class AsyncBatchProcessorBase(ABC):
456
516
  batch_reference=req.batch_reference,
457
517
  )
458
518
 
519
+ def lock_recipes(
520
+ self,
521
+ *,
522
+ type: lock_recipes_t.RecipeLockType = lock_recipes_t.RecipeLockType.ALL,
523
+ recipes: list[identifier_t.IdentifierKey],
524
+ globally_removable: bool,
525
+ lock_samples: bool | None = None,
526
+ comments: str | None = None,
527
+ depends_on: list[str] | None = None,
528
+ _request_options: client_config_t.RequestOptions | None = None,
529
+ ) -> async_batch_t.QueuedAsyncBatchRequest:
530
+ """Lock experiments. Experiments will require unlocking to be editable. Edits to the experiments are blocked while they are locked.
531
+
532
+ :param type: The type of lock to set.
533
+ All = both inputs and measurements are locked.
534
+ Inputs Only = only inputs are locked from editing.
535
+
536
+ :param recipes: The recipes to lock, a maximum of 100 can be sent
537
+ :param globally_removable: If true any user can unlock the experiment. If false the locking user is the only user that can unlock.
538
+ :param lock_samples: Should associated experiment test samples also be locked.
539
+ :param comments: Optional comment describing the purpose of locking
540
+ :param depends_on: A list of batch reference keys to process before processing this request
541
+ """
542
+ args = lock_recipes_t.Arguments(
543
+ type=type,
544
+ recipes=recipes,
545
+ globally_removable=globally_removable,
546
+ lock_samples=lock_samples,
547
+ comments=comments,
548
+ )
549
+ json_data = serialize_for_api(args)
550
+
551
+ batch_reference = str(uuid.uuid4())
552
+
553
+ req = async_batch_t.AsyncBatchRequest(
554
+ path=async_batch_t.AsyncBatchRequestPath.LOCK_RECIPES,
555
+ data=json_data,
556
+ depends_on=depends_on,
557
+ batch_reference=batch_reference,
558
+ )
559
+
560
+ self._enqueue(req)
561
+
562
+ return async_batch_t.QueuedAsyncBatchRequest(
563
+ path=req.path,
564
+ batch_reference=req.batch_reference,
565
+ )
566
+
459
567
  def lookup_entity(
460
568
  self,
461
569
  *,
462
570
  entity_type: entity_t.EntityType,
463
571
  query: lookup_entity_t.LookupEntityQuery,
464
572
  depends_on: list[str] | None = None,
573
+ _request_options: client_config_t.RequestOptions | None = None,
465
574
  ) -> async_batch_t.QueuedAsyncBatchRequest:
466
575
  """Look up an entity based on an identifier or field values
467
576
 
@@ -489,12 +598,89 @@ class AsyncBatchProcessorBase(ABC):
489
598
  batch_reference=req.batch_reference,
490
599
  )
491
600
 
601
+ def push_notification(
602
+ self,
603
+ *,
604
+ notification_targets: list[notifications_t.NotificationTarget],
605
+ subject: str,
606
+ message: str,
607
+ display_notice: bool = False,
608
+ entity: entity_t.EntityIdentifier | None = None,
609
+ notice_configuration: notices_t.NotificationNoticeConfiguration | None = None,
610
+ depends_on: list[str] | None = None,
611
+ _request_options: client_config_t.RequestOptions | None = None,
612
+ ) -> async_batch_t.QueuedAsyncBatchRequest:
613
+ """Push a notification to a user or user group
614
+
615
+ :param depends_on: A list of batch reference keys to process before processing this request
616
+ """
617
+ args = push_notification_t.Arguments(
618
+ notification_targets=notification_targets,
619
+ subject=subject,
620
+ message=message,
621
+ entity=entity,
622
+ display_notice=display_notice,
623
+ notice_configuration=notice_configuration,
624
+ )
625
+ json_data = serialize_for_api(args)
626
+
627
+ batch_reference = str(uuid.uuid4())
628
+
629
+ req = async_batch_t.AsyncBatchRequest(
630
+ path=async_batch_t.AsyncBatchRequestPath.PUSH_NOTIFICATION,
631
+ data=json_data,
632
+ depends_on=depends_on,
633
+ batch_reference=batch_reference,
634
+ )
635
+
636
+ self._enqueue(req)
637
+
638
+ return async_batch_t.QueuedAsyncBatchRequest(
639
+ path=req.path,
640
+ batch_reference=req.batch_reference,
641
+ )
642
+
643
+ def set_barcode(
644
+ self,
645
+ *,
646
+ entity_key: entity_t.EntityIdentifier,
647
+ barcode_value: str,
648
+ depends_on: list[str] | None = None,
649
+ _request_options: client_config_t.RequestOptions | None = None,
650
+ ) -> async_batch_t.QueuedAsyncBatchRequest:
651
+ """Sets the barcode for an entity
652
+
653
+ :param depends_on: A list of batch reference keys to process before processing this request
654
+ """
655
+ args = set_barcode_t.Arguments(
656
+ entity_key=entity_key,
657
+ barcode_value=barcode_value,
658
+ )
659
+ json_data = serialize_for_api(args)
660
+
661
+ batch_reference = str(uuid.uuid4())
662
+
663
+ req = async_batch_t.AsyncBatchRequest(
664
+ path=async_batch_t.AsyncBatchRequestPath.SET_BARCODE,
665
+ data=json_data,
666
+ depends_on=depends_on,
667
+ batch_reference=batch_reference,
668
+ )
669
+
670
+ self._enqueue(req)
671
+
672
+ return async_batch_t.QueuedAsyncBatchRequest(
673
+ path=req.path,
674
+ batch_reference=req.batch_reference,
675
+ )
676
+
492
677
  def set_entity_field_values(
493
678
  self,
494
679
  *,
495
680
  entity_identifier: entity_t.EntityIdentifier,
496
681
  field_values: list[field_values_t.FieldArgumentValue],
497
682
  depends_on: list[str] | None = None,
683
+ _request_options: client_config_t.RequestOptions | None = None,
498
684
  ) -> async_batch_t.QueuedAsyncBatchRequest:
499
685
  """Sets field values for an entity
500
686
 
@@ -530,6 +716,7 @@ class AsyncBatchProcessorBase(ABC):
530
716
  recipe_key: identifier_t.IdentifierKey,
531
717
  recipe_metadata: list[recipe_metadata_t.MetadataValue],
532
718
  depends_on: list[str] | None = None,
719
+ _request_options: client_config_t.RequestOptions | None = None,
533
720
  ) -> async_batch_t.QueuedAsyncBatchRequest:
534
721
  """Set metadata values on a recipe
535
722
 
@@ -559,6 +746,84 @@ class AsyncBatchProcessorBase(ABC):
559
746
  batch_reference=req.batch_reference,
560
747
  )
561
748
 
749
+ def transition_entity_phase(
750
+ self,
751
+ *,
752
+ transition: transition_entity_phase_t.TransitionIdentifier,
753
+ entity: entity_t.Entity | None = None,
754
+ entity_identifier: entity_t.EntityIdentifier | None = None,
755
+ depends_on: list[str] | None = None,
756
+ _request_options: client_config_t.RequestOptions | None = None,
757
+ ) -> async_batch_t.QueuedAsyncBatchRequest:
758
+ """Transitions an entity from one phase to another
759
+
760
+ :param entity: Entity to transition. If entity_identifier is provided, this should be omitted.
761
+ :param entity_identifier: Identifier of the entity to transition. If entity is provided, this should be omitted.
762
+ :param transition: Identifier of the transition to perform
763
+ :param depends_on: A list of batch reference keys to process before processing this request
764
+ """
765
+ args = transition_entity_phase_t.Arguments(
766
+ entity=entity,
767
+ entity_identifier=entity_identifier,
768
+ transition=transition,
769
+ )
770
+ json_data = serialize_for_api(args)
771
+
772
+ batch_reference = str(uuid.uuid4())
773
+
774
+ req = async_batch_t.AsyncBatchRequest(
775
+ path=async_batch_t.AsyncBatchRequestPath.TRANSITION_ENTITY_PHASE,
776
+ data=json_data,
777
+ depends_on=depends_on,
778
+ batch_reference=batch_reference,
779
+ )
780
+
781
+ self._enqueue(req)
782
+
783
+ return async_batch_t.QueuedAsyncBatchRequest(
784
+ path=req.path,
785
+ batch_reference=req.batch_reference,
786
+ )
787
+
788
+ def unlock_recipes(
789
+ self,
790
+ *,
791
+ type: unlock_recipes_t.RecipeUnlockType = unlock_recipes_t.RecipeUnlockType.STANDARD,
792
+ recipes: list[identifier_t.IdentifierKey],
793
+ unlock_samples: bool | None = None,
794
+ depends_on: list[str] | None = None,
795
+ _request_options: client_config_t.RequestOptions | None = None,
796
+ ) -> async_batch_t.QueuedAsyncBatchRequest:
797
+ """Unlock experiments. Experiments will edtiable after unlocking if they are currently locked.
798
+
799
+ :param type: The method to unlock recipes. Default is standard.
800
+ :param recipes: The recipes to unlock, a maximum of 100 can be sent
801
+ :param unlock_samples: Should associated experiment test samples also be unlocked.
802
+ :param depends_on: A list of batch reference keys to process before processing this request
803
+ """
804
+ args = unlock_recipes_t.Arguments(
805
+ type=type,
806
+ recipes=recipes,
807
+ unlock_samples=unlock_samples,
808
+ )
809
+ json_data = serialize_for_api(args)
810
+
811
+ batch_reference = str(uuid.uuid4())
812
+
813
+ req = async_batch_t.AsyncBatchRequest(
814
+ path=async_batch_t.AsyncBatchRequestPath.UNLOCK_RECIPES,
815
+ data=json_data,
816
+ depends_on=depends_on,
817
+ batch_reference=batch_reference,
818
+ )
819
+
820
+ self._enqueue(req)
821
+
822
+ return async_batch_t.QueuedAsyncBatchRequest(
823
+ path=req.path,
824
+ batch_reference=req.batch_reference,
825
+ )
826
+
562
827
  def upsert_condition_match(
563
828
  self,
564
829
  *,
@@ -568,6 +833,7 @@ class AsyncBatchProcessorBase(ABC):
568
833
  output_conditions: list[identifier_t.IdentifierKey] | None = None,
569
834
  existing_condition_match: identifier_t.IdentifierKey | None = None,
570
835
  depends_on: list[str] | None = None,
836
+ _request_options: client_config_t.RequestOptions | None = None,
571
837
  ) -> async_batch_t.QueuedAsyncBatchRequest:
572
838
  """Creates or updates condition match
573
839
 
@@ -45,6 +45,11 @@ class AsyncBatchRequestPath(StrEnum):
45
45
  UPSERT_CONDITION_MATCH = "condition_parameters/upsert_condition_match"
46
46
  COMPLETE_ASYNC_UPLOAD = "runsheet/complete_async_upload"
47
47
  CREATE_MIX_ORDER = "recipes/create_mix_order"
48
+ PUSH_NOTIFICATION = "integrations/push_notification"
49
+ COMPLETE_ASYNC_PARSE = "uploader/complete_async_parse"
50
+ SET_RECIPE_TOTAL = "recipes/set_recipe_total"
51
+ TRANSITION_ENTITY_PHASE = "entity/transition_entity_phase"
52
+ SET_BARCODE = "entity/set_barcode"
48
53
 
49
54
 
50
55
  # DO NOT MODIFY -- This file is generated by type_spec