@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.
@@ -0,0 +1,3 @@
1
+ # Licenses
2
+
3
+ The app does not bundle any dependencies with licenses.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export declare const pkgMetadata: {
6
+ readonly name: "@scaleway/sdk-block";
7
+ readonly namespace: "block";
8
+ readonly displayName: "Block";
9
+ readonly versions: readonly ["v1", "v1alpha1"];
10
+ };
11
+ export type Metadata = typeof pkgMetadata;
12
+ export default pkgMetadata;
@@ -0,0 +1,13 @@
1
+ //#region src/metadata.gen.ts
2
+ /**
3
+ * This file is automatically generated
4
+ * PLEASE DO NOT EDIT HERE
5
+ */
6
+ const pkgMetadata = {
7
+ name: "@scaleway/sdk-block",
8
+ namespace: "block",
9
+ displayName: "Block",
10
+ versions: ["v1", "v1alpha1"]
11
+ };
12
+ //#endregion
13
+ export { pkgMetadata as default, pkgMetadata };
@@ -56,7 +56,7 @@ export declare class API extends ParentAPI {
56
56
  * @param options - The waiting options
57
57
  * @returns A Promise of Volume
58
58
  */
59
- waitForVolume: (request: Readonly<GetVolumeRequest>, options?: Readonly<WaitForOptions<Volume>>) => Promise<Volume>;
59
+ waitForVolume: (request: Readonly<GetVolumeRequest>, options?: Readonly<WaitForOptions<Volume>> | undefined) => Promise<Volume>;
60
60
  /**
61
61
  * 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.
62
62
  *
@@ -96,7 +96,7 @@ export declare class API extends ParentAPI {
96
96
  * @param options - The waiting options
97
97
  * @returns A Promise of Snapshot
98
98
  */
99
- waitForSnapshot: (request: Readonly<GetSnapshotRequest>, options?: Readonly<WaitForOptions<Snapshot>>) => Promise<Snapshot>;
99
+ waitForSnapshot: (request: Readonly<GetSnapshotRequest>, options?: Readonly<WaitForOptions<Snapshot>> | undefined) => Promise<Snapshot>;
100
100
  /**
101
101
  * Create a snapshot of a volume. To create a snapshot, the volume must be in the `in_use` or the `available` status.
102
102
  If your volume is in a transient state, you need to wait until the end of the current operation.
@@ -2,195 +2,101 @@ import { SNAPSHOT_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES } from "./conten
2
2
  import { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalExportSnapshotToObjectStorageRequest, marshalImportSnapshotFromObjectStorageRequest, 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/v1/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/v1/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/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`,
42
- urlParams: urlParams(["include_deleted", request.includeDeleted], ["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], ["volume_ids", request.volumeIds], ["volume_type", request.volumeType])
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/v1/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/v1/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/v1/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/v1/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/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`,
107
- urlParams: urlParams(["include_deleted", request.includeDeleted], ["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/v1/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/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`
146
- }, unmarshalSnapshot);
147
- /**
148
- * Import a snapshot from a Scaleway Object Storage bucket. The bucket must contain a QCOW2 image.
149
- The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
150
- *
151
- * @param request - The request {@link ImportSnapshotFromObjectStorageRequest}
152
- * @returns A Promise of Snapshot
153
- */
154
- importSnapshotFromObjectStorage = (request) => this.client.fetch({
155
- body: JSON.stringify(marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings)),
156
- headers: jsonContentHeaders,
157
- method: "POST",
158
- path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-object-storage`
159
- }, unmarshalSnapshot);
160
- /**
161
- * Export a snapshot to a Scaleway Object Storage bucket. The snapshot is exported in QCOW2 format.
162
- The snapshot must not be in transient state.
163
- *
164
- * @param request - The request {@link ExportSnapshotToObjectStorageRequest}
165
- * @returns A Promise of Snapshot
166
- */
167
- exportSnapshotToObjectStorage = (request) => this.client.fetch({
168
- body: JSON.stringify(marshalExportSnapshotToObjectStorageRequest(request, this.client.settings)),
169
- headers: jsonContentHeaders,
170
- method: "POST",
171
- path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}/export-to-object-storage`
172
- }, unmarshalSnapshot);
173
- /**
174
- * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.
175
- *
176
- * @param request - The request {@link DeleteSnapshotRequest}
177
- */
178
- deleteSnapshot = (request) => this.client.fetch({
179
- method: "DELETE",
180
- path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
181
- });
182
- /**
183
- * Update a snapshot. Update the name or tags of the snapshot.
184
- *
185
- * @param request - The request {@link UpdateSnapshotRequest}
186
- * @returns A Promise of Snapshot
187
- */
188
- updateSnapshot = (request) => this.client.fetch({
189
- body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),
190
- headers: jsonContentHeaders,
191
- method: "PATCH",
192
- path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
193
- }, unmarshalSnapshot);
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListVolumeTypes = (request = {}) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/block/v1/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/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`,
23
+ urlParams: urlParams(["include_deleted", request.includeDeleted], ["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], ["volume_ids", request.volumeIds], ["volume_type", request.volumeType])
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/v1/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/v1/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/v1/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/v1/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/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`,
50
+ urlParams: urlParams(["include_deleted", request.includeDeleted], ["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/v1/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/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`
63
+ }, unmarshalSnapshot);
64
+ this.importSnapshotFromObjectStorage = (request) => this.client.fetch({
65
+ body: JSON.stringify(marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings)),
66
+ headers: jsonContentHeaders,
67
+ method: "POST",
68
+ path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-object-storage`
69
+ }, unmarshalSnapshot);
70
+ this.exportSnapshotToObjectStorage = (request) => this.client.fetch({
71
+ body: JSON.stringify(marshalExportSnapshotToObjectStorageRequest(request, this.client.settings)),
72
+ headers: jsonContentHeaders,
73
+ method: "POST",
74
+ path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}/export-to-object-storage`
75
+ }, unmarshalSnapshot);
76
+ this.deleteSnapshot = (request) => this.client.fetch({
77
+ method: "DELETE",
78
+ path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
79
+ });
80
+ this.updateSnapshot = (request) => this.client.fetch({
81
+ body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),
82
+ headers: jsonContentHeaders,
83
+ method: "PATCH",
84
+ path: `/block/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam("snapshotId", request.snapshotId)}`
85
+ }, unmarshalSnapshot);
86
+ }
87
+ static {
88
+ this.LOCALITY = toApiLocality({ zones: [
89
+ "fr-par-1",
90
+ "fr-par-2",
91
+ "fr-par-3",
92
+ "nl-ams-1",
93
+ "nl-ams-2",
94
+ "nl-ams-3",
95
+ "pl-waw-1",
96
+ "pl-waw-2",
97
+ "pl-waw-3"
98
+ ] });
99
+ }
194
100
  };
195
101
  //#endregion
196
102
  export { API };
@@ -1,18 +1,18 @@
1
1
  //#region src/v1/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/v1/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,
@@ -39,14 +39,14 @@ var unmarshalSnapshot = (data) => {
39
39
  zone: data.zone
40
40
  };
41
41
  };
42
- var unmarshalVolumeSpecifications = (data) => {
42
+ const unmarshalVolumeSpecifications = (data) => {
43
43
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`);
44
44
  return {
45
45
  class: data.class,
46
46
  perfIops: data.perf_iops
47
47
  };
48
48
  };
49
- var unmarshalVolume = (data) => {
49
+ const unmarshalVolume = (data) => {
50
50
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
51
51
  return {
52
52
  createdAt: unmarshalDate(data.created_at),
@@ -65,14 +65,14 @@ var unmarshalVolume = (data) => {
65
65
  zone: data.zone
66
66
  };
67
67
  };
68
- var unmarshalListSnapshotsResponse = (data) => {
68
+ const unmarshalListSnapshotsResponse = (data) => {
69
69
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
70
70
  return {
71
71
  snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
72
72
  totalCount: data.total_count
73
73
  };
74
74
  };
75
- var unmarshalVolumeType = (data) => {
75
+ const unmarshalVolumeType = (data) => {
76
76
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);
77
77
  return {
78
78
  pricing: data.pricing ? unmarshalMoney(data.pricing) : void 0,
@@ -81,33 +81,33 @@ var unmarshalVolumeType = (data) => {
81
81
  type: data.type
82
82
  };
83
83
  };
84
- var unmarshalListVolumeTypesResponse = (data) => {
84
+ const unmarshalListVolumeTypesResponse = (data) => {
85
85
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`);
86
86
  return {
87
87
  totalCount: data.total_count,
88
88
  volumeTypes: unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType)
89
89
  };
90
90
  };
91
- var unmarshalListVolumesResponse = (data) => {
91
+ const unmarshalListVolumesResponse = (data) => {
92
92
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`);
93
93
  return {
94
94
  totalCount: data.total_count,
95
95
  volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
96
96
  };
97
97
  };
98
- var marshalCreateSnapshotRequest = (request, defaults) => ({
98
+ const marshalCreateSnapshotRequest = (request, defaults) => ({
99
99
  name: request.name || randomName("snp"),
100
100
  project_id: request.projectId ?? defaults.defaultProjectId,
101
101
  public: request.public,
102
102
  tags: request.tags,
103
103
  volume_id: request.volumeId
104
104
  });
105
- var marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({ size: request.size });
106
- var marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
105
+ const marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({ size: request.size });
106
+ const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
107
107
  size: request.size,
108
108
  snapshot_id: request.snapshotId
109
109
  });
110
- var marshalCreateVolumeRequest = (request, defaults) => ({
110
+ const marshalCreateVolumeRequest = (request, defaults) => ({
111
111
  name: request.name || randomName("vol"),
112
112
  project_id: request.projectId ?? defaults.defaultProjectId,
113
113
  tags: request.tags,
@@ -123,11 +123,11 @@ var marshalCreateVolumeRequest = (request, defaults) => ({
123
123
  value: request.perfIops
124
124
  }])
125
125
  });
126
- var marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({
126
+ const marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({
127
127
  bucket: request.bucket,
128
128
  key: request.key
129
129
  });
130
- var marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({
130
+ const marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({
131
131
  bucket: request.bucket,
132
132
  key: request.key,
133
133
  name: request.name,
@@ -135,12 +135,12 @@ var marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({
135
135
  size: request.size,
136
136
  tags: request.tags
137
137
  });
138
- var marshalUpdateSnapshotRequest = (request, defaults) => ({
138
+ const marshalUpdateSnapshotRequest = (request, defaults) => ({
139
139
  name: request.name,
140
140
  public: request.public,
141
141
  tags: request.tags
142
142
  });
143
- var marshalUpdateVolumeRequest = (request, defaults) => ({
143
+ const marshalUpdateVolumeRequest = (request, defaults) => ({
144
144
  name: request.name,
145
145
  perf_iops: request.perfIops,
146
146
  size: request.size,
@@ -1,5 +1,5 @@
1
1
  //#region src/v1/metadata.gen.ts
2
- var queriesMetadata = {
2
+ const queriesMetadata = {
3
3
  namespace: "block",
4
4
  version: "v1",
5
5
  folderName: "blockv1",
@@ -9,30 +9,30 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
9
9
  ListVolumesRequest: () => ListVolumesRequest,
10
10
  Reference: () => Reference
11
11
  });
12
- var CreateSnapshotRequest = { name: { minLength: 1 } };
13
- var CreateVolumeRequest = { name: { minLength: 1 } };
14
- var ImportSnapshotFromObjectStorageRequest = { name: { minLength: 1 } };
15
- var ListSnapshotsRequest = {
12
+ const CreateSnapshotRequest = { name: { minLength: 1 } };
13
+ const CreateVolumeRequest = { name: { minLength: 1 } };
14
+ const ImportSnapshotFromObjectStorageRequest = { name: { minLength: 1 } };
15
+ const ListSnapshotsRequest = {
16
16
  page: { greaterThan: 0 },
17
17
  pageSize: {
18
18
  greaterThan: 0,
19
19
  lessThanOrEqual: 100
20
20
  }
21
21
  };
22
- var ListVolumeTypesRequest = {
22
+ const ListVolumeTypesRequest = {
23
23
  page: { greaterThan: 0 },
24
24
  pageSize: {
25
25
  greaterThan: 0,
26
26
  lessThanOrEqual: 100
27
27
  }
28
28
  };
29
- var ListVolumesRequest = {
29
+ const ListVolumesRequest = {
30
30
  page: { greaterThan: 0 },
31
31
  pageSize: {
32
32
  greaterThan: 0,
33
33
  lessThanOrEqual: 100
34
34
  }
35
35
  };
36
- var Reference = { productResourceType: { minLength: 1 } };
36
+ const Reference = { productResourceType: { minLength: 1 } };
37
37
  //#endregion
38
38
  export { CreateSnapshotRequest, CreateVolumeRequest, ImportSnapshotFromObjectStorageRequest, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest, Reference, validation_rules_gen_exports };
@@ -56,7 +56,7 @@ export declare class API extends ParentAPI {
56
56
  * @param options - The waiting options
57
57
  * @returns A Promise of Volume
58
58
  */
59
- waitForVolume: (request: Readonly<GetVolumeRequest>, options?: Readonly<WaitForOptions<Volume>>) => Promise<Volume>;
59
+ waitForVolume: (request: Readonly<GetVolumeRequest>, options?: Readonly<WaitForOptions<Volume>> | undefined) => Promise<Volume>;
60
60
  /**
61
61
  * 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.
62
62
  *
@@ -96,7 +96,7 @@ export declare class API extends ParentAPI {
96
96
  * @param options - The waiting options
97
97
  * @returns A Promise of Snapshot
98
98
  */
99
- waitForSnapshot: (request: Readonly<GetSnapshotRequest>, options?: Readonly<WaitForOptions<Snapshot>>) => Promise<Snapshot>;
99
+ waitForSnapshot: (request: Readonly<GetSnapshotRequest>, options?: Readonly<WaitForOptions<Snapshot>> | undefined) => Promise<Snapshot>;
100
100
  /**
101
101
  * Create a snapshot of a volume. To create a snapshot, the volume must be in the `in_use` or the `available` status.
102
102
  If your volume is in a transient state, you need to wait until the end of the current operation.