@distilled.cloud/clickhouse-cloud 0.0.0 → 1.0.0-rc.22

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 (183) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +134 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +34 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +58 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +49 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +10 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +35 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/api_keys.d.ts +175 -0
  26. package/lib/services/api_keys.d.ts.map +1 -0
  27. package/lib/services/api_keys.js +2 -0
  28. package/lib/services/api_keys.js.map +1 -0
  29. package/lib/services/backup.d.ts +117 -0
  30. package/lib/services/backup.d.ts.map +1 -0
  31. package/lib/services/backup.js +2 -0
  32. package/lib/services/backup.js.map +1 -0
  33. package/lib/services/billing.d.ts +69 -0
  34. package/lib/services/billing.d.ts.map +1 -0
  35. package/lib/services/billing.js +2 -0
  36. package/lib/services/billing.js.map +1 -0
  37. package/lib/services/click_pipes.d.ts +1637 -0
  38. package/lib/services/click_pipes.d.ts.map +1 -0
  39. package/lib/services/click_pipes.js +31 -0
  40. package/lib/services/click_pipes.js.map +1 -0
  41. package/lib/services/index.d.ts +14 -0
  42. package/lib/services/index.d.ts.map +1 -0
  43. package/lib/services/index.js +13 -0
  44. package/lib/services/organization.d.ts +336 -0
  45. package/lib/services/organization.d.ts.map +1 -0
  46. package/lib/services/organization.js +2 -0
  47. package/lib/services/organization.js.map +1 -0
  48. package/lib/services/postgres.d.ts +726 -0
  49. package/lib/services/postgres.d.ts.map +1 -0
  50. package/lib/services/postgres.js +31 -0
  51. package/lib/services/postgres.js.map +1 -0
  52. package/lib/services/prometheus.d.ts +71 -0
  53. package/lib/services/prometheus.d.ts.map +1 -0
  54. package/lib/services/prometheus.js +2 -0
  55. package/lib/services/prometheus.js.map +1 -0
  56. package/lib/services/query_api_endpoints.d.ts +189 -0
  57. package/lib/services/query_api_endpoints.d.ts.map +1 -0
  58. package/lib/services/query_api_endpoints.js +2 -0
  59. package/lib/services/query_api_endpoints.js.map +1 -0
  60. package/lib/services/role_management.d.ts +159 -0
  61. package/lib/services/role_management.d.ts.map +1 -0
  62. package/lib/services/role_management.js +2 -0
  63. package/lib/services/role_management.js.map +1 -0
  64. package/lib/services/saved_queries.d.ts +129 -0
  65. package/lib/services/saved_queries.d.ts.map +1 -0
  66. package/lib/services/saved_queries.js +2 -0
  67. package/lib/services/saved_queries.js.map +1 -0
  68. package/lib/services/service.d.ts +886 -0
  69. package/lib/services/service.d.ts.map +1 -0
  70. package/lib/services/service.js +41 -0
  71. package/lib/services/service.js.map +1 -0
  72. package/lib/services/udf.d.ts +373 -0
  73. package/lib/services/udf.d.ts.map +1 -0
  74. package/lib/services/udf.js +24 -0
  75. package/lib/services/udf.js.map +1 -0
  76. package/lib/services/user_management.d.ts +150 -0
  77. package/lib/services/user_management.d.ts.map +1 -0
  78. package/lib/services/user_management.js +2 -0
  79. package/lib/services/user_management.js.map +1 -0
  80. package/lib/services.lazy/api_keys.js +1 -0
  81. package/lib/services.lazy/backup.js +1 -0
  82. package/lib/services.lazy/billing.js +1 -0
  83. package/lib/services.lazy/click_pipes.js +3 -0
  84. package/lib/services.lazy/index.js +3 -0
  85. package/lib/services.lazy/organization.js +1 -0
  86. package/lib/services.lazy/postgres.js +4 -0
  87. package/lib/services.lazy/prometheus.js +1 -0
  88. package/lib/services.lazy/query_api_endpoints.js +1 -0
  89. package/lib/services.lazy/role_management.js +1 -0
  90. package/lib/services.lazy/saved_queries.js +1 -0
  91. package/lib/services.lazy/service.js +4 -0
  92. package/lib/services.lazy/udf.js +3 -0
  93. package/lib/services.lazy/user_management.js +1 -0
  94. package/lib/traits.d.ts +11 -0
  95. package/lib/traits.d.ts.map +1 -0
  96. package/lib/traits.js +1 -0
  97. package/lib/unstable-services/backup.d.ts +165 -0
  98. package/lib/unstable-services/backup.d.ts.map +1 -0
  99. package/lib/unstable-services/backup.js +2 -0
  100. package/lib/unstable-services/backup.js.map +1 -0
  101. package/lib/unstable-services/billing.d.ts +84 -0
  102. package/lib/unstable-services/billing.d.ts.map +1 -0
  103. package/lib/unstable-services/billing.js +2 -0
  104. package/lib/unstable-services/billing.js.map +1 -0
  105. package/lib/unstable-services/click_pipes.d.ts +324 -0
  106. package/lib/unstable-services/click_pipes.d.ts.map +1 -0
  107. package/lib/unstable-services/click_pipes.js +2 -0
  108. package/lib/unstable-services/click_pipes.js.map +1 -0
  109. package/lib/unstable-services/click_stack.d.ts +3538 -0
  110. package/lib/unstable-services/click_stack.d.ts.map +1 -0
  111. package/lib/unstable-services/click_stack.js +60 -0
  112. package/lib/unstable-services/click_stack.js.map +1 -0
  113. package/lib/unstable-services/index.d.ts +11 -0
  114. package/lib/unstable-services/index.d.ts.map +1 -0
  115. package/lib/unstable-services/index.js +10 -0
  116. package/lib/unstable-services/notifications.d.ts +166 -0
  117. package/lib/unstable-services/notifications.d.ts.map +1 -0
  118. package/lib/unstable-services/notifications.js +2 -0
  119. package/lib/unstable-services/notifications.js.map +1 -0
  120. package/lib/unstable-services/organization.d.ts +403 -0
  121. package/lib/unstable-services/organization.d.ts.map +1 -0
  122. package/lib/unstable-services/organization.js +26 -0
  123. package/lib/unstable-services/organization.js.map +1 -0
  124. package/lib/unstable-services/postgres.d.ts +415 -0
  125. package/lib/unstable-services/postgres.d.ts.map +1 -0
  126. package/lib/unstable-services/postgres.js +2 -0
  127. package/lib/unstable-services/postgres.js.map +1 -0
  128. package/lib/unstable-services/service.d.ts +244 -0
  129. package/lib/unstable-services/service.d.ts.map +1 -0
  130. package/lib/unstable-services/service.js +2 -0
  131. package/lib/unstable-services/service.js.map +1 -0
  132. package/lib/unstable-services/snapshot.d.ts +146 -0
  133. package/lib/unstable-services/snapshot.d.ts.map +1 -0
  134. package/lib/unstable-services/snapshot.js +2 -0
  135. package/lib/unstable-services/snapshot.js.map +1 -0
  136. package/lib/unstable-services/user_management.d.ts +41 -0
  137. package/lib/unstable-services/user_management.d.ts.map +1 -0
  138. package/lib/unstable-services/user_management.js +2 -0
  139. package/lib/unstable-services/user_management.js.map +1 -0
  140. package/lib/unstable-services.lazy/backup.js +1 -0
  141. package/lib/unstable-services.lazy/billing.js +1 -0
  142. package/lib/unstable-services.lazy/click_pipes.js +1 -0
  143. package/lib/unstable-services.lazy/click_stack.js +4 -0
  144. package/lib/unstable-services.lazy/index.js +3 -0
  145. package/lib/unstable-services.lazy/notifications.js +1 -0
  146. package/lib/unstable-services.lazy/organization.js +4 -0
  147. package/lib/unstable-services.lazy/postgres.js +1 -0
  148. package/lib/unstable-services.lazy/service.js +1 -0
  149. package/lib/unstable-services.lazy/snapshot.js +1 -0
  150. package/lib/unstable-services.lazy/user_management.js +1 -0
  151. package/package.json +89 -2
  152. package/src/credentials.ts +88 -0
  153. package/src/errors.ts +76 -0
  154. package/src/index.ts +53 -0
  155. package/src/pagination.ts +9 -0
  156. package/src/protocol.ts +76 -0
  157. package/src/retry.ts +53 -0
  158. package/src/services/api_keys.ts +466 -0
  159. package/src/services/backup.ts +347 -0
  160. package/src/services/billing.ts +170 -0
  161. package/src/services/click_pipes.ts +3483 -0
  162. package/src/services/index.ts +14 -0
  163. package/src/services/organization.ts +901 -0
  164. package/src/services/postgres.ts +1967 -0
  165. package/src/services/prometheus.ts +271 -0
  166. package/src/services/query_api_endpoints.ts +466 -0
  167. package/src/services/role_management.ts +436 -0
  168. package/src/services/saved_queries.ts +384 -0
  169. package/src/services/service.ts +2112 -0
  170. package/src/services/udf.ts +1019 -0
  171. package/src/services/user_management.ts +508 -0
  172. package/src/traits.ts +45 -0
  173. package/src/unstable-services/backup.ts +422 -0
  174. package/src/unstable-services/billing.ts +232 -0
  175. package/src/unstable-services/click_pipes.ts +702 -0
  176. package/src/unstable-services/click_stack.ts +7114 -0
  177. package/src/unstable-services/index.ts +11 -0
  178. package/src/unstable-services/notifications.ts +451 -0
  179. package/src/unstable-services/organization.ts +1107 -0
  180. package/src/unstable-services/postgres.ts +1061 -0
  181. package/src/unstable-services/service.ts +795 -0
  182. package/src/unstable-services/snapshot.ts +397 -0
  183. package/src/unstable-services/user_management.ts +127 -0
@@ -0,0 +1,1019 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-clickhouse-cloud/specs/openapi.json). Do not edit.
3
+ import * as S from "@distilled.cloud/core/schema-lite";
4
+ import * as __L from "@distilled.cloud/core/schema-lite";
5
+ import { ClickHouseCloudServiceErrors } from "../errors.ts";
6
+ import { paginateCursor } from "../pagination.ts";
7
+ import {
8
+ ClickHouseCloudProtocol,
9
+ ClickHouseCloudPaginatedProtocol,
10
+ type ClickHouseCloudOpError,
11
+ type ClickHouseCloudOpContext,
12
+ } from "../protocol.ts";
13
+ import * as Retry from "../retry.ts";
14
+ import * as T from "../traits.ts";
15
+ // Schema table, filled on first reach (see __S at the end).
16
+ const __s: any[] = [];
17
+
18
+ export type { ClickHouseCloudOpError, ClickHouseCloudOpContext };
19
+
20
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
21
+ const TELEMETRY = {
22
+ system: "clickhouse-cloud-api",
23
+ responseHeaders: [
24
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
25
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
26
+ ],
27
+ prefix: "ClickhouseCloud",
28
+ service: "Udfs",
29
+ labels: "clickhouse_cloud",
30
+ propagate: "w3c",
31
+ } as const;
32
+
33
+ export interface AttachUdfRequest {
34
+ /** ID of the requested organization. */
35
+ organizationId: string;
36
+ /** Name of the UDF. */
37
+ functionName: string;
38
+ /** ID of the requested service. */
39
+ serviceId: string;
40
+ /** Version to attach. When omitted, the latest ready version is attached. */
41
+ version?: number | undefined;
42
+ }
43
+ /** Current attachment lifecycle state. */
44
+ export type UdfAttachmentStatus =
45
+ | "deployed"
46
+ | "deprovisioning"
47
+ | "error"
48
+ | "provisioning"
49
+ | "standby";
50
+ export interface UdfAttachment {
51
+ /** Name of the UDF. */
52
+ functionName: string;
53
+ /** ID of the attached service. */
54
+ serviceId: string;
55
+ /** Current attachment lifecycle state. */
56
+ status: UdfAttachmentStatus;
57
+ /** Attached UDF version. */
58
+ version: number;
59
+ }
60
+ export type ExecutableUdfCreateRequestRuntime = "python3.11" | "native";
61
+ export interface UdfArgument {
62
+ /** Name of the argument. Required for Native and JSONEachRow formats. */
63
+ name: string;
64
+ /** ClickHouse data type of the argument. */
65
+ type: string;
66
+ }
67
+ export type ExecutableUdfCreateRequestArgumentsList = Array<UdfArgument>;
68
+ export type ExecutableUdfCreateRequestSandboxType = "basic" | "netenable";
69
+ export interface ExecutableUdfCreateRequest {
70
+ /** Identifier of the uploaded source archive. */
71
+ uploadId: string;
72
+ runtime: ExecutableUdfCreateRequestRuntime | (string & {});
73
+ arguments: ExecutableUdfCreateRequestArgumentsList;
74
+ returnType: string;
75
+ returnName?: string | null | undefined;
76
+ commandReadTimeout?: number | undefined;
77
+ commandWriteTimeout?: number | undefined;
78
+ memoryLimitMib?: number | null | undefined;
79
+ sendChunkHeader?: boolean | undefined;
80
+ /** Marks the UDF as deterministic so ClickHouse can reuse cached query results. Only set this when the UDF always returns the same result for the same arguments. */
81
+ deterministic?: boolean | undefined;
82
+ format?: string | undefined;
83
+ sandboxType?: ExecutableUdfCreateRequestSandboxType | (string & {}) | undefined;
84
+ type: string;
85
+ /** Always null -- an executable UDF has no command pool. */
86
+ poolSize?: unknown | null | undefined;
87
+ maxCommandExecutionTime?: number | null | undefined;
88
+ functionName: string;
89
+ }
90
+ export type ExecutablePoolUdfCreateRequestRuntime = "python3.11" | "native";
91
+ export type ExecutablePoolUdfCreateRequestArgumentsList = Array<UdfArgument>;
92
+ export type ExecutablePoolUdfCreateRequestSandboxType = "basic" | "netenable";
93
+ export interface ExecutablePoolUdfCreateRequest {
94
+ /** Identifier of the uploaded source archive. */
95
+ uploadId: string;
96
+ runtime: ExecutablePoolUdfCreateRequestRuntime | (string & {});
97
+ arguments: ExecutablePoolUdfCreateRequestArgumentsList;
98
+ returnType: string;
99
+ returnName?: string | null | undefined;
100
+ commandReadTimeout?: number | undefined;
101
+ commandWriteTimeout?: number | undefined;
102
+ memoryLimitMib?: number | null | undefined;
103
+ sendChunkHeader?: boolean | undefined;
104
+ /** Marks the UDF as deterministic so ClickHouse can reuse cached query results. Only set this when the UDF always returns the same result for the same arguments. */
105
+ deterministic?: boolean | undefined;
106
+ format?: string | undefined;
107
+ sandboxType?: ExecutablePoolUdfCreateRequestSandboxType | (string & {}) | undefined;
108
+ type: string;
109
+ poolSize?: number | undefined;
110
+ maxCommandExecutionTime?: number | undefined;
111
+ functionName: string;
112
+ }
113
+ export type UdfCreateRequest = ExecutableUdfCreateRequest | ExecutablePoolUdfCreateRequest;
114
+ export interface CreateUdfRequest {
115
+ /** ID of the requested organization. */
116
+ organizationId: string;
117
+ body?: UdfCreateRequest | undefined;
118
+ }
119
+ /** Build state of this UDF version. */
120
+ export type UdfStatus = "building" | "error" | "ready";
121
+ /** Runtime used to execute the UDF command. */
122
+ export type UdfRuntime = "python3.11" | "native";
123
+ /** Executable UDF type. */
124
+ export type UdfType = "executable" | "executable_pool";
125
+ export type UdfArgumentOutput = UdfArgument;
126
+ /** Arguments passed to the UDF command. */
127
+ export type UdfArgumentsList = Array<UdfArgument>;
128
+ /** Sandbox isolation level. */
129
+ export type UdfSandboxType = "basic" | "netenable";
130
+ /** Sandbox runtime version. */
131
+ export type UdfSandboxVersion = "v1" | "v2" | "v3";
132
+ export interface Udf {
133
+ /** Name of the UDF. Unique within the organization. */
134
+ functionName: string;
135
+ /** Version number of the UDF. */
136
+ version: number;
137
+ /** Build state of this UDF version. */
138
+ status: UdfStatus;
139
+ /** Runtime used to execute the UDF command. */
140
+ runtime: UdfRuntime;
141
+ /** Executable UDF type. */
142
+ type: UdfType;
143
+ /** Arguments passed to the UDF command. */
144
+ arguments: UdfArgumentsList;
145
+ /** ClickHouse data type of the returned value. */
146
+ returnType: string;
147
+ /** Name of the returned value, or null when unnamed. */
148
+ returnName: string | null;
149
+ /** Command pool size for executable_pool UDFs. */
150
+ poolSize: number | null;
151
+ /** Command stdout read timeout in milliseconds. */
152
+ commandReadTimeout: number;
153
+ /** Command stdin write timeout in milliseconds. */
154
+ commandWriteTimeout: number;
155
+ /** Maximum command execution time in seconds for executable_pool UDFs. */
156
+ maxCommandExecutionTime: number | null;
157
+ /** Maximum memory, in MiB, available to each UDF sandbox process. Null uses the sandbox default. */
158
+ memoryLimitMib: number | null;
159
+ /** Whether ClickHouse sends a row-count chunk header. */
160
+ sendChunkHeader: boolean;
161
+ /** Whether ClickHouse may reuse cached query results for this UDF. */
162
+ deterministic: boolean;
163
+ /** Input and output format used by the UDF command. */
164
+ format: string;
165
+ /** Sandbox isolation level. */
166
+ sandboxType: UdfSandboxType;
167
+ /** Sandbox runtime version. */
168
+ sandboxVersion: UdfSandboxVersion;
169
+ /** Build error, or null when no build error is present. */
170
+ error: string | null;
171
+ /** Creation timestamp. */
172
+ createdAt: string;
173
+ /** Last-update timestamp. */
174
+ updatedAt: string;
175
+ }
176
+ export interface CreateUdfUploadUrlRequest {
177
+ /** ID of the requested organization. */
178
+ organizationId: string;
179
+ }
180
+ export interface UdfUploadSession {
181
+ /** Identifier of the uploaded source archive. */
182
+ uploadId: string;
183
+ /** Presigned URL for uploading the source archive. */
184
+ uploadUrl: string;
185
+ /** Presigned-URL expiry timestamp. */
186
+ expiresAt: string;
187
+ }
188
+ export type ExecutableUdfVersionCreateRequestRuntime = "python3.11" | "native";
189
+ export type ExecutableUdfVersionCreateRequestArgumentsList = Array<UdfArgument>;
190
+ export type ExecutableUdfVersionCreateRequestSandboxType = "basic" | "netenable";
191
+ export interface ExecutableUdfVersionCreateRequest {
192
+ /** Identifier of the uploaded source archive. */
193
+ uploadId: string;
194
+ runtime: ExecutableUdfVersionCreateRequestRuntime | (string & {});
195
+ arguments: ExecutableUdfVersionCreateRequestArgumentsList;
196
+ returnType: string;
197
+ returnName?: string | null | undefined;
198
+ commandReadTimeout?: number | undefined;
199
+ commandWriteTimeout?: number | undefined;
200
+ memoryLimitMib?: number | null | undefined;
201
+ sendChunkHeader?: boolean | undefined;
202
+ /** Marks the UDF as deterministic so ClickHouse can reuse cached query results. Only set this when the UDF always returns the same result for the same arguments. */
203
+ deterministic?: boolean | undefined;
204
+ format?: string | undefined;
205
+ sandboxType?: ExecutableUdfVersionCreateRequestSandboxType | (string & {}) | undefined;
206
+ type: string;
207
+ /** Always null -- an executable UDF has no command pool. */
208
+ poolSize?: unknown | null | undefined;
209
+ maxCommandExecutionTime?: number | null | undefined;
210
+ }
211
+ export type ExecutablePoolUdfVersionCreateRequestRuntime = "python3.11" | "native";
212
+ export type ExecutablePoolUdfVersionCreateRequestArgumentsList = Array<UdfArgument>;
213
+ export type ExecutablePoolUdfVersionCreateRequestSandboxType = "basic" | "netenable";
214
+ export interface ExecutablePoolUdfVersionCreateRequest {
215
+ /** Identifier of the uploaded source archive. */
216
+ uploadId: string;
217
+ runtime: ExecutablePoolUdfVersionCreateRequestRuntime | (string & {});
218
+ arguments: ExecutablePoolUdfVersionCreateRequestArgumentsList;
219
+ returnType: string;
220
+ returnName?: string | null | undefined;
221
+ commandReadTimeout?: number | undefined;
222
+ commandWriteTimeout?: number | undefined;
223
+ memoryLimitMib?: number | null | undefined;
224
+ sendChunkHeader?: boolean | undefined;
225
+ /** Marks the UDF as deterministic so ClickHouse can reuse cached query results. Only set this when the UDF always returns the same result for the same arguments. */
226
+ deterministic?: boolean | undefined;
227
+ format?: string | undefined;
228
+ sandboxType?: ExecutablePoolUdfVersionCreateRequestSandboxType | (string & {}) | undefined;
229
+ type: string;
230
+ poolSize?: number | undefined;
231
+ maxCommandExecutionTime?: number | undefined;
232
+ }
233
+ export type UdfVersionCreateRequest =
234
+ | ExecutableUdfVersionCreateRequest
235
+ | ExecutablePoolUdfVersionCreateRequest;
236
+ export interface CreateUdfVersionRequest {
237
+ /** ID of the requested organization. */
238
+ organizationId: string;
239
+ /** Name of the UDF. */
240
+ functionName: string;
241
+ body?: UdfVersionCreateRequest | undefined;
242
+ }
243
+ export interface DeleteUdfRequest {
244
+ /** ID of the requested organization. */
245
+ organizationId: string;
246
+ /** Name of the UDF. */
247
+ functionName: string;
248
+ }
249
+ export interface DeleteUdfResponse {
250
+ /** HTTP status code. */
251
+ status: number;
252
+ /** Unique id assigned to every request. UUIDv4 */
253
+ requestId: string;
254
+ }
255
+ export interface DeleteUdfVersionRequest {
256
+ /** ID of the requested organization. */
257
+ organizationId: string;
258
+ /** Name of the UDF. */
259
+ functionName: string;
260
+ /** Version number of the UDF. */
261
+ version: number;
262
+ }
263
+ export interface DeleteUdfVersionResponse {
264
+ /** HTTP status code. */
265
+ status: number;
266
+ /** Unique id assigned to every request. UUIDv4 */
267
+ requestId: string;
268
+ }
269
+ export interface DetachUdfRequest {
270
+ /** ID of the requested organization. */
271
+ organizationId: string;
272
+ /** Name of the UDF. */
273
+ functionName: string;
274
+ /** ID of the requested service. */
275
+ serviceId: string;
276
+ }
277
+ export interface DetachUdfResponse {
278
+ /** HTTP status code. */
279
+ status: number;
280
+ /** Unique id assigned to every request. UUIDv4 */
281
+ requestId: string;
282
+ }
283
+ export interface GetUdfRequest {
284
+ /** ID of the requested organization. */
285
+ organizationId: string;
286
+ /** Name of the UDF. */
287
+ functionName: string;
288
+ }
289
+ export interface GetUdfAttachmentRequest {
290
+ /** ID of the requested organization. */
291
+ organizationId: string;
292
+ /** Name of the UDF. */
293
+ functionName: string;
294
+ /** ID of the requested service. */
295
+ serviceId: string;
296
+ }
297
+ export interface ListUdfAttachmentsRequest {
298
+ /** ID of the requested organization. */
299
+ organizationId: string;
300
+ /** Name of the UDF. */
301
+ functionName: string;
302
+ /** Cursor returned as `nextCursor` on the previous page. */
303
+ cursor?: string | undefined;
304
+ /** Maximum number of records to return per page. Defaults to 100. Maximum is 100. */
305
+ limit?: number | undefined;
306
+ }
307
+ /** Current service attachments for the UDF in this page. */
308
+ export type ListUdfAttachmentsResponseResultList = Array<UdfAttachment>;
309
+ export interface ListUdfAttachmentsResponse {
310
+ /** Current service attachments for the UDF in this page. */
311
+ result: ListUdfAttachmentsResponseResultList;
312
+ /** Maximum number of results returned in this page. */
313
+ limit: number;
314
+ /** Total number of results across all pages. It has only informative value, thus is not guaranteed and it is provided on a best-effort basis. Null if the total count is unknown. */
315
+ totalCount: number | null;
316
+ /** Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page. */
317
+ nextCursor: string | null;
318
+ /** HTTP status code. */
319
+ status: number;
320
+ /** Unique id assigned to every request. UUIDv4 */
321
+ requestId: string;
322
+ }
323
+ export interface ListUdfsRequest {
324
+ /** ID of the requested organization. */
325
+ organizationId: string;
326
+ /** Cursor returned as `nextCursor` on the previous page. */
327
+ cursor?: string | undefined;
328
+ /** Maximum number of records to return per page. Defaults to 100. Maximum is 100. */
329
+ limit?: number | undefined;
330
+ }
331
+ /** Latest version of each UDF in the organization. */
332
+ export type ListUdfsResponseResultList = Array<Udf>;
333
+ export interface ListUdfsResponse {
334
+ /** Latest version of each UDF in the organization. */
335
+ result: ListUdfsResponseResultList;
336
+ /** Maximum number of results returned in this page. */
337
+ limit: number;
338
+ /** Total number of results across all pages. It has only informative value, thus is not guaranteed and it is provided on a best-effort basis. Null if the total count is unknown. */
339
+ totalCount: number | null;
340
+ /** Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page. */
341
+ nextCursor: string | null;
342
+ /** HTTP status code. */
343
+ status: number;
344
+ /** Unique id assigned to every request. UUIDv4 */
345
+ requestId: string;
346
+ }
347
+ export interface ListUdfVersionsRequest {
348
+ /** ID of the requested organization. */
349
+ organizationId: string;
350
+ /** Name of the UDF. */
351
+ functionName: string;
352
+ /** Cursor returned as `nextCursor` on the previous page. */
353
+ cursor?: string | undefined;
354
+ /** Maximum number of records to return per page. Defaults to 100. Maximum is 100. */
355
+ limit?: number | undefined;
356
+ }
357
+ /** Versions of the UDF in this page. */
358
+ export type ListUdfVersionsResponseResultList = Array<Udf>;
359
+ export interface ListUdfVersionsResponse {
360
+ /** Versions of the UDF in this page. */
361
+ result: ListUdfVersionsResponseResultList;
362
+ /** Maximum number of results returned in this page. */
363
+ limit: number;
364
+ /** Total number of results across all pages. It has only informative value, thus is not guaranteed and it is provided on a best-effort basis. Null if the total count is unknown. */
365
+ totalCount: number | null;
366
+ /** Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page. */
367
+ nextCursor: string | null;
368
+ /** HTTP status code. */
369
+ status: number;
370
+ /** Unique id assigned to every request. UUIDv4 */
371
+ requestId: string;
372
+ }
373
+ export type AttachUdfError = ClickHouseCloudOpError;
374
+ /** Attach UDF to service Attaches one UDF version to a service, replacing the current version when necessary. When version is omitted, the latest ready version is attached. */
375
+ export const attachUdf: API.OperationMethod<
376
+ AttachUdfRequest,
377
+ UdfAttachment,
378
+ AttachUdfError,
379
+ ClickHouseCloudOpContext
380
+ > = /*@__PURE__*/ API.make(() => ({
381
+ input: __S(0, __c0, 0) as any as S.Schema<AttachUdfRequest>,
382
+ output: __S(4, __c1, 0) as any as S.Schema<UdfAttachment>,
383
+ errors: [],
384
+ serviceErrors: ClickHouseCloudServiceErrors,
385
+ protocol: ClickHouseCloudProtocol,
386
+ retry: Retry.Retry,
387
+ telemetry: TELEMETRY,
388
+ span: "AttachUdf",
389
+ }));
390
+
391
+ export type CreateUdfError = ClickHouseCloudOpError;
392
+ /** Create UDF Creates a new UDF. See [User-defined functions in Cloud](https://clickhouse.com/docs/products/cloud/features/sql-console-features/user-defined-functions). */
393
+ export const createUdf: API.OperationMethod<
394
+ CreateUdfRequest,
395
+ Udf,
396
+ CreateUdfError,
397
+ ClickHouseCloudOpContext
398
+ > = /*@__PURE__*/ API.make(() => ({
399
+ input: __S(11, __c2, 3) as any as S.Schema<CreateUdfRequest>,
400
+ output: __S(14, __c3, 2) as any as S.Schema<Udf>,
401
+ errors: [],
402
+ serviceErrors: ClickHouseCloudServiceErrors,
403
+ protocol: ClickHouseCloudProtocol,
404
+ retry: Retry.Retry,
405
+ telemetry: TELEMETRY,
406
+ span: "CreateUdf",
407
+ }));
408
+
409
+ export type CreateUdfUploadUrlError = ClickHouseCloudOpError;
410
+ /** Create UDF upload URL Creates an org-scoped presigned application/zip upload URL. Callers must use an upload ID for only one create or version attempt and request a new upload URL when retrying. */
411
+ export const createUdfUploadUrl: API.OperationMethod<
412
+ CreateUdfUploadUrlRequest,
413
+ UdfUploadSession,
414
+ CreateUdfUploadUrlError,
415
+ ClickHouseCloudOpContext
416
+ > = /*@__PURE__*/ API.make(() => ({
417
+ input: __S(28, __c7, 0) as any as S.Schema<CreateUdfUploadUrlRequest>,
418
+ output: __S(29, __c7, 1) as any as S.Schema<UdfUploadSession>,
419
+ errors: [],
420
+ serviceErrors: ClickHouseCloudServiceErrors,
421
+ protocol: ClickHouseCloudProtocol,
422
+ retry: Retry.Retry,
423
+ telemetry: TELEMETRY,
424
+ span: "CreateUdfUploadUrl",
425
+ }));
426
+
427
+ export type CreateUdfVersionError = ClickHouseCloudOpError;
428
+ /** Create UDF version Consumes a source archive, assigns a version, and starts the UDF build. Optional configuration fields omitted from the request use the defaults documented in the request schema; values are not inherited from the previous version. Retry by requesting a new upload URL and re-uploading. */
429
+ export const createUdfVersion: API.OperationMethod<
430
+ CreateUdfVersionRequest,
431
+ Udf,
432
+ CreateUdfVersionError,
433
+ ClickHouseCloudOpContext
434
+ > = /*@__PURE__*/ API.make(() => ({
435
+ input: __S(35, __c8, 3) as any as S.Schema<CreateUdfVersionRequest>,
436
+ output: __S(14, __c3, 2) as any as S.Schema<Udf>,
437
+ errors: [],
438
+ serviceErrors: ClickHouseCloudServiceErrors,
439
+ protocol: ClickHouseCloudProtocol,
440
+ retry: Retry.Retry,
441
+ telemetry: TELEMETRY,
442
+ span: "CreateUdfVersion",
443
+ }));
444
+
445
+ export type DeleteUdfError = ClickHouseCloudOpError;
446
+ /** Delete UDF Deletes every version of a UDF and detaches it from all services. Removal from services completes asynchronously. */
447
+ export const deleteUdf: API.OperationMethod<
448
+ DeleteUdfRequest,
449
+ DeleteUdfResponse,
450
+ DeleteUdfError,
451
+ ClickHouseCloudOpContext
452
+ > = /*@__PURE__*/ API.make(() => ({
453
+ input: __S(36, __c9, 0) as any as S.Schema<DeleteUdfRequest>,
454
+ output: __S(40, __c10, 0) as any as S.Schema<DeleteUdfResponse>,
455
+ errors: [],
456
+ serviceErrors: ClickHouseCloudServiceErrors,
457
+ protocol: ClickHouseCloudProtocol,
458
+ retry: Retry.Retry,
459
+ telemetry: TELEMETRY,
460
+ span: "DeleteUdf",
461
+ }));
462
+
463
+ export type DeleteUdfVersionError = ClickHouseCloudOpError;
464
+ /** Delete UDF version Deletes a UDF version. The UDF must not be attached to any services. */
465
+ export const deleteUdfVersion: API.OperationMethod<
466
+ DeleteUdfVersionRequest,
467
+ DeleteUdfVersionResponse,
468
+ DeleteUdfVersionError,
469
+ ClickHouseCloudOpContext
470
+ > = /*@__PURE__*/ API.make(() => ({
471
+ input: __S(44, __c11, 0) as any as S.Schema<DeleteUdfVersionRequest>,
472
+ output: __S(40, __c10, 0) as any as S.Schema<DeleteUdfVersionResponse>,
473
+ errors: [],
474
+ serviceErrors: ClickHouseCloudServiceErrors,
475
+ protocol: ClickHouseCloudProtocol,
476
+ retry: Retry.Retry,
477
+ telemetry: TELEMETRY,
478
+ span: "DeleteUdfVersion",
479
+ }));
480
+
481
+ export type DetachUdfError = ClickHouseCloudOpError;
482
+ /** Detach UDF from service Detaches a UDF from a service. */
483
+ export const detachUdf: API.OperationMethod<
484
+ DetachUdfRequest,
485
+ DetachUdfResponse,
486
+ DetachUdfError,
487
+ ClickHouseCloudOpContext
488
+ > = /*@__PURE__*/ API.make(() => ({
489
+ input: __S(48, __c12, 0) as any as S.Schema<DetachUdfRequest>,
490
+ output: __S(40, __c10, 0) as any as S.Schema<DetachUdfResponse>,
491
+ errors: [],
492
+ serviceErrors: ClickHouseCloudServiceErrors,
493
+ protocol: ClickHouseCloudProtocol,
494
+ retry: Retry.Retry,
495
+ telemetry: TELEMETRY,
496
+ span: "DetachUdf",
497
+ }));
498
+
499
+ export type GetUdfError = ClickHouseCloudOpError;
500
+ /** Get UDF Returns the latest version of a UDF. */
501
+ export const getUdf: API.OperationMethod<
502
+ GetUdfRequest,
503
+ Udf,
504
+ GetUdfError,
505
+ ClickHouseCloudOpContext
506
+ > = /*@__PURE__*/ API.make(() => ({
507
+ input: __S(52, __c13, 0) as any as S.Schema<GetUdfRequest>,
508
+ output: __S(14, __c3, 2) as any as S.Schema<Udf>,
509
+ errors: [],
510
+ serviceErrors: ClickHouseCloudServiceErrors,
511
+ protocol: ClickHouseCloudProtocol,
512
+ retry: Retry.Retry,
513
+ telemetry: TELEMETRY,
514
+ span: "GetUdf",
515
+ }));
516
+
517
+ export type GetUdfAttachmentError = ClickHouseCloudOpError;
518
+ /** Get UDF attachment Returns the current attachment of a UDF to one service. */
519
+ export const getUdfAttachment: API.OperationMethod<
520
+ GetUdfAttachmentRequest,
521
+ UdfAttachment,
522
+ GetUdfAttachmentError,
523
+ ClickHouseCloudOpContext
524
+ > = /*@__PURE__*/ API.make(() => ({
525
+ input: __S(56, __c14, 0) as any as S.Schema<GetUdfAttachmentRequest>,
526
+ output: __S(4, __c1, 0) as any as S.Schema<UdfAttachment>,
527
+ errors: [],
528
+ serviceErrors: ClickHouseCloudServiceErrors,
529
+ protocol: ClickHouseCloudProtocol,
530
+ retry: Retry.Retry,
531
+ telemetry: TELEMETRY,
532
+ span: "GetUdfAttachment",
533
+ }));
534
+
535
+ export type ListUdfAttachmentsError = ClickHouseCloudOpError;
536
+ /** List UDF attachments Returns the current service attachments for a UDF, with at most one attachment per service. */
537
+ export const listUdfAttachments: API.PaginatedOperationMethod<
538
+ ListUdfAttachmentsRequest,
539
+ ListUdfAttachmentsResponse,
540
+ ListUdfAttachmentsError,
541
+ ClickHouseCloudOpContext,
542
+ UdfAttachment
543
+ > = /*@__PURE__*/ API.makePaginated(
544
+ () => ({
545
+ input: __S(60, __c15, 0) as any as S.Schema<ListUdfAttachmentsRequest>,
546
+ output: __S(62, __c15, 2) as any as S.Schema<ListUdfAttachmentsResponse>,
547
+ errors: [],
548
+ serviceErrors: ClickHouseCloudServiceErrors,
549
+ protocol: ClickHouseCloudPaginatedProtocol,
550
+ retry: Retry.Retry,
551
+ telemetry: TELEMETRY,
552
+ span: "ListUdfAttachments",
553
+ pagination: {
554
+ mode: "cursor",
555
+ inputToken: "cursor",
556
+ outputToken: "nextCursor",
557
+ items: "result",
558
+ pageSize: "limit",
559
+ } as const,
560
+ }),
561
+ paginateCursor,
562
+ ) as any;
563
+
564
+ export type ListUdfsError = ClickHouseCloudOpError;
565
+ /** List UDFs Returns the latest version of each UDF in the organization. */
566
+ export const listUdfs: API.PaginatedOperationMethod<
567
+ ListUdfsRequest,
568
+ ListUdfsResponse,
569
+ ListUdfsError,
570
+ ClickHouseCloudOpContext,
571
+ Udf
572
+ > = /*@__PURE__*/ API.makePaginated(
573
+ () => ({
574
+ input: __S(16, __c4, 0) as any as S.Schema<ListUdfsRequest>,
575
+ output: __S(21, __c5, 1) as any as S.Schema<ListUdfsResponse>,
576
+ errors: [],
577
+ serviceErrors: ClickHouseCloudServiceErrors,
578
+ protocol: ClickHouseCloudPaginatedProtocol,
579
+ retry: Retry.Retry,
580
+ telemetry: TELEMETRY,
581
+ span: "ListUdfs",
582
+ pagination: {
583
+ mode: "cursor",
584
+ inputToken: "cursor",
585
+ outputToken: "nextCursor",
586
+ items: "result",
587
+ pageSize: "limit",
588
+ } as const,
589
+ }),
590
+ paginateCursor,
591
+ ) as any;
592
+
593
+ export type ListUdfVersionsError = ClickHouseCloudOpError;
594
+ /** List UDF versions Returns all versions of a UDF. */
595
+ export const listUdfVersions: API.PaginatedOperationMethod<
596
+ ListUdfVersionsRequest,
597
+ ListUdfVersionsResponse,
598
+ ListUdfVersionsError,
599
+ ClickHouseCloudOpContext,
600
+ Udf
601
+ > = /*@__PURE__*/ API.makePaginated(
602
+ () => ({
603
+ input: __S(24, __c6, 0) as any as S.Schema<ListUdfVersionsRequest>,
604
+ output: __S(21, __c5, 1) as any as S.Schema<ListUdfVersionsResponse>,
605
+ errors: [],
606
+ serviceErrors: ClickHouseCloudServiceErrors,
607
+ protocol: ClickHouseCloudPaginatedProtocol,
608
+ retry: Retry.Retry,
609
+ telemetry: TELEMETRY,
610
+ span: "ListUdfVersions",
611
+ pagination: {
612
+ mode: "cursor",
613
+ inputToken: "cursor",
614
+ outputToken: "nextCursor",
615
+ items: "result",
616
+ pageSize: "limit",
617
+ } as const,
618
+ }),
619
+ paginateCursor,
620
+ ) as any;
621
+
622
+ // Schema builders: each runs one schema initializer, on that schema's first use.
623
+ function __c0(j: number): any {
624
+ switch (j) {
625
+ case 0:
626
+ return S.suspend(() =>
627
+ S.Struct({
628
+ organizationId: S.String.pipe(T.Label()),
629
+ functionName: S.String.pipe(T.Label()),
630
+ serviceId: S.String.pipe(T.Label()),
631
+ version: S.optional(S.Number),
632
+ }).pipe(
633
+ T.Http({
634
+ method: "PUT",
635
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}/attachments/{serviceId}",
636
+ code: 200,
637
+ }),
638
+ ),
639
+ ).annotate({ identifier: "AttachUdfRequest" });
640
+ }
641
+ }
642
+ function __c1(j: number): any {
643
+ switch (j) {
644
+ case 0:
645
+ return S.suspend(() =>
646
+ S.Struct({
647
+ functionName: S.String,
648
+ serviceId: S.String,
649
+ status: S.String,
650
+ version: S.Number,
651
+ }),
652
+ ).annotate({ identifier: "UdfAttachment" });
653
+ }
654
+ }
655
+ function __c2(j: number): any {
656
+ switch (j) {
657
+ case 0:
658
+ return S.suspend(() =>
659
+ S.Struct({
660
+ uploadId: S.String,
661
+ runtime: S.String,
662
+ arguments: __S(13, __c3, 1),
663
+ returnType: S.String,
664
+ returnName: S.optional(S.NullOr(S.String)),
665
+ commandReadTimeout: S.optional(S.Number),
666
+ commandWriteTimeout: S.optional(S.Number),
667
+ memoryLimitMib: S.optional(S.NullOr(S.Number)),
668
+ sendChunkHeader: S.optional(S.Boolean),
669
+ deterministic: S.optional(S.Boolean),
670
+ format: S.optional(S.String),
671
+ sandboxType: S.optional(S.String),
672
+ type: S.String,
673
+ poolSize: S.optional(S.NullOr(S.Unknown)),
674
+ maxCommandExecutionTime: S.optional(S.NullOr(S.Number)),
675
+ functionName: S.String,
676
+ }),
677
+ ).annotate({ identifier: "ExecutableUdfCreateRequest" });
678
+ case 1:
679
+ return S.suspend(() =>
680
+ S.Struct({
681
+ uploadId: S.String,
682
+ runtime: S.String,
683
+ arguments: __S(13, __c3, 1),
684
+ returnType: S.String,
685
+ returnName: S.optional(S.NullOr(S.String)),
686
+ commandReadTimeout: S.optional(S.Number),
687
+ commandWriteTimeout: S.optional(S.Number),
688
+ memoryLimitMib: S.optional(S.NullOr(S.Number)),
689
+ sendChunkHeader: S.optional(S.Boolean),
690
+ deterministic: S.optional(S.Boolean),
691
+ format: S.optional(S.String),
692
+ sandboxType: S.optional(S.String),
693
+ type: S.String,
694
+ poolSize: S.optional(S.Number),
695
+ maxCommandExecutionTime: S.optional(S.Number),
696
+ functionName: S.String,
697
+ }),
698
+ ).annotate({ identifier: "ExecutablePoolUdfCreateRequest" });
699
+ case 2:
700
+ return S.Union([__S(8, __c2, 0), __S(9, __c2, 1)]);
701
+ case 3:
702
+ return S.suspend(() =>
703
+ S.Struct({
704
+ organizationId: S.String.pipe(T.Label()),
705
+ body: S.optional(__S(10, __c2, 2).pipe(T.HttpBody())),
706
+ }).pipe(
707
+ T.Http({ method: "POST", uri: "/v1/organizations/{organizationId}/udfs", code: 200 }),
708
+ ),
709
+ ).annotate({ identifier: "CreateUdfRequest" });
710
+ }
711
+ }
712
+ function __c3(j: number): any {
713
+ switch (j) {
714
+ case 0:
715
+ return S.suspend(() =>
716
+ S.Struct({
717
+ name: S.String,
718
+ type: S.String,
719
+ }),
720
+ ).annotate({ identifier: "UdfArgument" });
721
+ case 1:
722
+ return S.Array(__S(12, __c3, 0));
723
+ case 2:
724
+ return S.suspend(() =>
725
+ S.Struct({
726
+ functionName: S.String,
727
+ version: S.Number,
728
+ status: S.String,
729
+ runtime: S.String,
730
+ type: S.String,
731
+ arguments: __S(13, __c3, 1),
732
+ returnType: S.String,
733
+ returnName: S.NullOr(S.String),
734
+ poolSize: S.NullOr(S.Number),
735
+ commandReadTimeout: S.Number,
736
+ commandWriteTimeout: S.Number,
737
+ maxCommandExecutionTime: S.NullOr(S.Number),
738
+ memoryLimitMib: S.NullOr(S.Number),
739
+ sendChunkHeader: S.Boolean,
740
+ deterministic: S.Boolean,
741
+ format: S.String,
742
+ sandboxType: S.String,
743
+ sandboxVersion: S.String,
744
+ error: S.NullOr(S.String),
745
+ createdAt: S.String,
746
+ updatedAt: S.String,
747
+ }),
748
+ ).annotate({ identifier: "Udf" });
749
+ }
750
+ }
751
+ function __c4(j: number): any {
752
+ switch (j) {
753
+ case 0:
754
+ return S.suspend(() =>
755
+ S.Struct({
756
+ organizationId: S.String.pipe(T.Label()),
757
+ cursor: S.optional(S.String.pipe(T.Query())),
758
+ limit: S.optional(S.Number.pipe(T.Query())),
759
+ }).pipe(
760
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationId}/udfs", code: 200 }),
761
+ ),
762
+ ).annotate({ identifier: "ListUdfsRequest" });
763
+ }
764
+ }
765
+ function __c5(j: number): any {
766
+ switch (j) {
767
+ case 0:
768
+ return S.Array(__S(14, __c3, 2));
769
+ case 1:
770
+ return S.suspend(() =>
771
+ S.Struct({
772
+ result: __S(20, __c5, 0),
773
+ limit: S.Number,
774
+ totalCount: S.NullOr(S.Number),
775
+ nextCursor: S.NullOr(S.String),
776
+ status: S.Number,
777
+ requestId: S.String,
778
+ }),
779
+ ).annotate({ identifier: "ListUdfsResponse" });
780
+ }
781
+ }
782
+ function __c6(j: number): any {
783
+ switch (j) {
784
+ case 0:
785
+ return S.suspend(() =>
786
+ S.Struct({
787
+ organizationId: S.String.pipe(T.Label()),
788
+ functionName: S.String.pipe(T.Label()),
789
+ cursor: S.optional(S.String.pipe(T.Query())),
790
+ limit: S.optional(S.Number.pipe(T.Query())),
791
+ }).pipe(
792
+ T.Http({
793
+ method: "GET",
794
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}/versions",
795
+ code: 200,
796
+ }),
797
+ ),
798
+ ).annotate({ identifier: "ListUdfVersionsRequest" });
799
+ }
800
+ }
801
+ function __c7(j: number): any {
802
+ switch (j) {
803
+ case 0:
804
+ return S.suspend(() =>
805
+ S.Struct({
806
+ organizationId: S.String.pipe(T.Label()),
807
+ }).pipe(
808
+ T.Http({
809
+ method: "POST",
810
+ uri: "/v1/organizations/{organizationId}/udfUploads/url",
811
+ code: 200,
812
+ }),
813
+ ),
814
+ ).annotate({ identifier: "CreateUdfUploadUrlRequest" });
815
+ case 1:
816
+ return S.suspend(() =>
817
+ S.Struct({
818
+ uploadId: S.String,
819
+ uploadUrl: S.String,
820
+ expiresAt: S.String,
821
+ }),
822
+ ).annotate({ identifier: "UdfUploadSession" });
823
+ }
824
+ }
825
+ function __c8(j: number): any {
826
+ switch (j) {
827
+ case 0:
828
+ return S.suspend(() =>
829
+ S.Struct({
830
+ uploadId: S.String,
831
+ runtime: S.String,
832
+ arguments: __S(13, __c3, 1),
833
+ returnType: S.String,
834
+ returnName: S.optional(S.NullOr(S.String)),
835
+ commandReadTimeout: S.optional(S.Number),
836
+ commandWriteTimeout: S.optional(S.Number),
837
+ memoryLimitMib: S.optional(S.NullOr(S.Number)),
838
+ sendChunkHeader: S.optional(S.Boolean),
839
+ deterministic: S.optional(S.Boolean),
840
+ format: S.optional(S.String),
841
+ sandboxType: S.optional(S.String),
842
+ type: S.String,
843
+ poolSize: S.optional(S.NullOr(S.Unknown)),
844
+ maxCommandExecutionTime: S.optional(S.NullOr(S.Number)),
845
+ }),
846
+ ).annotate({ identifier: "ExecutableUdfVersionCreateRequest" });
847
+ case 1:
848
+ return S.suspend(() =>
849
+ S.Struct({
850
+ uploadId: S.String,
851
+ runtime: S.String,
852
+ arguments: __S(13, __c3, 1),
853
+ returnType: S.String,
854
+ returnName: S.optional(S.NullOr(S.String)),
855
+ commandReadTimeout: S.optional(S.Number),
856
+ commandWriteTimeout: S.optional(S.Number),
857
+ memoryLimitMib: S.optional(S.NullOr(S.Number)),
858
+ sendChunkHeader: S.optional(S.Boolean),
859
+ deterministic: S.optional(S.Boolean),
860
+ format: S.optional(S.String),
861
+ sandboxType: S.optional(S.String),
862
+ type: S.String,
863
+ poolSize: S.optional(S.Number),
864
+ maxCommandExecutionTime: S.optional(S.Number),
865
+ }),
866
+ ).annotate({ identifier: "ExecutablePoolUdfVersionCreateRequest" });
867
+ case 2:
868
+ return S.Union([__S(32, __c8, 0), __S(33, __c8, 1)]);
869
+ case 3:
870
+ return S.suspend(() =>
871
+ S.Struct({
872
+ organizationId: S.String.pipe(T.Label()),
873
+ functionName: S.String.pipe(T.Label()),
874
+ body: S.optional(__S(34, __c8, 2).pipe(T.HttpBody())),
875
+ }).pipe(
876
+ T.Http({
877
+ method: "POST",
878
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}/versions",
879
+ code: 200,
880
+ }),
881
+ ),
882
+ ).annotate({ identifier: "CreateUdfVersionRequest" });
883
+ }
884
+ }
885
+ function __c9(j: number): any {
886
+ switch (j) {
887
+ case 0:
888
+ return S.suspend(() =>
889
+ S.Struct({
890
+ organizationId: S.String.pipe(T.Label()),
891
+ functionName: S.String.pipe(T.Label()),
892
+ }).pipe(
893
+ T.Http({
894
+ method: "DELETE",
895
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}",
896
+ code: 200,
897
+ }),
898
+ ),
899
+ ).annotate({ identifier: "DeleteUdfRequest" });
900
+ }
901
+ }
902
+ function __c10(j: number): any {
903
+ switch (j) {
904
+ case 0:
905
+ return S.suspend(() =>
906
+ S.Struct({
907
+ status: S.Number,
908
+ requestId: S.String,
909
+ }),
910
+ ).annotate({ identifier: "DeleteUdfResponse" });
911
+ }
912
+ }
913
+ function __c11(j: number): any {
914
+ switch (j) {
915
+ case 0:
916
+ return S.suspend(() =>
917
+ S.Struct({
918
+ organizationId: S.String.pipe(T.Label()),
919
+ functionName: S.String.pipe(T.Label()),
920
+ version: S.Number.pipe(T.Label()),
921
+ }).pipe(
922
+ T.Http({
923
+ method: "DELETE",
924
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}/versions/{version}",
925
+ code: 200,
926
+ }),
927
+ ),
928
+ ).annotate({ identifier: "DeleteUdfVersionRequest" });
929
+ }
930
+ }
931
+ function __c12(j: number): any {
932
+ switch (j) {
933
+ case 0:
934
+ return S.suspend(() =>
935
+ S.Struct({
936
+ organizationId: S.String.pipe(T.Label()),
937
+ functionName: S.String.pipe(T.Label()),
938
+ serviceId: S.String.pipe(T.Label()),
939
+ }).pipe(
940
+ T.Http({
941
+ method: "DELETE",
942
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}/attachments/{serviceId}",
943
+ code: 200,
944
+ }),
945
+ ),
946
+ ).annotate({ identifier: "DetachUdfRequest" });
947
+ }
948
+ }
949
+ function __c13(j: number): any {
950
+ switch (j) {
951
+ case 0:
952
+ return S.suspend(() =>
953
+ S.Struct({
954
+ organizationId: S.String.pipe(T.Label()),
955
+ functionName: S.String.pipe(T.Label()),
956
+ }).pipe(
957
+ T.Http({
958
+ method: "GET",
959
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}",
960
+ code: 200,
961
+ }),
962
+ ),
963
+ ).annotate({ identifier: "GetUdfRequest" });
964
+ }
965
+ }
966
+ function __c14(j: number): any {
967
+ switch (j) {
968
+ case 0:
969
+ return S.suspend(() =>
970
+ S.Struct({
971
+ organizationId: S.String.pipe(T.Label()),
972
+ functionName: S.String.pipe(T.Label()),
973
+ serviceId: S.String.pipe(T.Label()),
974
+ }).pipe(
975
+ T.Http({
976
+ method: "GET",
977
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}/attachments/{serviceId}",
978
+ code: 200,
979
+ }),
980
+ ),
981
+ ).annotate({ identifier: "GetUdfAttachmentRequest" });
982
+ }
983
+ }
984
+ function __c15(j: number): any {
985
+ switch (j) {
986
+ case 0:
987
+ return S.suspend(() =>
988
+ S.Struct({
989
+ organizationId: S.String.pipe(T.Label()),
990
+ functionName: S.String.pipe(T.Label()),
991
+ cursor: S.optional(S.String.pipe(T.Query())),
992
+ limit: S.optional(S.Number.pipe(T.Query())),
993
+ }).pipe(
994
+ T.Http({
995
+ method: "GET",
996
+ uri: "/v1/organizations/{organizationId}/udfs/{functionName}/attachments",
997
+ code: 200,
998
+ }),
999
+ ),
1000
+ ).annotate({ identifier: "ListUdfAttachmentsRequest" });
1001
+ case 1:
1002
+ return S.Array(__S(4, __c1, 0));
1003
+ case 2:
1004
+ return S.suspend(() =>
1005
+ S.Struct({
1006
+ result: __S(61, __c15, 1),
1007
+ limit: S.Number,
1008
+ totalCount: S.NullOr(S.Number),
1009
+ nextCursor: S.NullOr(S.String),
1010
+ status: S.Number,
1011
+ requestId: S.String,
1012
+ }),
1013
+ ).annotate({ identifier: "ListUdfAttachmentsResponse" });
1014
+ }
1015
+ }
1016
+ // Schema table: entry i is schema j of builder f, made on first reach.
1017
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
1018
+ return (__s[i] ??= __L.at(f, j));
1019
+ }