@sylphx/sdk 0.28.0 → 0.30.0

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 (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -118
  3. package/dist/access.d.ts +659 -0
  4. package/dist/access.js +638 -0
  5. package/dist/access.js.map +1 -0
  6. package/dist/ai.d.ts +176 -0
  7. package/dist/ai.js +112 -0
  8. package/dist/ai.js.map +1 -0
  9. package/dist/artifacts.d.ts +165 -0
  10. package/dist/artifacts.js +129 -0
  11. package/dist/artifacts.js.map +1 -0
  12. package/dist/auth.d.ts +896 -0
  13. package/dist/auth.js +828 -0
  14. package/dist/auth.js.map +1 -0
  15. package/dist/billing.d.ts +758 -0
  16. package/dist/billing.js +553 -0
  17. package/dist/billing.js.map +1 -0
  18. package/dist/broker.d.ts +226 -0
  19. package/dist/broker.js +187 -0
  20. package/dist/broker.js.map +1 -0
  21. package/dist/build.d.ts +313 -0
  22. package/dist/build.js +271 -0
  23. package/dist/build.js.map +1 -0
  24. package/dist/common.d.ts +162 -0
  25. package/dist/common.js +41 -0
  26. package/dist/common.js.map +1 -0
  27. package/dist/config.d.ts +198 -0
  28. package/dist/config.js +168 -0
  29. package/dist/config.js.map +1 -0
  30. package/dist/connections.d.ts +354 -0
  31. package/dist/connections.js +313 -0
  32. package/dist/connections.js.map +1 -0
  33. package/dist/data.d.ts +858 -0
  34. package/dist/data.js +814 -0
  35. package/dist/data.js.map +1 -0
  36. package/dist/entitlement.d.ts +172 -0
  37. package/dist/entitlement.js +116 -0
  38. package/dist/entitlement.js.map +1 -0
  39. package/dist/events.d.ts +1324 -0
  40. package/dist/events.js +1227 -0
  41. package/dist/events.js.map +1 -0
  42. package/dist/hosting.d.ts +709 -0
  43. package/dist/hosting.js +611 -0
  44. package/dist/hosting.js.map +1 -0
  45. package/dist/index.d.ts +79 -33656
  46. package/dist/index.js +113 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/keys.d.ts +438 -0
  49. package/dist/keys.js +406 -0
  50. package/dist/keys.js.map +1 -0
  51. package/dist/methods.d.ts +2 -0
  52. package/dist/methods.js +3995 -0
  53. package/dist/methods.js.map +1 -0
  54. package/dist/network.d.ts +733 -0
  55. package/dist/network.js +711 -0
  56. package/dist/network.js.map +1 -0
  57. package/dist/notify.d.ts +1359 -0
  58. package/dist/notify.js +1282 -0
  59. package/dist/notify.js.map +1 -0
  60. package/dist/observability.d.ts +509 -0
  61. package/dist/observability.js +437 -0
  62. package/dist/observability.js.map +1 -0
  63. package/dist/release.d.ts +303 -0
  64. package/dist/release.js +214 -0
  65. package/dist/release.js.map +1 -0
  66. package/dist/runners.d.ts +262 -0
  67. package/dist/runners.js +238 -0
  68. package/dist/runners.js.map +1 -0
  69. package/dist/runtime.d.ts +88 -0
  70. package/dist/runtime.js +226 -0
  71. package/dist/runtime.js.map +1 -0
  72. package/dist/sandboxes.d.ts +1705 -0
  73. package/dist/sandboxes.js +1226 -0
  74. package/dist/sandboxes.js.map +1 -0
  75. package/dist/secrets.d.ts +508 -0
  76. package/dist/secrets.js +474 -0
  77. package/dist/secrets.js.map +1 -0
  78. package/dist/workflows.d.ts +678 -0
  79. package/dist/workflows.js +595 -0
  80. package/dist/workflows.js.map +1 -0
  81. package/package.json +33 -112
  82. package/dist/connect.d.ts +0 -2838
  83. package/dist/connect.mjs +0 -220
  84. package/dist/connect.mjs.map +0 -1
  85. package/dist/health/index.d.ts +0 -1394
  86. package/dist/health/index.mjs +0 -1394
  87. package/dist/health/index.mjs.map +0 -1
  88. package/dist/index.mjs +0 -38429
  89. package/dist/index.mjs.map +0 -1
  90. package/dist/nextjs/index.d.ts +0 -724
  91. package/dist/nextjs/index.mjs +0 -3332
  92. package/dist/nextjs/index.mjs.map +0 -1
  93. package/dist/react/index.d.ts +0 -13066
  94. package/dist/react/index.mjs +0 -35329
  95. package/dist/react/index.mjs.map +0 -1
  96. package/dist/server/index.d.ts +0 -2000
  97. package/dist/server/index.mjs +0 -3446
  98. package/dist/server/index.mjs.map +0 -1
  99. package/dist/web-analytics.d.ts +0 -90
  100. package/dist/web-analytics.mjs +0 -225
  101. package/dist/web-analytics.mjs.map +0 -1
package/dist/data.js ADDED
@@ -0,0 +1,814 @@
1
+ // @generated by sylphx-gen 0.1.0 from contracts@cdf6473b36ca648759a7f4b1fc21554541d52a947477e6e9d1d7a6a9a79bdaa0. Do not edit.
2
+ // `sylphx.data.v1`.
3
+ import * as runtime from './runtime.js';
4
+ import './common.js';
5
+ runtime.registerSchemas({
6
+ 'sylphx.data.v1.Bucket': [
7
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
8
+ ['spec', 'spec', 'sylphx.data.v1.BucketSpec'],
9
+ ['status', 'status', 'sylphx.data.v1.BucketStatus'],
10
+ ],
11
+ 'sylphx.data.v1.BucketSpec': [
12
+ ['versioningEnabled', 'versioning_enabled'],
13
+ ['deletionProtection', 'deletion_protection'],
14
+ ],
15
+ 'sylphx.data.v1.BucketStatus': [
16
+ ['observedGeneration', 'observed_generation'],
17
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
18
+ ['storageBytes', 'storage_bytes'],
19
+ ['objectCount', 'object_count'],
20
+ ],
21
+ 'sylphx.data.v1.ConnectBucketRequest': [],
22
+ 'sylphx.data.v1.ConnectBucketResponse': [
23
+ ['connectionInfo', 'connection_info', 'sylphx.data.v1.ConnectionInfo'],
24
+ ],
25
+ 'sylphx.data.v1.ConnectDatabaseRequest': [],
26
+ 'sylphx.data.v1.ConnectDatabaseResponse': [
27
+ ['connectionInfo', 'connection_info', 'sylphx.data.v1.ConnectionInfo'],
28
+ ],
29
+ 'sylphx.data.v1.ConnectKvNamespaceRequest': [],
30
+ 'sylphx.data.v1.ConnectKvNamespaceResponse': [
31
+ ['connectionInfo', 'connection_info', 'sylphx.data.v1.ConnectionInfo'],
32
+ ],
33
+ 'sylphx.data.v1.ConnectSearchIndexRequest': [],
34
+ 'sylphx.data.v1.ConnectSearchIndexResponse': [
35
+ ['connectionInfo', 'connection_info', 'sylphx.data.v1.ConnectionInfo'],
36
+ ],
37
+ 'sylphx.data.v1.ConnectionInfo': [
38
+ ['directUri', 'direct_uri'],
39
+ ],
40
+ 'sylphx.data.v1.CreateBucketRequest': [
41
+ ['bucket', 'bucket', 'sylphx.data.v1.Bucket'],
42
+ ['bucketId', 'bucket_id'],
43
+ ['validateOnly', 'validate_only'],
44
+ ],
45
+ 'sylphx.data.v1.CreateDatabaseRequest': [
46
+ ['database', 'database', 'sylphx.data.v1.Database'],
47
+ ['databaseId', 'database_id'],
48
+ ['validateOnly', 'validate_only'],
49
+ ],
50
+ 'sylphx.data.v1.CreateKvNamespaceRequest': [
51
+ ['kvNamespace', 'kv_namespace', 'sylphx.data.v1.KvNamespace'],
52
+ ['kvNamespaceId', 'kv_namespace_id'],
53
+ ['validateOnly', 'validate_only'],
54
+ ],
55
+ 'sylphx.data.v1.CreateSearchIndexRequest': [
56
+ ['searchIndex', 'search_index', 'sylphx.data.v1.SearchIndex'],
57
+ ['searchIndexId', 'search_index_id'],
58
+ ['validateOnly', 'validate_only'],
59
+ ],
60
+ 'sylphx.data.v1.Database': [
61
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
62
+ ['spec', 'spec', 'sylphx.data.v1.DatabaseSpec'],
63
+ ['status', 'status', 'sylphx.data.v1.DatabaseStatus'],
64
+ ],
65
+ 'sylphx.data.v1.DatabaseSpec': [
66
+ ['postgresVersion', 'postgres_version'],
67
+ ['computeUnits', 'compute_units'],
68
+ ['deletionProtection', 'deletion_protection'],
69
+ ],
70
+ 'sylphx.data.v1.DatabaseStatus': [
71
+ ['observedGeneration', 'observed_generation'],
72
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
73
+ ['storageBytes', 'storage_bytes'],
74
+ ['maxConnections', 'max_connections'],
75
+ ['earliestRestoreTime', 'earliest_restore_time'],
76
+ ],
77
+ 'sylphx.data.v1.DeleteBucketRequest': [
78
+ ['allowMissing', 'allow_missing'],
79
+ ['validateOnly', 'validate_only'],
80
+ ],
81
+ 'sylphx.data.v1.DeleteDatabaseRequest': [
82
+ ['allowMissing', 'allow_missing'],
83
+ ['validateOnly', 'validate_only'],
84
+ ],
85
+ 'sylphx.data.v1.DeleteKvNamespaceRequest': [
86
+ ['allowMissing', 'allow_missing'],
87
+ ['validateOnly', 'validate_only'],
88
+ ],
89
+ 'sylphx.data.v1.DeleteSearchIndexRequest': [
90
+ ['allowMissing', 'allow_missing'],
91
+ ['validateOnly', 'validate_only'],
92
+ ],
93
+ 'sylphx.data.v1.GetBucketRequest': [],
94
+ 'sylphx.data.v1.GetDatabaseRequest': [],
95
+ 'sylphx.data.v1.GetKvNamespaceRequest': [],
96
+ 'sylphx.data.v1.GetSearchIndexRequest': [],
97
+ 'sylphx.data.v1.KvNamespace': [
98
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
99
+ ['spec', 'spec', 'sylphx.data.v1.KvNamespaceSpec'],
100
+ ['status', 'status', 'sylphx.data.v1.KvNamespaceStatus'],
101
+ ],
102
+ 'sylphx.data.v1.KvNamespaceSpec': [
103
+ ['defaultTtl', 'default_ttl'],
104
+ ['deletionProtection', 'deletion_protection'],
105
+ ],
106
+ 'sylphx.data.v1.KvNamespaceStatus': [
107
+ ['observedGeneration', 'observed_generation'],
108
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
109
+ ['storageBytes', 'storage_bytes'],
110
+ ],
111
+ 'sylphx.data.v1.ListBucketsRequest': [
112
+ ['pageSize', 'page_size'],
113
+ ['pageToken', 'page_token'],
114
+ ['orderBy', 'order_by'],
115
+ ],
116
+ 'sylphx.data.v1.ListBucketsResponse': [
117
+ ['buckets', 'buckets', 'sylphx.data.v1.Bucket'],
118
+ ['nextPageToken', 'next_page_token'],
119
+ ],
120
+ 'sylphx.data.v1.ListDatabasesRequest': [
121
+ ['pageSize', 'page_size'],
122
+ ['pageToken', 'page_token'],
123
+ ['orderBy', 'order_by'],
124
+ ],
125
+ 'sylphx.data.v1.ListDatabasesResponse': [
126
+ ['databases', 'databases', 'sylphx.data.v1.Database'],
127
+ ['nextPageToken', 'next_page_token'],
128
+ ],
129
+ 'sylphx.data.v1.ListKvNamespacesRequest': [
130
+ ['pageSize', 'page_size'],
131
+ ['pageToken', 'page_token'],
132
+ ['orderBy', 'order_by'],
133
+ ],
134
+ 'sylphx.data.v1.ListKvNamespacesResponse': [
135
+ ['kvNamespaces', 'kv_namespaces', 'sylphx.data.v1.KvNamespace'],
136
+ ['nextPageToken', 'next_page_token'],
137
+ ],
138
+ 'sylphx.data.v1.ListSearchIndexesRequest': [
139
+ ['pageSize', 'page_size'],
140
+ ['pageToken', 'page_token'],
141
+ ['orderBy', 'order_by'],
142
+ ],
143
+ 'sylphx.data.v1.ListSearchIndexesResponse': [
144
+ ['searchIndexes', 'search_indexes', 'sylphx.data.v1.SearchIndex'],
145
+ ['nextPageToken', 'next_page_token'],
146
+ ],
147
+ 'sylphx.data.v1.RestoreDatabaseRequest': [
148
+ ['restoreTime', 'restore_time'],
149
+ ['validateOnly', 'validate_only'],
150
+ ],
151
+ 'sylphx.data.v1.RotateBucketCredentialsRequest': [
152
+ ['validateOnly', 'validate_only'],
153
+ ],
154
+ 'sylphx.data.v1.RotateDatabaseCredentialsRequest': [
155
+ ['validateOnly', 'validate_only'],
156
+ ],
157
+ 'sylphx.data.v1.RotateKvNamespaceCredentialsRequest': [
158
+ ['validateOnly', 'validate_only'],
159
+ ],
160
+ 'sylphx.data.v1.RotateSearchIndexCredentialsRequest': [
161
+ ['validateOnly', 'validate_only'],
162
+ ],
163
+ 'sylphx.data.v1.SearchIndex': [
164
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
165
+ ['spec', 'spec', 'sylphx.data.v1.SearchIndexSpec'],
166
+ ['status', 'status', 'sylphx.data.v1.SearchIndexStatus'],
167
+ ],
168
+ 'sylphx.data.v1.SearchIndexSpec': [
169
+ ['vectorDimensions', 'vector_dimensions'],
170
+ ['deletionProtection', 'deletion_protection'],
171
+ ],
172
+ 'sylphx.data.v1.SearchIndexStatus': [
173
+ ['observedGeneration', 'observed_generation'],
174
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
175
+ ['storageBytes', 'storage_bytes'],
176
+ ['documentCount', 'document_count'],
177
+ ],
178
+ 'sylphx.data.v1.UpdateBucketRequest': [
179
+ ['bucket', 'bucket', 'sylphx.data.v1.Bucket'],
180
+ ['updateMask', 'update_mask'],
181
+ ['allowMissing', 'allow_missing'],
182
+ ['validateOnly', 'validate_only'],
183
+ ],
184
+ 'sylphx.data.v1.UpdateDatabaseRequest': [
185
+ ['database', 'database', 'sylphx.data.v1.Database'],
186
+ ['updateMask', 'update_mask'],
187
+ ['allowMissing', 'allow_missing'],
188
+ ['validateOnly', 'validate_only'],
189
+ ],
190
+ 'sylphx.data.v1.UpdateKvNamespaceRequest': [
191
+ ['kvNamespace', 'kv_namespace', 'sylphx.data.v1.KvNamespace'],
192
+ ['updateMask', 'update_mask'],
193
+ ['allowMissing', 'allow_missing'],
194
+ ['validateOnly', 'validate_only'],
195
+ ],
196
+ 'sylphx.data.v1.UpdateSearchIndexRequest': [
197
+ ['searchIndex', 'search_index', 'sylphx.data.v1.SearchIndex'],
198
+ ['updateMask', 'update_mask'],
199
+ ['allowMissing', 'allow_missing'],
200
+ ['validateOnly', 'validate_only'],
201
+ ],
202
+ });
203
+ /**
204
+ * DataService is Sylphx Data's control plane: the four customer datastores and
205
+ * how to connect to them (docs/services/data/vision.md). Each datastore is its
206
+ * own silo; its engine credentials are not API keys, and every endpoint is
207
+ * `{ref}[-direct].sylphx.net` served by Data Edge from the Cell Snapshot.
208
+ *
209
+ * Namespace of Sylphx Data on `Sylphx`.
210
+ */
211
+ export class DataApi {
212
+ /** The `databases` collection. */
213
+ databases;
214
+ /** The `kv_namespaces` collection. */
215
+ kvNamespaces;
216
+ /** The `buckets` collection. */
217
+ buckets;
218
+ /** The `search_indexes` collection. */
219
+ searchIndexes;
220
+ constructor(client) {
221
+ this.databases = new DatabasesCollection(client);
222
+ this.kvNamespaces = new KvNamespacesCollection(client);
223
+ this.buckets = new BucketsCollection(client);
224
+ this.searchIndexes = new SearchIndexesCollection(client);
225
+ }
226
+ }
227
+ /** `databases` of Sylphx Data: Resource type `data.sylphx.com/Database`. */
228
+ export class DatabasesCollection {
229
+ client;
230
+ constructor(client) {
231
+ this.client = client;
232
+ }
233
+ /**
234
+ * Gets a database.
235
+ *
236
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}` · permission `data:read` · effect `read`
237
+ *
238
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
239
+ */
240
+ async get(request) {
241
+ return this.client.call({
242
+ method: 'GET',
243
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}`,
244
+ responseType: 'sylphx.data.v1.Database',
245
+ mutation: false,
246
+ });
247
+ }
248
+ /**
249
+ * Lists databases in a environment.
250
+ *
251
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/databases` · permission `data:read` · effect `read`
252
+ *
253
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
254
+ */
255
+ async list(request) {
256
+ return this.client.call({
257
+ method: 'GET',
258
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/databases`,
259
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
260
+ responseType: 'sylphx.data.v1.ListDatabasesResponse',
261
+ mutation: false,
262
+ });
263
+ }
264
+ /** Every item of every page of `list`. */
265
+ async *listAll(request) {
266
+ let next = request;
267
+ for (;;) {
268
+ const page = await this.list(next);
269
+ yield* page.databases ?? [];
270
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
271
+ return;
272
+ next = { ...request, pageToken: page.nextPageToken };
273
+ }
274
+ }
275
+ /**
276
+ * Creates a database. The Operation is done when the controller settles it.
277
+ *
278
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/databases` · permission `data:write` · effect `write`
279
+ *
280
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
281
+ */
282
+ async create(request) {
283
+ const operation = await this.client.call({
284
+ method: 'POST',
285
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/databases`,
286
+ query: { database_id: request.databaseId, validate_only: request.validateOnly },
287
+ body: request.database ?? {},
288
+ bodyType: 'sylphx.data.v1.Database',
289
+ responseType: 'sylphx.common.v1.Operation',
290
+ mutation: true,
291
+ });
292
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Database');
293
+ }
294
+ /**
295
+ * Updates a database.
296
+ *
297
+ * `PATCH /v1/{database.name=orgs/*\/projects/*\/envs/*\/databases/*}` · permission `data:write` · effect `write`
298
+ *
299
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
300
+ */
301
+ async update(request) {
302
+ const operation = await this.client.call({
303
+ method: 'PATCH',
304
+ path: `/v1/${runtime.pathParam(request.database?.name, 'orgs/*/projects/*/envs/*/databases/*', 'database.name')}`,
305
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
306
+ body: request.database ?? {},
307
+ bodyType: 'sylphx.data.v1.Database',
308
+ responseType: 'sylphx.common.v1.Operation',
309
+ mutation: true,
310
+ });
311
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Database');
312
+ }
313
+ /**
314
+ * Deletes a database. Fails while `spec.deletion_protection` is set.
315
+ *
316
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}` · permission `data:write` · effect `destructive`
317
+ *
318
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `DELETION_PROTECTED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
319
+ */
320
+ async delete(request) {
321
+ const operation = await this.client.call({
322
+ method: 'DELETE',
323
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}`,
324
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
325
+ responseType: 'sylphx.common.v1.Operation',
326
+ mutation: true,
327
+ });
328
+ return new runtime.Operation(this.client, operation, undefined);
329
+ }
330
+ /**
331
+ * Returns how to connect to the database: its endpoint and its own engine
332
+ * credentials. The credentials are not API keys and are returned only here.
333
+ *
334
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}:connect` · permission `data:write` · effect `read`
335
+ *
336
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
337
+ */
338
+ async connect(request) {
339
+ return this.client.call({
340
+ method: 'POST',
341
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}:connect`,
342
+ body: runtime.omit(request, ['name']),
343
+ bodyType: 'sylphx.data.v1.ConnectDatabaseRequest',
344
+ responseType: 'sylphx.data.v1.ConnectDatabaseResponse',
345
+ mutation: true,
346
+ });
347
+ }
348
+ /**
349
+ * Replaces the database's engine credentials; the old ones stop working once
350
+ * the new ones are served.
351
+ *
352
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}:rotateCredentials` · permission `data:write` · effect `write`
353
+ *
354
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
355
+ */
356
+ async rotateCredentials(request) {
357
+ const operation = await this.client.call({
358
+ method: 'POST',
359
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}:rotateCredentials`,
360
+ body: runtime.omit(request, ['name']),
361
+ bodyType: 'sylphx.data.v1.RotateDatabaseCredentialsRequest',
362
+ responseType: 'sylphx.common.v1.Operation',
363
+ mutation: true,
364
+ });
365
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Database');
366
+ }
367
+ /**
368
+ * Restores the database in place to a point in time inside its retention
369
+ * window; the database is unavailable while it restores.
370
+ *
371
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}:restore` · permission `data:write` · effect `destructive`
372
+ *
373
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
374
+ */
375
+ async restore(request) {
376
+ const operation = await this.client.call({
377
+ method: 'POST',
378
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}:restore`,
379
+ body: runtime.omit(request, ['name']),
380
+ bodyType: 'sylphx.data.v1.RestoreDatabaseRequest',
381
+ responseType: 'sylphx.common.v1.Operation',
382
+ mutation: true,
383
+ });
384
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Database');
385
+ }
386
+ }
387
+ /** `kv_namespaces` of Sylphx Data: Resource type `data.sylphx.com/KvNamespace`. */
388
+ export class KvNamespacesCollection {
389
+ client;
390
+ constructor(client) {
391
+ this.client = client;
392
+ }
393
+ /**
394
+ * Gets a kv namespace.
395
+ *
396
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}` · permission `data:read` · effect `read`
397
+ *
398
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
399
+ */
400
+ async get(request) {
401
+ return this.client.call({
402
+ method: 'GET',
403
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'name')}`,
404
+ responseType: 'sylphx.data.v1.KvNamespace',
405
+ mutation: false,
406
+ });
407
+ }
408
+ /**
409
+ * Lists kv namespaces in a environment.
410
+ *
411
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/kv_namespaces` · permission `data:read` · effect `read`
412
+ *
413
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
414
+ */
415
+ async list(request) {
416
+ return this.client.call({
417
+ method: 'GET',
418
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/kv_namespaces`,
419
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
420
+ responseType: 'sylphx.data.v1.ListKvNamespacesResponse',
421
+ mutation: false,
422
+ });
423
+ }
424
+ /** Every item of every page of `list`. */
425
+ async *listAll(request) {
426
+ let next = request;
427
+ for (;;) {
428
+ const page = await this.list(next);
429
+ yield* page.kvNamespaces ?? [];
430
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
431
+ return;
432
+ next = { ...request, pageToken: page.nextPageToken };
433
+ }
434
+ }
435
+ /**
436
+ * Creates a kv namespace. The Operation is done when the controller settles
437
+ * it.
438
+ *
439
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/kv_namespaces` · permission `data:write` · effect `write`
440
+ *
441
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
442
+ */
443
+ async create(request) {
444
+ const operation = await this.client.call({
445
+ method: 'POST',
446
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/kv_namespaces`,
447
+ query: { kv_namespace_id: request.kvNamespaceId, validate_only: request.validateOnly },
448
+ body: request.kvNamespace ?? {},
449
+ bodyType: 'sylphx.data.v1.KvNamespace',
450
+ responseType: 'sylphx.common.v1.Operation',
451
+ mutation: true,
452
+ });
453
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.KvNamespace');
454
+ }
455
+ /**
456
+ * Updates a kv namespace.
457
+ *
458
+ * `PATCH /v1/{kv_namespace.name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}` · permission `data:write` · effect `write`
459
+ *
460
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
461
+ */
462
+ async update(request) {
463
+ const operation = await this.client.call({
464
+ method: 'PATCH',
465
+ path: `/v1/${runtime.pathParam(request.kvNamespace?.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'kv_namespace.name')}`,
466
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
467
+ body: request.kvNamespace ?? {},
468
+ bodyType: 'sylphx.data.v1.KvNamespace',
469
+ responseType: 'sylphx.common.v1.Operation',
470
+ mutation: true,
471
+ });
472
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.KvNamespace');
473
+ }
474
+ /**
475
+ * Deletes a kv namespace. Fails while `spec.deletion_protection` is set.
476
+ *
477
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}` · permission `data:write` · effect `destructive`
478
+ *
479
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `DELETION_PROTECTED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
480
+ */
481
+ async delete(request) {
482
+ const operation = await this.client.call({
483
+ method: 'DELETE',
484
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'name')}`,
485
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
486
+ responseType: 'sylphx.common.v1.Operation',
487
+ mutation: true,
488
+ });
489
+ return new runtime.Operation(this.client, operation, undefined);
490
+ }
491
+ /**
492
+ * Returns how to connect to the KV namespace: its endpoint and its own
493
+ * engine credentials. The credentials are not API keys and are returned only
494
+ * here.
495
+ *
496
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}:connect` · permission `data:write` · effect `read`
497
+ *
498
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
499
+ */
500
+ async connect(request) {
501
+ return this.client.call({
502
+ method: 'POST',
503
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'name')}:connect`,
504
+ body: runtime.omit(request, ['name']),
505
+ bodyType: 'sylphx.data.v1.ConnectKvNamespaceRequest',
506
+ responseType: 'sylphx.data.v1.ConnectKvNamespaceResponse',
507
+ mutation: true,
508
+ });
509
+ }
510
+ /**
511
+ * Replaces the KV namespace's engine credentials; the old ones stop working
512
+ * once the new ones are served.
513
+ *
514
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}:rotateCredentials` · permission `data:write` · effect `write`
515
+ *
516
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
517
+ */
518
+ async rotateCredentials(request) {
519
+ const operation = await this.client.call({
520
+ method: 'POST',
521
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'name')}:rotateCredentials`,
522
+ body: runtime.omit(request, ['name']),
523
+ bodyType: 'sylphx.data.v1.RotateKvNamespaceCredentialsRequest',
524
+ responseType: 'sylphx.common.v1.Operation',
525
+ mutation: true,
526
+ });
527
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.KvNamespace');
528
+ }
529
+ }
530
+ /** `buckets` of Sylphx Data: Resource type `data.sylphx.com/Bucket`. */
531
+ export class BucketsCollection {
532
+ client;
533
+ constructor(client) {
534
+ this.client = client;
535
+ }
536
+ /**
537
+ * Gets a bucket.
538
+ *
539
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/buckets/*}` · permission `data:read` · effect `read`
540
+ *
541
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
542
+ */
543
+ async get(request) {
544
+ return this.client.call({
545
+ method: 'GET',
546
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/buckets/*', 'name')}`,
547
+ responseType: 'sylphx.data.v1.Bucket',
548
+ mutation: false,
549
+ });
550
+ }
551
+ /**
552
+ * Lists buckets in a environment.
553
+ *
554
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/buckets` · permission `data:read` · effect `read`
555
+ *
556
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
557
+ */
558
+ async list(request) {
559
+ return this.client.call({
560
+ method: 'GET',
561
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/buckets`,
562
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
563
+ responseType: 'sylphx.data.v1.ListBucketsResponse',
564
+ mutation: false,
565
+ });
566
+ }
567
+ /** Every item of every page of `list`. */
568
+ async *listAll(request) {
569
+ let next = request;
570
+ for (;;) {
571
+ const page = await this.list(next);
572
+ yield* page.buckets ?? [];
573
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
574
+ return;
575
+ next = { ...request, pageToken: page.nextPageToken };
576
+ }
577
+ }
578
+ /**
579
+ * Creates a bucket. The Operation is done when the controller settles it.
580
+ *
581
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/buckets` · permission `data:write` · effect `write`
582
+ *
583
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
584
+ */
585
+ async create(request) {
586
+ const operation = await this.client.call({
587
+ method: 'POST',
588
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/buckets`,
589
+ query: { bucket_id: request.bucketId, validate_only: request.validateOnly },
590
+ body: request.bucket ?? {},
591
+ bodyType: 'sylphx.data.v1.Bucket',
592
+ responseType: 'sylphx.common.v1.Operation',
593
+ mutation: true,
594
+ });
595
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Bucket');
596
+ }
597
+ /**
598
+ * Updates a bucket.
599
+ *
600
+ * `PATCH /v1/{bucket.name=orgs/*\/projects/*\/envs/*\/buckets/*}` · permission `data:write` · effect `write`
601
+ *
602
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
603
+ */
604
+ async update(request) {
605
+ const operation = await this.client.call({
606
+ method: 'PATCH',
607
+ path: `/v1/${runtime.pathParam(request.bucket?.name, 'orgs/*/projects/*/envs/*/buckets/*', 'bucket.name')}`,
608
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
609
+ body: request.bucket ?? {},
610
+ bodyType: 'sylphx.data.v1.Bucket',
611
+ responseType: 'sylphx.common.v1.Operation',
612
+ mutation: true,
613
+ });
614
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Bucket');
615
+ }
616
+ /**
617
+ * Deletes a bucket. Fails while `spec.deletion_protection` is set.
618
+ *
619
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/buckets/*}` · permission `data:write` · effect `destructive`
620
+ *
621
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `DELETION_PROTECTED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
622
+ */
623
+ async delete(request) {
624
+ const operation = await this.client.call({
625
+ method: 'DELETE',
626
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/buckets/*', 'name')}`,
627
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
628
+ responseType: 'sylphx.common.v1.Operation',
629
+ mutation: true,
630
+ });
631
+ return new runtime.Operation(this.client, operation, undefined);
632
+ }
633
+ /**
634
+ * Returns how to connect to the bucket: its endpoint and its own engine
635
+ * credentials. The credentials are not API keys and are returned only here.
636
+ *
637
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/buckets/*}:connect` · permission `data:write` · effect `read`
638
+ *
639
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
640
+ */
641
+ async connect(request) {
642
+ return this.client.call({
643
+ method: 'POST',
644
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/buckets/*', 'name')}:connect`,
645
+ body: runtime.omit(request, ['name']),
646
+ bodyType: 'sylphx.data.v1.ConnectBucketRequest',
647
+ responseType: 'sylphx.data.v1.ConnectBucketResponse',
648
+ mutation: true,
649
+ });
650
+ }
651
+ /**
652
+ * Replaces the bucket's engine credentials; the old ones stop working once
653
+ * the new ones are served.
654
+ *
655
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/buckets/*}:rotateCredentials` · permission `data:write` · effect `write`
656
+ *
657
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
658
+ */
659
+ async rotateCredentials(request) {
660
+ const operation = await this.client.call({
661
+ method: 'POST',
662
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/buckets/*', 'name')}:rotateCredentials`,
663
+ body: runtime.omit(request, ['name']),
664
+ bodyType: 'sylphx.data.v1.RotateBucketCredentialsRequest',
665
+ responseType: 'sylphx.common.v1.Operation',
666
+ mutation: true,
667
+ });
668
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Bucket');
669
+ }
670
+ }
671
+ /** `search_indexes` of Sylphx Data: Resource type `data.sylphx.com/SearchIndex`. */
672
+ export class SearchIndexesCollection {
673
+ client;
674
+ constructor(client) {
675
+ this.client = client;
676
+ }
677
+ /**
678
+ * Gets a search index.
679
+ *
680
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/search_indexes/*}` · permission `data:read` · effect `read`
681
+ *
682
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
683
+ */
684
+ async get(request) {
685
+ return this.client.call({
686
+ method: 'GET',
687
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'name')}`,
688
+ responseType: 'sylphx.data.v1.SearchIndex',
689
+ mutation: false,
690
+ });
691
+ }
692
+ /**
693
+ * Lists search indexs in a environment.
694
+ *
695
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/search_indexes` · permission `data:read` · effect `read`
696
+ *
697
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
698
+ */
699
+ async list(request) {
700
+ return this.client.call({
701
+ method: 'GET',
702
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/search_indexes`,
703
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
704
+ responseType: 'sylphx.data.v1.ListSearchIndexesResponse',
705
+ mutation: false,
706
+ });
707
+ }
708
+ /** Every item of every page of `list`. */
709
+ async *listAll(request) {
710
+ let next = request;
711
+ for (;;) {
712
+ const page = await this.list(next);
713
+ yield* page.searchIndexes ?? [];
714
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
715
+ return;
716
+ next = { ...request, pageToken: page.nextPageToken };
717
+ }
718
+ }
719
+ /**
720
+ * Creates a search index. The Operation is done when the controller settles
721
+ * it.
722
+ *
723
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/search_indexes` · permission `data:write` · effect `write`
724
+ *
725
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
726
+ */
727
+ async create(request) {
728
+ const operation = await this.client.call({
729
+ method: 'POST',
730
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/search_indexes`,
731
+ query: { search_index_id: request.searchIndexId, validate_only: request.validateOnly },
732
+ body: request.searchIndex ?? {},
733
+ bodyType: 'sylphx.data.v1.SearchIndex',
734
+ responseType: 'sylphx.common.v1.Operation',
735
+ mutation: true,
736
+ });
737
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.SearchIndex');
738
+ }
739
+ /**
740
+ * Updates a search index.
741
+ *
742
+ * `PATCH /v1/{search_index.name=orgs/*\/projects/*\/envs/*\/search_indexes/*}` · permission `data:write` · effect `write`
743
+ *
744
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
745
+ */
746
+ async update(request) {
747
+ const operation = await this.client.call({
748
+ method: 'PATCH',
749
+ path: `/v1/${runtime.pathParam(request.searchIndex?.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'search_index.name')}`,
750
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
751
+ body: request.searchIndex ?? {},
752
+ bodyType: 'sylphx.data.v1.SearchIndex',
753
+ responseType: 'sylphx.common.v1.Operation',
754
+ mutation: true,
755
+ });
756
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.SearchIndex');
757
+ }
758
+ /**
759
+ * Deletes a search index. Fails while `spec.deletion_protection` is set.
760
+ *
761
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/search_indexes/*}` · permission `data:write` · effect `destructive`
762
+ *
763
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `DELETION_PROTECTED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
764
+ */
765
+ async delete(request) {
766
+ const operation = await this.client.call({
767
+ method: 'DELETE',
768
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'name')}`,
769
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
770
+ responseType: 'sylphx.common.v1.Operation',
771
+ mutation: true,
772
+ });
773
+ return new runtime.Operation(this.client, operation, undefined);
774
+ }
775
+ /**
776
+ * Returns how to connect to the search index: its endpoint and its own
777
+ * engine credentials. The credentials are not API keys and are returned only
778
+ * here.
779
+ *
780
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/search_indexes/*}:connect` · permission `data:write` · effect `read`
781
+ *
782
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
783
+ */
784
+ async connect(request) {
785
+ return this.client.call({
786
+ method: 'POST',
787
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'name')}:connect`,
788
+ body: runtime.omit(request, ['name']),
789
+ bodyType: 'sylphx.data.v1.ConnectSearchIndexRequest',
790
+ responseType: 'sylphx.data.v1.ConnectSearchIndexResponse',
791
+ mutation: true,
792
+ });
793
+ }
794
+ /**
795
+ * Replaces the search index's engine credentials; the old ones stop working
796
+ * once the new ones are served.
797
+ *
798
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/search_indexes/*}:rotateCredentials` · permission `data:write` · effect `write`
799
+ *
800
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
801
+ */
802
+ async rotateCredentials(request) {
803
+ const operation = await this.client.call({
804
+ method: 'POST',
805
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'name')}:rotateCredentials`,
806
+ body: runtime.omit(request, ['name']),
807
+ bodyType: 'sylphx.data.v1.RotateSearchIndexCredentialsRequest',
808
+ responseType: 'sylphx.common.v1.Operation',
809
+ mutation: true,
810
+ });
811
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.SearchIndex');
812
+ }
813
+ }
814
+ //# sourceMappingURL=data.js.map