@scaleway/sdk-serverless-sqldb 2.2.1 → 2.3.1

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.
package/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new ServerlessSqldb.v1.API(client)
83
83
  ## Support
84
84
 
85
85
  We love feedback! Feel free to reach us on:
86
+
86
87
  - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
88
  - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
89
 
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
93
94
  ## License
94
95
 
95
96
  This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
-
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __exportAll = (all, no_symbols) => {
3
+ let target = {};
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
+ return target;
10
+ };
11
+ export { __exportAll };
package/dist/index.gen.js CHANGED
@@ -1,4 +1,2 @@
1
- import * as index_gen from "./v1alpha1/index.gen.js";
2
- export {
3
- index_gen as ServerlessSqldbv1alpha1
4
- };
1
+ import { index_gen_exports } from "./v1alpha1/index.gen.js";
2
+ export { index_gen_exports as ServerlessSqldbv1alpha1 };
@@ -1,182 +1,127 @@
1
- import { API as API$1, toApiLocality, validatePathParam, waitForResource, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
1
  import { DATABASE_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { marshalCreateDatabaseRequest, unmarshalDatabase, unmarshalListDatabasesResponse, marshalUpdateDatabaseRequest, marshalRestoreDatabaseFromBackupRequest, unmarshalDatabaseBackup, unmarshalListDatabaseBackupsResponse } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
6
- };
7
- class API extends API$1 {
8
- /**
9
- * Locality of this API.
10
- * type ∈ {'zone','region','global','unspecified'}
11
- */
12
- static LOCALITY = toApiLocality({
13
- regions: [
14
- "fr-par"
15
- ]
16
- });
17
- /**
18
- * Create a new Serverless SQL Database. You must provide the following parameters: `organization_id`, `project_id`, `name`, `cpu_min`, `cpu_max`. You can also provide `from_backup_id` to create a database from a backup.
19
- *
20
- * @param request - The request {@link CreateDatabaseRequest}
21
- * @returns A Promise of Database
22
- */
23
- createDatabase = (request) => this.client.fetch(
24
- {
25
- body: JSON.stringify(
26
- marshalCreateDatabaseRequest(request, this.client.settings)
27
- ),
28
- headers: jsonContentHeaders,
29
- method: "POST",
30
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases`
31
- },
32
- unmarshalDatabase
33
- );
34
- /**
35
- * Get a database information. Retrieve information about your Serverless SQL Database. You must provide the `database_id` parameter.
36
- *
37
- * @param request - The request {@link GetDatabaseRequest}
38
- * @returns A Promise of Database
39
- */
40
- getDatabase = (request) => this.client.fetch(
41
- {
42
- method: "GET",
43
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
44
- },
45
- unmarshalDatabase
46
- );
47
- /**
48
- * Waits for {@link Database} to be in a final state.
49
- *
50
- * @param request - The request {@link GetDatabaseRequest}
51
- * @param options - The waiting options
52
- * @returns A Promise of Database
53
- */
54
- waitForDatabase = (request, options) => waitForResource(
55
- options?.stop ?? ((res) => Promise.resolve(!DATABASE_TRANSIENT_STATUSES.includes(res.status))),
56
- this.getDatabase,
57
- request,
58
- options
59
- );
60
- /**
61
- * Delete a database. Deletes a database. You must provide the `database_id` parameter. All data stored in the database will be permanently deleted.
62
- *
63
- * @param request - The request {@link DeleteDatabaseRequest}
64
- * @returns A Promise of Database
65
- */
66
- deleteDatabase = (request) => this.client.fetch(
67
- {
68
- method: "DELETE",
69
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
70
- },
71
- unmarshalDatabase
72
- );
73
- pageOfListDatabases = (request = {}) => this.client.fetch(
74
- {
75
- method: "GET",
76
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases`,
77
- urlParams: urlParams(
78
- ["name", request.name],
79
- ["order_by", request.orderBy],
80
- ["organization_id", request.organizationId],
81
- ["page", request.page],
82
- ["page_size", request.pageSize],
83
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
84
- )
85
- },
86
- unmarshalListDatabasesResponse
87
- );
88
- /**
89
- * List your Serverless SQL Databases. List all Serverless SQL Databases for a given Scaleway Organization or Scaleway Project. By default, the databases returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
90
- *
91
- * @param request - The request {@link ListDatabasesRequest}
92
- * @returns A Promise of ListDatabasesResponse
93
- */
94
- listDatabases = (request = {}) => enrichForPagination("databases", this.pageOfListDatabases, request);
95
- /**
96
- * Update database information. Update CPU limits of your Serverless SQL Database. You must provide the `database_id` parameter.
97
- *
98
- * @param request - The request {@link UpdateDatabaseRequest}
99
- * @returns A Promise of Database
100
- */
101
- updateDatabase = (request) => this.client.fetch(
102
- {
103
- body: JSON.stringify(
104
- marshalUpdateDatabaseRequest(request, this.client.settings)
105
- ),
106
- headers: jsonContentHeaders,
107
- method: "PATCH",
108
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
109
- },
110
- unmarshalDatabase
111
- );
112
- /**
113
- * Restore a database from a backup. Restore a database from a backup. You must provide the `backup_id` parameter.
114
- *
115
- * @param request - The request {@link RestoreDatabaseFromBackupRequest}
116
- * @returns A Promise of Database
117
- */
118
- restoreDatabaseFromBackup = (request) => this.client.fetch(
119
- {
120
- body: JSON.stringify(
121
- marshalRestoreDatabaseFromBackupRequest(request, this.client.settings)
122
- ),
123
- headers: jsonContentHeaders,
124
- method: "POST",
125
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}/restore`
126
- },
127
- unmarshalDatabase
128
- );
129
- /**
130
- * Get a database backup information. Retrieve information about your Serverless SQL Database backup. You must provide the `backup_id` parameter.
131
- *
132
- * @param request - The request {@link GetDatabaseBackupRequest}
133
- * @returns A Promise of DatabaseBackup
134
- */
135
- getDatabaseBackup = (request) => this.client.fetch(
136
- {
137
- method: "GET",
138
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam("backupId", request.backupId)}`
139
- },
140
- unmarshalDatabaseBackup
141
- );
142
- pageOfListDatabaseBackups = (request) => this.client.fetch(
143
- {
144
- method: "GET",
145
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups`,
146
- urlParams: urlParams(
147
- ["database_id", request.databaseId],
148
- ["order_by", request.orderBy],
149
- ["organization_id", request.organizationId],
150
- ["page", request.page],
151
- ["page_size", request.pageSize],
152
- ["project_id", request.projectId]
153
- )
154
- },
155
- unmarshalListDatabaseBackupsResponse
156
- );
157
- /**
158
- * List your Serverless SQL Database backups. List all Serverless SQL Database backups for a given Scaleway Project or Database. By default, the backups returned in the list are ordered by creation date in descending order, though this can be modified via the order_by field.
159
- *
160
- * @param request - The request {@link ListDatabaseBackupsRequest}
161
- * @returns A Promise of ListDatabaseBackupsResponse
162
- */
163
- listDatabaseBackups = (request) => enrichForPagination("backups", this.pageOfListDatabaseBackups, request);
164
- /**
165
- * Export a database backup. Export a database backup providing a download link once the export process is completed. You must provide the `backup_id` parameter.
166
- *
167
- * @param request - The request {@link ExportDatabaseBackupRequest}
168
- * @returns A Promise of DatabaseBackup
169
- */
170
- exportDatabaseBackup = (request) => this.client.fetch(
171
- {
172
- body: "{}",
173
- headers: jsonContentHeaders,
174
- method: "POST",
175
- path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam("backupId", request.backupId)}/export`
176
- },
177
- unmarshalDatabaseBackup
178
- );
179
- }
180
- export {
181
- API
2
+ import { marshalCreateDatabaseRequest, marshalRestoreDatabaseFromBackupRequest, marshalUpdateDatabaseRequest, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalListDatabaseBackupsResponse, unmarshalListDatabasesResponse } from "./marshalling.gen.js";
3
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ /**
6
+ * Serverless SQL Databases API.
7
+
8
+ This API allows you to manage your Serverless SQL Databases.
9
+ */
10
+ var API$1 = class extends API {
11
+ /**
12
+ * Locality of this API.
13
+ * type ∈ {'zone','region','global','unspecified'}
14
+ */
15
+ static LOCALITY = toApiLocality({ regions: ["fr-par"] });
16
+ /**
17
+ * Create a new Serverless SQL Database. You must provide the following parameters: `organization_id`, `project_id`, `name`, `cpu_min`, `cpu_max`. You can also provide `from_backup_id` to create a database from a backup.
18
+ *
19
+ * @param request - The request {@link CreateDatabaseRequest}
20
+ * @returns A Promise of Database
21
+ */
22
+ createDatabase = (request) => this.client.fetch({
23
+ body: JSON.stringify(marshalCreateDatabaseRequest(request, this.client.settings)),
24
+ headers: jsonContentHeaders,
25
+ method: "POST",
26
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases`
27
+ }, unmarshalDatabase);
28
+ /**
29
+ * Get a database information. Retrieve information about your Serverless SQL Database. You must provide the `database_id` parameter.
30
+ *
31
+ * @param request - The request {@link GetDatabaseRequest}
32
+ * @returns A Promise of Database
33
+ */
34
+ getDatabase = (request) => this.client.fetch({
35
+ method: "GET",
36
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
37
+ }, unmarshalDatabase);
38
+ /**
39
+ * Waits for {@link Database} to be in a final state.
40
+ *
41
+ * @param request - The request {@link GetDatabaseRequest}
42
+ * @param options - The waiting options
43
+ * @returns A Promise of Database
44
+ */
45
+ waitForDatabase = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DATABASE_TRANSIENT_STATUSES.includes(res.status))), this.getDatabase, request, options);
46
+ /**
47
+ * Delete a database. Deletes a database. You must provide the `database_id` parameter. All data stored in the database will be permanently deleted.
48
+ *
49
+ * @param request - The request {@link DeleteDatabaseRequest}
50
+ * @returns A Promise of Database
51
+ */
52
+ deleteDatabase = (request) => this.client.fetch({
53
+ method: "DELETE",
54
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
55
+ }, unmarshalDatabase);
56
+ pageOfListDatabases = (request = {}) => this.client.fetch({
57
+ method: "GET",
58
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases`,
59
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
60
+ }, unmarshalListDatabasesResponse);
61
+ /**
62
+ * List your Serverless SQL Databases. List all Serverless SQL Databases for a given Scaleway Organization or Scaleway Project. By default, the databases returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
63
+ *
64
+ * @param request - The request {@link ListDatabasesRequest}
65
+ * @returns A Promise of ListDatabasesResponse
66
+ */
67
+ listDatabases = (request = {}) => enrichForPagination("databases", this.pageOfListDatabases, request);
68
+ /**
69
+ * Update database information. Update CPU limits of your Serverless SQL Database. You must provide the `database_id` parameter.
70
+ *
71
+ * @param request - The request {@link UpdateDatabaseRequest}
72
+ * @returns A Promise of Database
73
+ */
74
+ updateDatabase = (request) => this.client.fetch({
75
+ body: JSON.stringify(marshalUpdateDatabaseRequest(request, this.client.settings)),
76
+ headers: jsonContentHeaders,
77
+ method: "PATCH",
78
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
79
+ }, unmarshalDatabase);
80
+ /**
81
+ * Restore a database from a backup. Restore a database from a backup. You must provide the `backup_id` parameter.
82
+ *
83
+ * @param request - The request {@link RestoreDatabaseFromBackupRequest}
84
+ * @returns A Promise of Database
85
+ */
86
+ restoreDatabaseFromBackup = (request) => this.client.fetch({
87
+ body: JSON.stringify(marshalRestoreDatabaseFromBackupRequest(request, this.client.settings)),
88
+ headers: jsonContentHeaders,
89
+ method: "POST",
90
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}/restore`
91
+ }, unmarshalDatabase);
92
+ /**
93
+ * Get a database backup information. Retrieve information about your Serverless SQL Database backup. You must provide the `backup_id` parameter.
94
+ *
95
+ * @param request - The request {@link GetDatabaseBackupRequest}
96
+ * @returns A Promise of DatabaseBackup
97
+ */
98
+ getDatabaseBackup = (request) => this.client.fetch({
99
+ method: "GET",
100
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam("backupId", request.backupId)}`
101
+ }, unmarshalDatabaseBackup);
102
+ pageOfListDatabaseBackups = (request) => this.client.fetch({
103
+ method: "GET",
104
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups`,
105
+ urlParams: urlParams(["database_id", request.databaseId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize], ["project_id", request.projectId])
106
+ }, unmarshalListDatabaseBackupsResponse);
107
+ /**
108
+ * List your Serverless SQL Database backups. List all Serverless SQL Database backups for a given Scaleway Project or Database. By default, the backups returned in the list are ordered by creation date in descending order, though this can be modified via the order_by field.
109
+ *
110
+ * @param request - The request {@link ListDatabaseBackupsRequest}
111
+ * @returns A Promise of ListDatabaseBackupsResponse
112
+ */
113
+ listDatabaseBackups = (request) => enrichForPagination("backups", this.pageOfListDatabaseBackups, request);
114
+ /**
115
+ * Export a database backup. Export a database backup providing a download link once the export process is completed. You must provide the `backup_id` parameter.
116
+ *
117
+ * @param request - The request {@link ExportDatabaseBackupRequest}
118
+ * @returns A Promise of DatabaseBackup
119
+ */
120
+ exportDatabaseBackup = (request) => this.client.fetch({
121
+ body: "{}",
122
+ headers: jsonContentHeaders,
123
+ method: "POST",
124
+ path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam("backupId", request.backupId)}/export`
125
+ }, unmarshalDatabaseBackup);
182
126
  };
127
+ export { API$1 as API };
@@ -1,8 +1,7 @@
1
+ /** Lists transient statutes of the enum {@link DatabaseStatus}. */
1
2
  const DATABASE_TRANSIENT_STATUSES = [
2
- "creating",
3
- "deleting",
4
- "restoring"
3
+ "creating",
4
+ "deleting",
5
+ "restoring"
5
6
  ];
6
- export {
7
- DATABASE_TRANSIENT_STATUSES
8
- };
7
+ export { DATABASE_TRANSIENT_STATUSES };
@@ -1,16 +1,18 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { DATABASE_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { marshalCreateDatabaseRequest, marshalRestoreDatabaseFromBackupRequest, marshalUpdateDatabaseRequest, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalListDatabaseBackupsResponse, unmarshalListDatabasesResponse } from "./marshalling.gen.js";
4
- import * as validationRules_gen from "./validation-rules.gen.js";
5
- export {
6
- API,
7
- DATABASE_TRANSIENT_STATUSES,
8
- validationRules_gen as ValidationRules,
9
- marshalCreateDatabaseRequest,
10
- marshalRestoreDatabaseFromBackupRequest,
11
- marshalUpdateDatabaseRequest,
12
- unmarshalDatabase,
13
- unmarshalDatabaseBackup,
14
- unmarshalListDatabaseBackupsResponse,
15
- unmarshalListDatabasesResponse
16
- };
4
+ import { API } from "./api.gen.js";
5
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
7
+ API: () => API,
8
+ DATABASE_TRANSIENT_STATUSES: () => DATABASE_TRANSIENT_STATUSES,
9
+ ValidationRules: () => validation_rules_gen_exports,
10
+ marshalCreateDatabaseRequest: () => marshalCreateDatabaseRequest,
11
+ marshalRestoreDatabaseFromBackupRequest: () => marshalRestoreDatabaseFromBackupRequest,
12
+ marshalUpdateDatabaseRequest: () => marshalUpdateDatabaseRequest,
13
+ unmarshalDatabase: () => unmarshalDatabase,
14
+ unmarshalDatabaseBackup: () => unmarshalDatabaseBackup,
15
+ unmarshalListDatabaseBackupsResponse: () => unmarshalListDatabaseBackupsResponse,
16
+ unmarshalListDatabasesResponse: () => unmarshalListDatabasesResponse
17
+ });
18
+ export { index_gen_exports };
@@ -1,89 +1,63 @@
1
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
2
  const unmarshalDatabaseBackup = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- createdAt: unmarshalDate(data.created_at),
10
- databaseId: data.database_id,
11
- dbSize: data.db_size,
12
- downloadUrl: data.download_url,
13
- downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at),
14
- expiresAt: unmarshalDate(data.expires_at),
15
- id: data.id,
16
- organizationId: data.organization_id,
17
- projectId: data.project_id,
18
- region: data.region,
19
- size: data.size,
20
- status: data.status
21
- };
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`);
4
+ return {
5
+ createdAt: unmarshalDate(data.created_at),
6
+ databaseId: data.database_id,
7
+ dbSize: data.db_size,
8
+ downloadUrl: data.download_url,
9
+ downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at),
10
+ expiresAt: unmarshalDate(data.expires_at),
11
+ id: data.id,
12
+ organizationId: data.organization_id,
13
+ projectId: data.project_id,
14
+ region: data.region,
15
+ size: data.size,
16
+ status: data.status
17
+ };
22
18
  };
23
19
  const unmarshalDatabase = (data) => {
24
- if (!isJSONObject(data)) {
25
- throw new TypeError(
26
- `Unmarshalling the type 'Database' failed as data isn't a dictionary.`
27
- );
28
- }
29
- return {
30
- cpuCurrent: data.cpu_current,
31
- cpuMax: data.cpu_max,
32
- cpuMin: data.cpu_min,
33
- createdAt: unmarshalDate(data.created_at),
34
- endpoint: data.endpoint,
35
- engineMajorVersion: data.engine_major_version,
36
- id: data.id,
37
- name: data.name,
38
- organizationId: data.organization_id,
39
- projectId: data.project_id,
40
- region: data.region,
41
- started: data.started,
42
- status: data.status
43
- };
20
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
21
+ return {
22
+ cpuCurrent: data.cpu_current,
23
+ cpuMax: data.cpu_max,
24
+ cpuMin: data.cpu_min,
25
+ createdAt: unmarshalDate(data.created_at),
26
+ endpoint: data.endpoint,
27
+ engineMajorVersion: data.engine_major_version,
28
+ id: data.id,
29
+ name: data.name,
30
+ organizationId: data.organization_id,
31
+ projectId: data.project_id,
32
+ region: data.region,
33
+ started: data.started,
34
+ status: data.status
35
+ };
44
36
  };
45
37
  const unmarshalListDatabaseBackupsResponse = (data) => {
46
- if (!isJSONObject(data)) {
47
- throw new TypeError(
48
- `Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`
49
- );
50
- }
51
- return {
52
- backups: unmarshalArrayOfObject(data.backups, unmarshalDatabaseBackup),
53
- totalCount: data.total_count
54
- };
38
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`);
39
+ return {
40
+ backups: unmarshalArrayOfObject(data.backups, unmarshalDatabaseBackup),
41
+ totalCount: data.total_count
42
+ };
55
43
  };
56
44
  const unmarshalListDatabasesResponse = (data) => {
57
- if (!isJSONObject(data)) {
58
- throw new TypeError(
59
- `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`
60
- );
61
- }
62
- return {
63
- databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
64
- totalCount: data.total_count
65
- };
45
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
46
+ return {
47
+ databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
48
+ totalCount: data.total_count
49
+ };
66
50
  };
67
51
  const marshalCreateDatabaseRequest = (request, defaults) => ({
68
- cpu_max: request.cpuMax,
69
- cpu_min: request.cpuMin,
70
- from_backup_id: request.fromBackupId,
71
- name: request.name,
72
- project_id: request.projectId ?? defaults.defaultProjectId
73
- });
74
- const marshalRestoreDatabaseFromBackupRequest = (request, defaults) => ({
75
- backup_id: request.backupId
52
+ cpu_max: request.cpuMax,
53
+ cpu_min: request.cpuMin,
54
+ from_backup_id: request.fromBackupId,
55
+ name: request.name,
56
+ project_id: request.projectId ?? defaults.defaultProjectId
76
57
  });
58
+ const marshalRestoreDatabaseFromBackupRequest = (request, defaults) => ({ backup_id: request.backupId });
77
59
  const marshalUpdateDatabaseRequest = (request, defaults) => ({
78
- cpu_max: request.cpuMax,
79
- cpu_min: request.cpuMin
60
+ cpu_max: request.cpuMax,
61
+ cpu_min: request.cpuMin
80
62
  });
81
- export {
82
- marshalCreateDatabaseRequest,
83
- marshalRestoreDatabaseFromBackupRequest,
84
- marshalUpdateDatabaseRequest,
85
- unmarshalDatabase,
86
- unmarshalDatabaseBackup,
87
- unmarshalListDatabaseBackupsResponse,
88
- unmarshalListDatabasesResponse
89
- };
63
+ export { marshalCreateDatabaseRequest, marshalRestoreDatabaseFromBackupRequest, marshalUpdateDatabaseRequest, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalListDatabaseBackupsResponse, unmarshalListDatabasesResponse };
@@ -1,62 +1,50 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
+ CreateDatabaseRequest: () => CreateDatabaseRequest,
4
+ Database: () => Database,
5
+ ListDatabaseBackupsRequest: () => ListDatabaseBackupsRequest,
6
+ ListDatabasesRequest: () => ListDatabasesRequest,
7
+ UpdateDatabaseRequest: () => UpdateDatabaseRequest
8
+ });
1
9
  const CreateDatabaseRequest = {
2
- cpuMax: {
3
- greaterThanOrEqual: 1,
4
- lessThanOrEqual: 15
5
- },
6
- cpuMin: {
7
- lessThanOrEqual: 15
8
- },
9
- fromBackupId: {
10
- ignoreEmpty: true
11
- },
12
- name: {
13
- maxLength: 63,
14
- minLength: 1
15
- }
10
+ cpuMax: {
11
+ greaterThanOrEqual: 1,
12
+ lessThanOrEqual: 15
13
+ },
14
+ cpuMin: { lessThanOrEqual: 15 },
15
+ fromBackupId: { ignoreEmpty: true },
16
+ name: {
17
+ maxLength: 63,
18
+ minLength: 1
19
+ }
16
20
  };
17
21
  const Database = {
18
- cpuCurrent: {
19
- lessThanOrEqual: 15
20
- },
21
- cpuMax: {
22
- greaterThanOrEqual: 1,
23
- lessThanOrEqual: 15
24
- },
25
- cpuMin: {
26
- lessThanOrEqual: 15
27
- }
22
+ cpuCurrent: { lessThanOrEqual: 15 },
23
+ cpuMax: {
24
+ greaterThanOrEqual: 1,
25
+ lessThanOrEqual: 15
26
+ },
27
+ cpuMin: { lessThanOrEqual: 15 }
28
28
  };
29
29
  const ListDatabaseBackupsRequest = {
30
- page: {
31
- greaterThanOrEqual: 1
32
- },
33
- pageSize: {
34
- greaterThanOrEqual: 1,
35
- lessThanOrEqual: 1e3
36
- }
30
+ page: { greaterThanOrEqual: 1 },
31
+ pageSize: {
32
+ greaterThanOrEqual: 1,
33
+ lessThanOrEqual: 1e3
34
+ }
37
35
  };
38
36
  const ListDatabasesRequest = {
39
- page: {
40
- greaterThanOrEqual: 1
41
- },
42
- pageSize: {
43
- greaterThanOrEqual: 1,
44
- lessThanOrEqual: 1e3
45
- }
37
+ page: { greaterThanOrEqual: 1 },
38
+ pageSize: {
39
+ greaterThanOrEqual: 1,
40
+ lessThanOrEqual: 1e3
41
+ }
46
42
  };
47
43
  const UpdateDatabaseRequest = {
48
- cpuMax: {
49
- greaterThanOrEqual: 1,
50
- lessThanOrEqual: 15
51
- },
52
- cpuMin: {
53
- lessThanOrEqual: 15
54
- }
55
- };
56
- export {
57
- CreateDatabaseRequest,
58
- Database,
59
- ListDatabaseBackupsRequest,
60
- ListDatabasesRequest,
61
- UpdateDatabaseRequest
44
+ cpuMax: {
45
+ greaterThanOrEqual: 1,
46
+ lessThanOrEqual: 15
47
+ },
48
+ cpuMin: { lessThanOrEqual: 15 }
62
49
  };
50
+ export { validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-serverless-sqldb",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "Scaleway SDK serverless-sqldb",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.1"
30
+ "@scaleway/sdk-std": "2.2.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.1"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",