alchemy-python 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.
Files changed (172) hide show
  1. alchemy/.fern/metadata.json +18 -0
  2. alchemy/CONTRIBUTING.md +125 -0
  3. alchemy/__init__.py +380 -0
  4. alchemy/_default_clients.py +30 -0
  5. alchemy/auth/__init__.py +4 -0
  6. alchemy/auth/client.py +767 -0
  7. alchemy/auth/raw_client.py +866 -0
  8. alchemy/client.py +717 -0
  9. alchemy/core/__init__.py +127 -0
  10. alchemy/core/api_error.py +23 -0
  11. alchemy/core/client_wrapper.py +155 -0
  12. alchemy/core/datetime_utils.py +70 -0
  13. alchemy/core/file.py +67 -0
  14. alchemy/core/force_multipart.py +18 -0
  15. alchemy/core/http_client.py +940 -0
  16. alchemy/core/http_response.py +63 -0
  17. alchemy/core/http_sse/__init__.py +42 -0
  18. alchemy/core/http_sse/_api.py +455 -0
  19. alchemy/core/http_sse/_decoders.py +74 -0
  20. alchemy/core/http_sse/_exceptions.py +7 -0
  21. alchemy/core/http_sse/_models.py +17 -0
  22. alchemy/core/jsonable_encoder.py +133 -0
  23. alchemy/core/logging.py +107 -0
  24. alchemy/core/oauth_token_provider.py +73 -0
  25. alchemy/core/parse_error.py +36 -0
  26. alchemy/core/pydantic_utilities.py +486 -0
  27. alchemy/core/query_encoder.py +58 -0
  28. alchemy/core/remove_none_from_dict.py +11 -0
  29. alchemy/core/request_options.py +40 -0
  30. alchemy/core/serialization.py +347 -0
  31. alchemy/environment.py +7 -0
  32. alchemy/function/__init__.py +34 -0
  33. alchemy/function/client.py +808 -0
  34. alchemy/function/raw_client.py +903 -0
  35. alchemy/function/version/__init__.py +4 -0
  36. alchemy/function/version/client.py +364 -0
  37. alchemy/function/version/raw_client.py +410 -0
  38. alchemy/host/__init__.py +4 -0
  39. alchemy/host/client.py +227 -0
  40. alchemy/host/raw_client.py +242 -0
  41. alchemy/instance/__init__.py +4 -0
  42. alchemy/instance/client.py +136 -0
  43. alchemy/instance/raw_client.py +141 -0
  44. alchemy/invocation/__init__.py +4 -0
  45. alchemy/invocation/client.py +570 -0
  46. alchemy/invocation/raw_client.py +636 -0
  47. alchemy/member/__init__.py +4 -0
  48. alchemy/member/client.py +441 -0
  49. alchemy/member/raw_client.py +504 -0
  50. alchemy/metrics/__init__.py +4 -0
  51. alchemy/metrics/client.py +428 -0
  52. alchemy/metrics/raw_client.py +478 -0
  53. alchemy/py.typed +0 -0
  54. alchemy/raw_client.py +138 -0
  55. alchemy/reference.md +3300 -0
  56. alchemy/runtime/__init__.py +4 -0
  57. alchemy/runtime/client.py +141 -0
  58. alchemy/runtime/raw_client.py +140 -0
  59. alchemy/service_account/__init__.py +4 -0
  60. alchemy/service_account/client.py +429 -0
  61. alchemy/service_account/raw_client.py +490 -0
  62. alchemy/template/__init__.py +4 -0
  63. alchemy/template/client.py +141 -0
  64. alchemy/template/raw_client.py +140 -0
  65. alchemy/types/__init__.py +344 -0
  66. alchemy/types/auth_v1accept_invite_response.py +5 -0
  67. alchemy/types/auth_v1create_service_account_response.py +34 -0
  68. alchemy/types/auth_v1get_auth_config_request.py +5 -0
  69. alchemy/types/auth_v1get_auth_config_response.py +53 -0
  70. alchemy/types/auth_v1get_session_request.py +9 -0
  71. alchemy/types/auth_v1get_session_response.py +28 -0
  72. alchemy/types/auth_v1get_token_response.py +29 -0
  73. alchemy/types/auth_v1invite_member_response.py +29 -0
  74. alchemy/types/auth_v1list_members_request.py +5 -0
  75. alchemy/types/auth_v1list_members_response.py +34 -0
  76. alchemy/types/auth_v1list_service_accounts_request.py +5 -0
  77. alchemy/types/auth_v1list_service_accounts_response.py +29 -0
  78. alchemy/types/auth_v1login_response.py +5 -0
  79. alchemy/types/auth_v1logout_request.py +8 -0
  80. alchemy/types/auth_v1logout_response.py +5 -0
  81. alchemy/types/auth_v1member.py +31 -0
  82. alchemy/types/auth_v1register_response.py +23 -0
  83. alchemy/types/auth_v1remove_member_response.py +5 -0
  84. alchemy/types/auth_v1remove_service_account_response.py +5 -0
  85. alchemy/types/auth_v1role.py +5 -0
  86. alchemy/types/auth_v1rotate_service_account_secret_response.py +31 -0
  87. alchemy/types/auth_v1service_account.py +35 -0
  88. alchemy/types/auth_v1set_member_role_response.py +5 -0
  89. alchemy/types/connect_error.py +38 -0
  90. alchemy/types/connect_error_code.py +25 -0
  91. alchemy/types/connect_error_details_any.py +36 -0
  92. alchemy/types/connect_protocol_version.py +5 -0
  93. alchemy/types/connect_timeout_header.py +6 -0
  94. alchemy/types/functions_v1arrow_contract.py +50 -0
  95. alchemy/types/functions_v1contract.py +8 -0
  96. alchemy/types/functions_v1contract_arrow.py +20 -0
  97. alchemy/types/functions_v1contract_json_schema.py +26 -0
  98. alchemy/types/functions_v1contract_violation.py +32 -0
  99. alchemy/types/functions_v1create_function_response.py +22 -0
  100. alchemy/types/functions_v1create_function_version_response.py +20 -0
  101. alchemy/types/functions_v1delete_function_response.py +5 -0
  102. alchemy/types/functions_v1function.py +100 -0
  103. alchemy/types/functions_v1function_error.py +30 -0
  104. alchemy/types/functions_v1function_error_kind.py +15 -0
  105. alchemy/types/functions_v1function_spec.py +58 -0
  106. alchemy/types/functions_v1function_version.py +81 -0
  107. alchemy/types/functions_v1function_version_status.py +13 -0
  108. alchemy/types/functions_v1get_function_response.py +20 -0
  109. alchemy/types/functions_v1get_function_version_response.py +20 -0
  110. alchemy/types/functions_v1get_host_request.py +5 -0
  111. alchemy/types/functions_v1get_host_response.py +20 -0
  112. alchemy/types/functions_v1get_invocation_logs_request.py +31 -0
  113. alchemy/types/functions_v1get_invocation_logs_response.py +24 -0
  114. alchemy/types/functions_v1get_invocation_response.py +20 -0
  115. alchemy/types/functions_v1get_version_request.py +5 -0
  116. alchemy/types/functions_v1get_version_response.py +25 -0
  117. alchemy/types/functions_v1host.py +58 -0
  118. alchemy/types/functions_v1instance.py +54 -0
  119. alchemy/types/functions_v1instance_status.py +14 -0
  120. alchemy/types/functions_v1invocation.py +106 -0
  121. alchemy/types/functions_v1invocation_protocol.py +8 -0
  122. alchemy/types/functions_v1invocation_stats.py +41 -0
  123. alchemy/types/functions_v1invocation_status.py +18 -0
  124. alchemy/types/functions_v1invoke_async_response.py +34 -0
  125. alchemy/types/functions_v1invoke_response.py +8 -0
  126. alchemy/types/functions_v1invoke_response_error.py +20 -0
  127. alchemy/types/functions_v1invoke_response_output.py +19 -0
  128. alchemy/types/functions_v1json_schema_contract.py +28 -0
  129. alchemy/types/functions_v1list_function_versions_response.py +22 -0
  130. alchemy/types/functions_v1list_functions_response.py +22 -0
  131. alchemy/types/functions_v1list_hosts_request.py +5 -0
  132. alchemy/types/functions_v1list_hosts_response.py +23 -0
  133. alchemy/types/functions_v1list_instances_response.py +20 -0
  134. alchemy/types/functions_v1list_invocations_response.py +22 -0
  135. alchemy/types/functions_v1list_runtimes_request.py +5 -0
  136. alchemy/types/functions_v1list_runtimes_response.py +22 -0
  137. alchemy/types/functions_v1list_templates_request.py +5 -0
  138. alchemy/types/functions_v1list_templates_response.py +20 -0
  139. alchemy/types/functions_v1network.py +5 -0
  140. alchemy/types/functions_v1pagination_request.py +31 -0
  141. alchemy/types/functions_v1pagination_response.py +33 -0
  142. alchemy/types/functions_v1resources.py +28 -0
  143. alchemy/types/functions_v1runtime.py +59 -0
  144. alchemy/types/functions_v1runtime_starters.py +29 -0
  145. alchemy/types/functions_v1source.py +31 -0
  146. alchemy/types/functions_v1source_file.py +28 -0
  147. alchemy/types/functions_v1source_layer.py +27 -0
  148. alchemy/types/functions_v1source_limits.py +30 -0
  149. alchemy/types/functions_v1start_kind.py +8 -0
  150. alchemy/types/functions_v1tail_invocations_request.py +32 -0
  151. alchemy/types/functions_v1tail_invocations_response.py +34 -0
  152. alchemy/types/functions_v1template.py +94 -0
  153. alchemy/types/functions_v1template_source.py +27 -0
  154. alchemy/types/functions_v1update_function_response.py +20 -0
  155. alchemy/types/google_protobuf_list_value.py +10 -0
  156. alchemy/types/google_protobuf_null_value.py +5 -0
  157. alchemy/types/google_protobuf_struct.py +10 -0
  158. alchemy/types/google_protobuf_value.py +5 -0
  159. alchemy/types/metrics_v1aggregate_row.py +24 -0
  160. alchemy/types/metrics_v1get_queue_response.py +25 -0
  161. alchemy/types/metrics_v1metric.py +16 -0
  162. alchemy/types/metrics_v1metric_dimension.py +14 -0
  163. alchemy/types/metrics_v1metric_filter.py +26 -0
  164. alchemy/types/metrics_v1metric_granularity.py +13 -0
  165. alchemy/types/metrics_v1query_aggregate_response.py +20 -0
  166. alchemy/types/metrics_v1query_timeseries_response.py +20 -0
  167. alchemy/types/metrics_v1timeseries.py +28 -0
  168. alchemy/types/metrics_v1timeseries_point.py +28 -0
  169. alchemy_python-0.1.0.dist-info/METADATA +196 -0
  170. alchemy_python-0.1.0.dist-info/RECORD +172 -0
  171. alchemy_python-0.1.0.dist-info/WHEEL +4 -0
  172. alchemy_python-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,100 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+ from .functions_v1function_version import FunctionsV1FunctionVersion
10
+ from .functions_v1network import FunctionsV1Network
11
+ from .functions_v1resources import FunctionsV1Resources
12
+
13
+
14
+ class FunctionsV1Function(UniversalBaseModel):
15
+ """
16
+ Function is a stable, named handle that callers invoke. It carries no
17
+ behaviour of its own: current_version is the newest version that reached
18
+ READY, and is what Invoke runs unless the caller pins a version. Lifecycle
19
+ stamps are epoch millis; 0 means unset.
20
+ """
21
+
22
+ tenant_id: typing_extensions.Annotated[
23
+ typing.Optional[str], FieldMetadata(alias="tenantId"), pydantic.Field(alias="tenantId")
24
+ ] = None
25
+ id: typing.Optional[str] = None
26
+ name: typing.Optional[str] = None
27
+ description: typing.Optional[str] = None
28
+ current_version: typing_extensions.Annotated[
29
+ typing.Optional[FunctionsV1FunctionVersion],
30
+ FieldMetadata(alias="currentVersion"),
31
+ pydantic.Field(alias="currentVersion"),
32
+ ] = None
33
+ versions: typing.Optional[typing.List[FunctionsV1FunctionVersion]] = None
34
+ created_at: typing_extensions.Annotated[
35
+ typing.Optional[str], FieldMetadata(alias="createdAt"), pydantic.Field(alias="createdAt")
36
+ ] = None
37
+ updated_at: typing_extensions.Annotated[
38
+ typing.Optional[str], FieldMetadata(alias="updatedAt"), pydantic.Field(alias="updatedAt")
39
+ ] = None
40
+ created_by_user_id: typing_extensions.Annotated[
41
+ typing.Optional[str], FieldMetadata(alias="createdByUserId"), pydantic.Field(alias="createdByUserId")
42
+ ] = None
43
+ updated_by_user_id: typing_extensions.Annotated[
44
+ typing.Optional[str], FieldMetadata(alias="updatedByUserId"), pydantic.Field(alias="updatedByUserId")
45
+ ] = None
46
+ timeout_ms: typing_extensions.Annotated[
47
+ typing.Optional[str],
48
+ FieldMetadata(alias="timeoutMs"),
49
+ pydantic.Field(
50
+ alias="timeoutMs",
51
+ description="timeout_ms bounds a single invocation's run time, measured from the\n moment input is handed to the function, whichever version runs.",
52
+ ),
53
+ ] = None
54
+ """
55
+ timeout_ms bounds a single invocation's run time, measured from the
56
+ moment input is handed to the function, whichever version runs.
57
+ """
58
+
59
+ max_concurrency: typing_extensions.Annotated[
60
+ typing.Optional[int],
61
+ FieldMetadata(alias="maxConcurrency"),
62
+ pydantic.Field(
63
+ alias="maxConcurrency",
64
+ description="max_concurrency is how many invocations of the function may run at once\n across every host. Invocations past it wait in the queue. 0 means no\n limit.",
65
+ ),
66
+ ] = None
67
+ """
68
+ max_concurrency is how many invocations of the function may run at once
69
+ across every host. Invocations past it wait in the queue. 0 means no
70
+ limit.
71
+ """
72
+
73
+ resources: typing.Optional[FunctionsV1Resources] = pydantic.Field(default=None)
74
+ """
75
+ resources size the microVM every invocation of any version runs in. A
76
+ change applies to the next invocation; each host snapshots the function
77
+ again at the new size the first time it runs it.
78
+ """
79
+
80
+ retries: typing.Optional[int] = pydantic.Field(default=None)
81
+ """
82
+ retries is how many more times an invocation runs after its function
83
+ raised, crashed or timed out, or the platform could not run it, with
84
+ exponential backoff between attempts. A call may set its own.
85
+ """
86
+
87
+ network: typing.Optional[FunctionsV1Network] = pydantic.Field(default=None)
88
+ """
89
+ network is what the microVM can reach. A change applies to the next
90
+ invocation, as resources do.
91
+ """
92
+
93
+ if IS_PYDANTIC_V2:
94
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
95
+ else:
96
+
97
+ class Config:
98
+ frozen = True
99
+ smart_union = True
100
+ extra = pydantic.Extra.allow
@@ -0,0 +1,30 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .functions_v1contract_violation import FunctionsV1ContractViolation
8
+ from .functions_v1function_error_kind import FunctionsV1FunctionErrorKind
9
+
10
+
11
+ class FunctionsV1FunctionError(UniversalBaseModel):
12
+ """
13
+ FunctionError describes a function that ran and failed. type is the
14
+ function-supplied error type, set for RAISED only; violations is set for
15
+ OUTPUT_INVALID only.
16
+ """
17
+
18
+ kind: typing.Optional[FunctionsV1FunctionErrorKind] = None
19
+ message: typing.Optional[str] = None
20
+ type: typing.Optional[str] = None
21
+ violations: typing.Optional[typing.List[FunctionsV1ContractViolation]] = None
22
+
23
+ if IS_PYDANTIC_V2:
24
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
25
+ else:
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FunctionsV1FunctionErrorKind = typing.Union[
6
+ typing.Literal[
7
+ "FUNCTION_ERROR_KIND_UNSPECIFIED",
8
+ "FUNCTION_ERROR_KIND_RAISED",
9
+ "FUNCTION_ERROR_KIND_CRASHED",
10
+ "FUNCTION_ERROR_KIND_TIMEOUT",
11
+ "FUNCTION_ERROR_KIND_OUTPUT_INVALID",
12
+ "FUNCTION_ERROR_KIND_INPUT_INVALID",
13
+ ],
14
+ typing.Any,
15
+ ]
@@ -0,0 +1,58 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .functions_v1contract import FunctionsV1Contract
8
+ from .functions_v1invocation_protocol import FunctionsV1InvocationProtocol
9
+ from .functions_v1source import FunctionsV1Source
10
+
11
+
12
+ class FunctionsV1FunctionSpec(UniversalBaseModel):
13
+ """
14
+ FunctionSpec is everything needed to build and run one version.
15
+ """
16
+
17
+ image: typing.Optional[str] = pydantic.Field(default=None)
18
+ """
19
+ image is an OCI reference, e.g. ghcr.io/galaxy-io/enrich-company:1.4.0.
20
+ With source set it is the runtime the files land on, such as
21
+ ghcr.io/galaxy-io/alchemy/runtime/python:3.13.
22
+ """
23
+
24
+ command: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
25
+ """
26
+ command is the process to run, as an argv. Empty means the image's own
27
+ Entrypoint + Cmd.
28
+ """
29
+
30
+ env: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
31
+ """
32
+ env is added on top of the image's Env. Not for secrets: the values are
33
+ part of the version and visible wherever it is.
34
+ """
35
+
36
+ secrets: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
37
+ """
38
+ secrets names the tenant's secrets the function receives in its
39
+ environment, variable name to secret name. The values are fetched by
40
+ the host at invocation and never stored with the version.
41
+ """
42
+
43
+ protocol: typing.Optional[FunctionsV1InvocationProtocol] = None
44
+ contract: typing.Optional[FunctionsV1Contract] = None
45
+ source: typing.Optional[FunctionsV1Source] = pydantic.Field(default=None)
46
+ """
47
+ source makes the version a function built from source: files extracted
48
+ over image under /app, where the runtime images look for the handler.
49
+ """
50
+
51
+ if IS_PYDANTIC_V2:
52
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
53
+ else:
54
+
55
+ class Config:
56
+ frozen = True
57
+ smart_union = True
58
+ extra = pydantic.Extra.allow
@@ -0,0 +1,81 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+ from .functions_v1function_spec import FunctionsV1FunctionSpec
10
+ from .functions_v1function_version_status import FunctionsV1FunctionVersionStatus
11
+
12
+
13
+ class FunctionsV1FunctionVersion(UniversalBaseModel):
14
+ """
15
+ FunctionVersion is an immutable, buildable version of a function. The
16
+ contract is part of the version, so it never changes underneath a caller
17
+ that pins one. version increases monotonically per function. Lifecycle
18
+ stamps are epoch millis; 0 means unset.
19
+ """
20
+
21
+ id: typing.Optional[str] = None
22
+ version: typing.Optional[str] = None
23
+ created_at: typing_extensions.Annotated[
24
+ typing.Optional[str], FieldMetadata(alias="createdAt"), pydantic.Field(alias="createdAt")
25
+ ] = None
26
+ spec: typing.Optional[FunctionsV1FunctionSpec] = None
27
+ status: typing.Optional[FunctionsV1FunctionVersionStatus] = None
28
+ status_message: typing_extensions.Annotated[
29
+ typing.Optional[str], FieldMetadata(alias="statusMessage"), pydantic.Field(alias="statusMessage")
30
+ ] = None
31
+ image_digest: typing_extensions.Annotated[
32
+ typing.Optional[str],
33
+ FieldMetadata(alias="imageDigest"),
34
+ pydantic.Field(
35
+ alias="imageDigest",
36
+ description="image_digest is the content digest (sha256:...) spec.image resolved to at\n build time. The version always runs this digest, even if the tag moves.",
37
+ ),
38
+ ] = None
39
+ """
40
+ image_digest is the content digest (sha256:...) spec.image resolved to at
41
+ build time. The version always runs this digest, even if the tag moves.
42
+ """
43
+
44
+ build_started_at: typing_extensions.Annotated[
45
+ typing.Optional[str], FieldMetadata(alias="buildStartedAt"), pydantic.Field(alias="buildStartedAt")
46
+ ] = None
47
+ build_ended_at: typing_extensions.Annotated[
48
+ typing.Optional[str], FieldMetadata(alias="buildEndedAt"), pydantic.Field(alias="buildEndedAt")
49
+ ] = None
50
+ rootfs_bytes: typing_extensions.Annotated[
51
+ typing.Optional[str],
52
+ FieldMetadata(alias="rootfsBytes"),
53
+ pydantic.Field(alias="rootfsBytes", description="rootfs_bytes is the size of the built root filesystem image."),
54
+ ] = None
55
+ """
56
+ rootfs_bytes is the size of the built root filesystem image.
57
+ """
58
+
59
+ build_log: typing_extensions.Annotated[
60
+ typing.Optional[str],
61
+ FieldMetadata(alias="buildLog"),
62
+ pydantic.Field(
63
+ alias="buildLog", description="build_log is the tail of the build's output, for FAILED versions mostly."
64
+ ),
65
+ ] = None
66
+ """
67
+ build_log is the tail of the build's output, for FAILED versions mostly.
68
+ """
69
+
70
+ created_by_user_id: typing_extensions.Annotated[
71
+ typing.Optional[str], FieldMetadata(alias="createdByUserId"), pydantic.Field(alias="createdByUserId")
72
+ ] = None
73
+
74
+ if IS_PYDANTIC_V2:
75
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
76
+ else:
77
+
78
+ class Config:
79
+ frozen = True
80
+ smart_union = True
81
+ extra = pydantic.Extra.allow
@@ -0,0 +1,13 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FunctionsV1FunctionVersionStatus = typing.Union[
6
+ typing.Literal[
7
+ "FUNCTION_VERSION_STATUS_UNSPECIFIED",
8
+ "FUNCTION_VERSION_STATUS_BUILDING",
9
+ "FUNCTION_VERSION_STATUS_READY",
10
+ "FUNCTION_VERSION_STATUS_FAILED",
11
+ ],
12
+ typing.Any,
13
+ ]
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .functions_v1function import FunctionsV1Function
8
+
9
+
10
+ class FunctionsV1GetFunctionResponse(UniversalBaseModel):
11
+ function: typing.Optional[FunctionsV1Function] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .functions_v1function_version import FunctionsV1FunctionVersion
8
+
9
+
10
+ class FunctionsV1GetFunctionVersionResponse(UniversalBaseModel):
11
+ version: typing.Optional[FunctionsV1FunctionVersion] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FunctionsV1GetHostRequest = typing.Dict[str, typing.Any]
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .functions_v1host import FunctionsV1Host
8
+
9
+
10
+ class FunctionsV1GetHostResponse(UniversalBaseModel):
11
+ host: typing.Optional[FunctionsV1Host] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,31 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class FunctionsV1GetInvocationLogsRequest(UniversalBaseModel):
10
+ """
11
+ GetInvocationLogs streams what an invocation's function wrote to stderr.
12
+ With follow, the stream stays open while the invocation runs and ends when
13
+ it does; without, it ends at what has been written so far.
14
+ """
15
+
16
+ id: typing.Optional[str] = None
17
+ follow: typing.Optional[bool] = None
18
+ attempt: typing.Optional[int] = pydantic.Field(default=None)
19
+ """
20
+ attempt picks one attempt of the invocation, counting from 1. 0 is the
21
+ latest.
22
+ """
23
+
24
+ if IS_PYDANTIC_V2:
25
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
26
+ else:
27
+
28
+ class Config:
29
+ frozen = True
30
+ smart_union = True
31
+ extra = pydantic.Extra.allow
@@ -0,0 +1,24 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class FunctionsV1GetInvocationLogsResponse(UniversalBaseModel):
10
+ """
11
+ GetInvocationLogsResponse is the next piece of the log, in order. Pieces
12
+ are not split on line boundaries.
13
+ """
14
+
15
+ data: typing.Optional[str] = None
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
19
+ else:
20
+
21
+ class Config:
22
+ frozen = True
23
+ smart_union = True
24
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .functions_v1invocation import FunctionsV1Invocation
8
+
9
+
10
+ class FunctionsV1GetInvocationResponse(UniversalBaseModel):
11
+ invocation: typing.Optional[FunctionsV1Invocation] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FunctionsV1GetVersionRequest = typing.Dict[str, typing.Any]
@@ -0,0 +1,25 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class FunctionsV1GetVersionResponse(UniversalBaseModel):
10
+ """
11
+ GetVersionResponse is the build the server runs.
12
+ """
13
+
14
+ version: typing.Optional[str] = None
15
+ commit: typing.Optional[str] = None
16
+ date: typing.Optional[str] = None
17
+
18
+ if IS_PYDANTIC_V2:
19
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
20
+ else:
21
+
22
+ class Config:
23
+ frozen = True
24
+ smart_union = True
25
+ extra = pydantic.Extra.allow
@@ -0,0 +1,58 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+
10
+
11
+ class FunctionsV1Host(UniversalBaseModel):
12
+ """
13
+ Host describes one host process and the machine it runs on.
14
+ """
15
+
16
+ hostname: typing.Optional[str] = None
17
+ started_at: typing_extensions.Annotated[
18
+ typing.Optional[str], FieldMetadata(alias="startedAt"), pydantic.Field(alias="startedAt")
19
+ ] = None
20
+ slots: typing.Optional[int] = pydantic.Field(default=None)
21
+ """
22
+ slots is how many invocations may hold a instance at once; slots_in_use
23
+ is how many do right now.
24
+ """
25
+
26
+ slots_in_use: typing_extensions.Annotated[
27
+ typing.Optional[int], FieldMetadata(alias="slotsInUse"), pydantic.Field(alias="slotsInUse")
28
+ ] = None
29
+ memory_mib_committed: typing_extensions.Annotated[
30
+ typing.Optional[str],
31
+ FieldMetadata(alias="memoryMibCommitted"),
32
+ pydantic.Field(
33
+ alias="memoryMibCommitted", description="memory_mib_committed is the guest memory of all live instances."
34
+ ),
35
+ ] = None
36
+ """
37
+ memory_mib_committed is the guest memory of all live instances.
38
+ """
39
+
40
+ firecracker_version: typing_extensions.Annotated[
41
+ typing.Optional[str], FieldMetadata(alias="firecrackerVersion"), pydantic.Field(alias="firecrackerVersion")
42
+ ] = None
43
+ kernel: typing.Optional[str] = None
44
+ rootfs_cache_bytes: typing_extensions.Annotated[
45
+ typing.Optional[str], FieldMetadata(alias="rootfsCacheBytes"), pydantic.Field(alias="rootfsCacheBytes")
46
+ ] = None
47
+ rootfs_cache_images: typing_extensions.Annotated[
48
+ typing.Optional[int], FieldMetadata(alias="rootfsCacheImages"), pydantic.Field(alias="rootfsCacheImages")
49
+ ] = None
50
+
51
+ if IS_PYDANTIC_V2:
52
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
53
+ else:
54
+
55
+ class Config:
56
+ frozen = True
57
+ smart_union = True
58
+ extra = pydantic.Extra.allow
@@ -0,0 +1,54 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+ from .functions_v1instance_status import FunctionsV1InstanceStatus
10
+ from .functions_v1start_kind import FunctionsV1StartKind
11
+
12
+
13
+ class FunctionsV1Instance(UniversalBaseModel):
14
+ """
15
+ Instance is one microVM on a host. A host knows the artifact it runs;
16
+ the server fills in function_id and version from the artifact.
17
+ invocation_id is set while BUSY.
18
+ """
19
+
20
+ id: typing.Optional[str] = None
21
+ function_id: typing_extensions.Annotated[
22
+ typing.Optional[str], FieldMetadata(alias="functionId"), pydantic.Field(alias="functionId")
23
+ ] = None
24
+ version: typing.Optional[str] = None
25
+ status: typing.Optional[FunctionsV1InstanceStatus] = None
26
+ start_kind: typing_extensions.Annotated[
27
+ typing.Optional[FunctionsV1StartKind], FieldMetadata(alias="startKind"), pydantic.Field(alias="startKind")
28
+ ] = None
29
+ started_at: typing_extensions.Annotated[
30
+ typing.Optional[str], FieldMetadata(alias="startedAt"), pydantic.Field(alias="startedAt")
31
+ ] = None
32
+ invocation_id: typing_extensions.Annotated[
33
+ typing.Optional[str], FieldMetadata(alias="invocationId"), pydantic.Field(alias="invocationId")
34
+ ] = None
35
+ vcpus: typing.Optional[int] = None
36
+ memory_mib: typing_extensions.Annotated[
37
+ typing.Optional[int], FieldMetadata(alias="memoryMib"), pydantic.Field(alias="memoryMib")
38
+ ] = None
39
+ artifact_id: typing_extensions.Annotated[
40
+ typing.Optional[str], FieldMetadata(alias="artifactId"), pydantic.Field(alias="artifactId")
41
+ ] = None
42
+ host: typing.Optional[str] = None
43
+ tenant_id: typing_extensions.Annotated[
44
+ typing.Optional[str], FieldMetadata(alias="tenantId"), pydantic.Field(alias="tenantId")
45
+ ] = None
46
+
47
+ if IS_PYDANTIC_V2:
48
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
49
+ else:
50
+
51
+ class Config:
52
+ frozen = True
53
+ smart_union = True
54
+ extra = pydantic.Extra.allow
@@ -0,0 +1,14 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FunctionsV1InstanceStatus = typing.Union[
6
+ typing.Literal[
7
+ "INSTANCE_STATUS_UNSPECIFIED",
8
+ "INSTANCE_STATUS_BOOTING",
9
+ "INSTANCE_STATUS_READY",
10
+ "INSTANCE_STATUS_BUSY",
11
+ "INSTANCE_STATUS_RELEASING",
12
+ ],
13
+ typing.Any,
14
+ ]