@scaleway/sdk-block 2.5.0 → 2.7.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.
@@ -2,210 +2,107 @@ import { SNAPSHOT_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES } from "./conten
2
2
  import { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalExportSnapshotToObjectStorageRequest, marshalImportSnapshotFromObjectStorageRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalSnapshot, unmarshalVolume } from "./marshalling.gen.js";
3
3
  import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
4
  //#region src/v1alpha1/api.gen.ts
5
- var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
6
  /**
7
7
  * Block Storage API.
8
8
 
9
9
  This API allows you to manage your Block Storage volumes.
10
10
  */
11
11
  var API = class extends API$1 {
12
- /**
13
- * Locality of this API.
14
- * type {'zone','region','global','unspecified'}
15
- */
16
- static LOCALITY = toApiLocality({ zones: [
17
- "fr-par-1",
18
- "fr-par-2",
19
- "fr-par-3",
20
- "nl-ams-1",
21
- "nl-ams-2",
22
- "nl-ams-3",
23
- "pl-waw-1",
24
- "pl-waw-2",
25
- "pl-waw-3"
26
- ] });
27
- pageOfListVolumeTypes = (request = {}) => this.client.fetch({
28
- method: "GET",
29
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volume-types`,
30
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
31
- }, unmarshalListVolumeTypesResponse);
32
- /**
33
- * List volume types. List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order.
34
- *
35
- * @param request - The request {@link ListVolumeTypesRequest}
36
- * @returns A Promise of ListVolumeTypesResponse
37
- */
38
- listVolumeTypes = (request = {}) => enrichForPagination("volumeTypes", this.pageOfListVolumeTypes, request);
39
- pageOfListVolumes = (request = {}) => this.client.fetch({
40
- method: "GET",
41
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`,
42
- urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["product_resource_id", request.productResourceId], ["project_id", request.projectId], ["tags", request.tags])
43
- }, unmarshalListVolumesResponse);
44
- /**
45
- * List volumes. List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
46
- *
47
- * @param request - The request {@link ListVolumesRequest}
48
- * @returns A Promise of ListVolumesResponse
49
- */
50
- listVolumes = (request = {}) => enrichForPagination("volumes", this.pageOfListVolumes, request);
51
- /**
52
- * Create a volume. To create a new volume from scratch, you must specify `from_empty` and the `size`.
53
- To create a volume from an existing snapshot, specify `from_snapshot` and the `snapshot_id` in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot.
54
- *
55
- * @param request - The request {@link CreateVolumeRequest}
56
- * @returns A Promise of Volume
57
- */
58
- createVolume = (request = {}) => this.client.fetch({
59
- body: JSON.stringify(marshalCreateVolumeRequest(request, this.client.settings)),
60
- headers: jsonContentHeaders,
61
- method: "POST",
62
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`
63
- }, unmarshalVolume);
64
- /**
65
- * Get a volume. Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response.
66
- *
67
- * @param request - The request {@link GetVolumeRequest}
68
- * @returns A Promise of Volume
69
- */
70
- getVolume = (request) => this.client.fetch({
71
- method: "GET",
72
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
73
- }, unmarshalVolume);
74
- /**
75
- * Waits for {@link Volume} to be in a final state.
76
- *
77
- * @param request - The request {@link GetVolumeRequest}
78
- * @param options - The waiting options
79
- * @returns A Promise of Volume
80
- */
81
- waitForVolume = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!VOLUME_TRANSIENT_STATUSES.includes(res.status))), this.getVolume, request, options);
82
- /**
83
- * Delete a detached volume. You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status.
84
- *
85
- * @param request - The request {@link DeleteVolumeRequest}
86
- */
87
- deleteVolume = (request) => this.client.fetch({
88
- method: "DELETE",
89
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
90
- });
91
- /**
92
- * Update a volume. Update the technical details of a volume, such as its name, tags, or its new size and `volume_type` (within the same Block Storage class).
93
- You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class.
94
- *
95
- * @param request - The request {@link UpdateVolumeRequest}
96
- * @returns A Promise of Volume
97
- */
98
- updateVolume = (request) => this.client.fetch({
99
- body: JSON.stringify(marshalUpdateVolumeRequest(request, this.client.settings)),
100
- headers: jsonContentHeaders,
101
- method: "PATCH",
102
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
103
- }, unmarshalVolume);
104
- pageOfListSnapshots = (request = {}) => this.client.fetch({
105
- method: "GET",
106
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`,
107
- urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags], ["volume_id", request.volumeId])
108
- }, unmarshalListSnapshotsResponse);
109
- /**
110
- * List all snapshots. List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
111
- *
112
- * @param request - The request {@link ListSnapshotsRequest}
113
- * @returns A Promise of ListSnapshotsResponse
114
- */
115
- listSnapshots = (request = {}) => enrichForPagination("snapshots", this.pageOfListSnapshots, request);
116
- /**
117
- * Get a snapshot. Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response.
118
- *
119
- * @param request - The request {@link GetSnapshotRequest}
120
- * @returns A Promise of Snapshot
121
- */
122
- getSnapshot = (request) => this.client.fetch({
123
- method: "GET",
124
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
125
- }, unmarshalSnapshot);
126
- /**
127
- * Waits for {@link Snapshot} to be in a final state.
128
- *
129
- * @param request - The request {@link GetSnapshotRequest}
130
- * @param options - The waiting options
131
- * @returns A Promise of Snapshot
132
- */
133
- waitForSnapshot = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), this.getSnapshot, request, options);
134
- /**
135
- * Create a snapshot of a volume. To create a snapshot, the volume must be in the `in_use` or the `available` status.
136
- If your volume is in a transient state, you need to wait until the end of the current operation.
137
- *
138
- * @param request - The request {@link CreateSnapshotRequest}
139
- * @returns A Promise of Snapshot
140
- */
141
- createSnapshot = (request) => this.client.fetch({
142
- body: JSON.stringify(marshalCreateSnapshotRequest(request, this.client.settings)),
143
- headers: jsonContentHeaders,
144
- method: "POST",
145
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`
146
- }, unmarshalSnapshot);
147
- /**
148
- * (Deprecated in favor of `ImportSnapshotFromObjectStorage`). Import a snapshot from a Scaleway Object Storage bucket
149
- The bucket must contain a QCOW2 image.
150
- The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
151
- *
152
- * @deprecated
153
- * @param request - The request {@link ImportSnapshotFromS3Request}
154
- * @returns A Promise of Snapshot
155
- */
156
- importSnapshotFromS3 = (request) => this.client.fetch({
157
- body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)),
158
- headers: jsonContentHeaders,
159
- method: "POST",
160
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`
161
- }, unmarshalSnapshot);
162
- /**
163
- * Import a snapshot from a Scaleway Object Storage bucket. The bucket must contain a QCOW2 image.
164
- The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
165
- *
166
- * @param request - The request {@link ImportSnapshotFromObjectStorageRequest}
167
- * @returns A Promise of Snapshot
168
- */
169
- importSnapshotFromObjectStorage = (request) => this.client.fetch({
170
- body: JSON.stringify(marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings)),
171
- headers: jsonContentHeaders,
172
- method: "POST",
173
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-object-storage`
174
- }, unmarshalSnapshot);
175
- /**
176
- * Export a snapshot to a Scaleway Object Storage bucket. The snapshot is exported in QCOW2 format.
177
- The snapshot must not be in transient state.
178
- *
179
- * @param request - The request {@link ExportSnapshotToObjectStorageRequest}
180
- * @returns A Promise of Snapshot
181
- */
182
- exportSnapshotToObjectStorage = (request) => this.client.fetch({
183
- body: JSON.stringify(marshalExportSnapshotToObjectStorageRequest(request, this.client.settings)),
184
- headers: jsonContentHeaders,
185
- method: "POST",
186
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}/export-to-object-storage`
187
- }, unmarshalSnapshot);
188
- /**
189
- * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.
190
- *
191
- * @param request - The request {@link DeleteSnapshotRequest}
192
- */
193
- deleteSnapshot = (request) => this.client.fetch({
194
- method: "DELETE",
195
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
196
- });
197
- /**
198
- * Update a snapshot. Update the name or tags of the snapshot.
199
- *
200
- * @param request - The request {@link UpdateSnapshotRequest}
201
- * @returns A Promise of Snapshot
202
- */
203
- updateSnapshot = (request) => this.client.fetch({
204
- body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),
205
- headers: jsonContentHeaders,
206
- method: "PATCH",
207
- path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
208
- }, unmarshalSnapshot);
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListVolumeTypes = (request = {}) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volume-types`,
17
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
18
+ }, unmarshalListVolumeTypesResponse);
19
+ this.listVolumeTypes = (request = {}) => enrichForPagination("volumeTypes", this.pageOfListVolumeTypes, request);
20
+ this.pageOfListVolumes = (request = {}) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`,
23
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["product_resource_id", request.productResourceId], ["project_id", request.projectId], ["tags", request.tags])
24
+ }, unmarshalListVolumesResponse);
25
+ this.listVolumes = (request = {}) => enrichForPagination("volumes", this.pageOfListVolumes, request);
26
+ this.createVolume = (request = {}) => this.client.fetch({
27
+ body: JSON.stringify(marshalCreateVolumeRequest(request, this.client.settings)),
28
+ headers: jsonContentHeaders,
29
+ method: "POST",
30
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`
31
+ }, unmarshalVolume);
32
+ this.getVolume = (request) => this.client.fetch({
33
+ method: "GET",
34
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
35
+ }, unmarshalVolume);
36
+ this.waitForVolume = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!VOLUME_TRANSIENT_STATUSES.includes(res.status))), this.getVolume, request, options);
37
+ this.deleteVolume = (request) => this.client.fetch({
38
+ method: "DELETE",
39
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
40
+ });
41
+ this.updateVolume = (request) => this.client.fetch({
42
+ body: JSON.stringify(marshalUpdateVolumeRequest(request, this.client.settings)),
43
+ headers: jsonContentHeaders,
44
+ method: "PATCH",
45
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam("volumeId", request.volumeId)}`
46
+ }, unmarshalVolume);
47
+ this.pageOfListSnapshots = (request = {}) => this.client.fetch({
48
+ method: "GET",
49
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`,
50
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags], ["volume_id", request.volumeId])
51
+ }, unmarshalListSnapshotsResponse);
52
+ this.listSnapshots = (request = {}) => enrichForPagination("snapshots", this.pageOfListSnapshots, request);
53
+ this.getSnapshot = (request) => this.client.fetch({
54
+ method: "GET",
55
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
56
+ }, unmarshalSnapshot);
57
+ this.waitForSnapshot = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), this.getSnapshot, request, options);
58
+ this.createSnapshot = (request) => this.client.fetch({
59
+ body: JSON.stringify(marshalCreateSnapshotRequest(request, this.client.settings)),
60
+ headers: jsonContentHeaders,
61
+ method: "POST",
62
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`
63
+ }, unmarshalSnapshot);
64
+ this.importSnapshotFromS3 = (request) => this.client.fetch({
65
+ body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)),
66
+ headers: jsonContentHeaders,
67
+ method: "POST",
68
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`
69
+ }, unmarshalSnapshot);
70
+ this.importSnapshotFromObjectStorage = (request) => this.client.fetch({
71
+ body: JSON.stringify(marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings)),
72
+ headers: jsonContentHeaders,
73
+ method: "POST",
74
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-object-storage`
75
+ }, unmarshalSnapshot);
76
+ this.exportSnapshotToObjectStorage = (request) => this.client.fetch({
77
+ body: JSON.stringify(marshalExportSnapshotToObjectStorageRequest(request, this.client.settings)),
78
+ headers: jsonContentHeaders,
79
+ method: "POST",
80
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}/export-to-object-storage`
81
+ }, unmarshalSnapshot);
82
+ this.deleteSnapshot = (request) => this.client.fetch({
83
+ method: "DELETE",
84
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
85
+ });
86
+ this.updateSnapshot = (request) => this.client.fetch({
87
+ body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),
88
+ headers: jsonContentHeaders,
89
+ method: "PATCH",
90
+ path: `/block/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
91
+ }, unmarshalSnapshot);
92
+ }
93
+ static {
94
+ this.LOCALITY = toApiLocality({ zones: [
95
+ "fr-par-1",
96
+ "fr-par-2",
97
+ "fr-par-3",
98
+ "nl-ams-1",
99
+ "nl-ams-2",
100
+ "nl-ams-3",
101
+ "pl-waw-1",
102
+ "pl-waw-2",
103
+ "pl-waw-3"
104
+ ] });
105
+ }
209
106
  };
210
107
  //#endregion
211
108
  export { API };
@@ -1,18 +1,18 @@
1
1
  //#region src/v1alpha1/content.gen.ts
2
2
  /** Lists transient statutes of the enum {@link ReferenceStatus}. */
3
- var REFERENCE_TRANSIENT_STATUSES = [
3
+ const REFERENCE_TRANSIENT_STATUSES = [
4
4
  "attaching",
5
5
  "detaching",
6
6
  "creating"
7
7
  ];
8
8
  /** Lists transient statutes of the enum {@link SnapshotStatus}. */
9
- var SNAPSHOT_TRANSIENT_STATUSES = [
9
+ const SNAPSHOT_TRANSIENT_STATUSES = [
10
10
  "creating",
11
11
  "deleting",
12
12
  "exporting"
13
13
  ];
14
14
  /** Lists transient statutes of the enum {@link VolumeStatus}. */
15
- var VOLUME_TRANSIENT_STATUSES = [
15
+ const VOLUME_TRANSIENT_STATUSES = [
16
16
  "creating",
17
17
  "deleting",
18
18
  "resizing",
@@ -1,7 +1,7 @@
1
1
  import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney } from "@scaleway/sdk-client";
2
2
  import randomName from "@scaleway/random-name";
3
3
  //#region src/v1alpha1/marshalling.gen.ts
4
- var unmarshalReference = (data) => {
4
+ const unmarshalReference = (data) => {
5
5
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Reference' failed as data isn't a dictionary.`);
6
6
  return {
7
7
  createdAt: unmarshalDate(data.created_at),
@@ -12,7 +12,7 @@ var unmarshalReference = (data) => {
12
12
  type: data.type
13
13
  };
14
14
  };
15
- var unmarshalSnapshotParentVolume = (data) => {
15
+ const unmarshalSnapshotParentVolume = (data) => {
16
16
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`);
17
17
  return {
18
18
  id: data.id,
@@ -21,7 +21,7 @@ var unmarshalSnapshotParentVolume = (data) => {
21
21
  type: data.type
22
22
  };
23
23
  };
24
- var unmarshalSnapshot = (data) => {
24
+ const unmarshalSnapshot = (data) => {
25
25
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
26
26
  return {
27
27
  class: data.class,
@@ -38,14 +38,14 @@ var unmarshalSnapshot = (data) => {
38
38
  zone: data.zone
39
39
  };
40
40
  };
41
- var unmarshalVolumeSpecifications = (data) => {
41
+ const unmarshalVolumeSpecifications = (data) => {
42
42
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`);
43
43
  return {
44
44
  class: data.class,
45
45
  perfIops: data.perf_iops
46
46
  };
47
47
  };
48
- var unmarshalVolume = (data) => {
48
+ const unmarshalVolume = (data) => {
49
49
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
50
50
  return {
51
51
  createdAt: unmarshalDate(data.created_at),
@@ -64,14 +64,14 @@ var unmarshalVolume = (data) => {
64
64
  zone: data.zone
65
65
  };
66
66
  };
67
- var unmarshalListSnapshotsResponse = (data) => {
67
+ const unmarshalListSnapshotsResponse = (data) => {
68
68
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
69
69
  return {
70
70
  snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
71
71
  totalCount: data.total_count
72
72
  };
73
73
  };
74
- var unmarshalVolumeType = (data) => {
74
+ const unmarshalVolumeType = (data) => {
75
75
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);
76
76
  return {
77
77
  pricing: data.pricing ? unmarshalMoney(data.pricing) : void 0,
@@ -80,32 +80,32 @@ var unmarshalVolumeType = (data) => {
80
80
  type: data.type
81
81
  };
82
82
  };
83
- var unmarshalListVolumeTypesResponse = (data) => {
83
+ const unmarshalListVolumeTypesResponse = (data) => {
84
84
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`);
85
85
  return {
86
86
  totalCount: data.total_count,
87
87
  volumeTypes: unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType)
88
88
  };
89
89
  };
90
- var unmarshalListVolumesResponse = (data) => {
90
+ const unmarshalListVolumesResponse = (data) => {
91
91
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`);
92
92
  return {
93
93
  totalCount: data.total_count,
94
94
  volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
95
95
  };
96
96
  };
97
- var marshalCreateSnapshotRequest = (request, defaults) => ({
97
+ const marshalCreateSnapshotRequest = (request, defaults) => ({
98
98
  name: request.name || randomName("snp"),
99
99
  project_id: request.projectId ?? defaults.defaultProjectId,
100
100
  tags: request.tags,
101
101
  volume_id: request.volumeId
102
102
  });
103
- var marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({ size: request.size });
104
- var marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
103
+ const marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({ size: request.size });
104
+ const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
105
105
  size: request.size,
106
106
  snapshot_id: request.snapshotId
107
107
  });
108
- var marshalCreateVolumeRequest = (request, defaults) => ({
108
+ const marshalCreateVolumeRequest = (request, defaults) => ({
109
109
  name: request.name || randomName("vol"),
110
110
  project_id: request.projectId ?? defaults.defaultProjectId,
111
111
  tags: request.tags,
@@ -121,11 +121,11 @@ var marshalCreateVolumeRequest = (request, defaults) => ({
121
121
  value: request.perfIops
122
122
  }])
123
123
  });
124
- var marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({
124
+ const marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({
125
125
  bucket: request.bucket,
126
126
  key: request.key
127
127
  });
128
- var marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({
128
+ const marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({
129
129
  bucket: request.bucket,
130
130
  key: request.key,
131
131
  name: request.name,
@@ -133,7 +133,7 @@ var marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({
133
133
  size: request.size,
134
134
  tags: request.tags
135
135
  });
136
- var marshalImportSnapshotFromS3Request = (request, defaults) => ({
136
+ const marshalImportSnapshotFromS3Request = (request, defaults) => ({
137
137
  bucket: request.bucket,
138
138
  key: request.key,
139
139
  name: request.name,
@@ -141,11 +141,11 @@ var marshalImportSnapshotFromS3Request = (request, defaults) => ({
141
141
  size: request.size,
142
142
  tags: request.tags
143
143
  });
144
- var marshalUpdateSnapshotRequest = (request, defaults) => ({
144
+ const marshalUpdateSnapshotRequest = (request, defaults) => ({
145
145
  name: request.name,
146
146
  tags: request.tags
147
147
  });
148
- var marshalUpdateVolumeRequest = (request, defaults) => ({
148
+ const marshalUpdateVolumeRequest = (request, defaults) => ({
149
149
  name: request.name,
150
150
  perf_iops: request.perfIops,
151
151
  size: request.size,
@@ -1,5 +1,5 @@
1
1
  //#region src/v1alpha1/metadata.gen.ts
2
- var queriesMetadata = {
2
+ const queriesMetadata = {
3
3
  namespace: "block",
4
4
  version: "v1alpha1",
5
5
  folderName: "blockv1alpha1",
@@ -10,31 +10,31 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
10
10
  ListVolumesRequest: () => ListVolumesRequest,
11
11
  Reference: () => Reference
12
12
  });
13
- var CreateSnapshotRequest = { name: { minLength: 1 } };
14
- var CreateVolumeRequest = { name: { minLength: 1 } };
15
- var ImportSnapshotFromObjectStorageRequest = { name: { minLength: 1 } };
16
- var ImportSnapshotFromS3Request = { name: { minLength: 1 } };
17
- var ListSnapshotsRequest = {
13
+ const CreateSnapshotRequest = { name: { minLength: 1 } };
14
+ const CreateVolumeRequest = { name: { minLength: 1 } };
15
+ const ImportSnapshotFromObjectStorageRequest = { name: { minLength: 1 } };
16
+ const ImportSnapshotFromS3Request = { name: { minLength: 1 } };
17
+ const ListSnapshotsRequest = {
18
18
  page: { greaterThan: 0 },
19
19
  pageSize: {
20
20
  greaterThan: 0,
21
21
  lessThanOrEqual: 100
22
22
  }
23
23
  };
24
- var ListVolumeTypesRequest = {
24
+ const ListVolumeTypesRequest = {
25
25
  page: { greaterThan: 0 },
26
26
  pageSize: {
27
27
  greaterThan: 0,
28
28
  lessThanOrEqual: 100
29
29
  }
30
30
  };
31
- var ListVolumesRequest = {
31
+ const ListVolumesRequest = {
32
32
  page: { greaterThan: 0 },
33
33
  pageSize: {
34
34
  greaterThan: 0,
35
35
  lessThanOrEqual: 100
36
36
  }
37
37
  };
38
- var Reference = { productResourceType: { minLength: 1 } };
38
+ const Reference = { productResourceType: { minLength: 1 } };
39
39
  //#endregion
40
40
  export { CreateSnapshotRequest, CreateVolumeRequest, ImportSnapshotFromObjectStorageRequest, ImportSnapshotFromS3Request, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest, Reference, validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-block",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "Scaleway SDK block",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -16,6 +16,14 @@
16
16
  "./*": {
17
17
  "types": "./dist/*/index.gen.d.ts",
18
18
  "default": "./dist/*/index.gen.js"
19
+ },
20
+ "./metadata": {
21
+ "types": "./dist/metadata.gen.d.ts",
22
+ "default": "./dist/metadata.gen.js"
23
+ },
24
+ "./*/metadata": {
25
+ "types": "./dist/*/metadata.gen.d.ts",
26
+ "default": "./dist/*/metadata.gen.js"
19
27
  }
20
28
  },
21
29
  "repository": {
@@ -27,18 +35,20 @@
27
35
  },
28
36
  "dependencies": {
29
37
  "@scaleway/random-name": "5.1.4",
30
- "@scaleway/sdk-std": "2.2.2"
38
+ "@scaleway/sdk-std": "2.4.0"
31
39
  },
32
40
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.2.2"
41
+ "@repo/configs": "^0.1.1",
42
+ "@scaleway/sdk-client": "^2.3.0"
34
43
  },
35
44
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.2.2"
45
+ "@scaleway/sdk-client": "^2.3.0",
46
+ "@repo/configs": "^0.1.1"
37
47
  },
38
48
  "scripts": {
39
49
  "package:check": "pnpm publint",
40
- "typecheck": "tsc --noEmit",
41
- "type:generate": "tsc --declaration -p tsconfig.build.json",
50
+ "typecheck": "tsgo --noEmit",
51
+ "type:generate": "tsgo --declaration -p tsconfig.build.json",
42
52
  "build": "vite build --config vite.config.ts && pnpm run type:generate",
43
53
  "build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
44
54
  }