@scaleway/sdk-block 2.9.0 → 2.9.2

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 (36) hide show
  1. package/LICENSE +191 -0
  2. package/package.json +9 -8
  3. package/dist/.vite/license.md +0 -3
  4. package/dist/_virtual/_rolldown/runtime.js +0 -13
  5. package/dist/index.gen.d.ts +0 -6
  6. package/dist/index.gen.js +0 -3
  7. package/dist/metadata.gen.d.ts +0 -12
  8. package/dist/metadata.gen.js +0 -13
  9. package/dist/v1/api.gen.d.ts +0 -137
  10. package/dist/v1/api.gen.js +0 -102
  11. package/dist/v1/content.gen.d.ts +0 -7
  12. package/dist/v1/content.gen.js +0 -23
  13. package/dist/v1/index.gen.d.ts +0 -5
  14. package/dist/v1/index.gen.js +0 -27
  15. package/dist/v1/marshalling.gen.d.ts +0 -14
  16. package/dist/v1/marshalling.gen.js +0 -153
  17. package/dist/v1/metadata.gen.d.ts +0 -61
  18. package/dist/v1/metadata.gen.js +0 -69
  19. package/dist/v1/types.gen.d.ts +0 -555
  20. package/dist/v1/types.gen.js +0 -0
  21. package/dist/v1/validation-rules.gen.d.ts +0 -47
  22. package/dist/v1/validation-rules.gen.js +0 -38
  23. package/dist/v1alpha1/api.gen.d.ts +0 -147
  24. package/dist/v1alpha1/api.gen.js +0 -108
  25. package/dist/v1alpha1/content.gen.d.ts +0 -7
  26. package/dist/v1alpha1/content.gen.js +0 -23
  27. package/dist/v1alpha1/index.gen.d.ts +0 -5
  28. package/dist/v1alpha1/index.gen.js +0 -27
  29. package/dist/v1alpha1/marshalling.gen.d.ts +0 -14
  30. package/dist/v1alpha1/marshalling.gen.js +0 -155
  31. package/dist/v1alpha1/metadata.gen.d.ts +0 -61
  32. package/dist/v1alpha1/metadata.gen.js +0 -69
  33. package/dist/v1alpha1/types.gen.d.ts +0 -545
  34. package/dist/v1alpha1/types.gen.js +0 -0
  35. package/dist/v1alpha1/validation-rules.gen.d.ts +0 -52
  36. package/dist/v1alpha1/validation-rules.gen.js +0 -40
@@ -1,153 +0,0 @@
1
- import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney } from "@scaleway/sdk-client";
2
- import randomName from "@scaleway/random-name";
3
- //#region src/v1/marshalling.gen.ts
4
- const unmarshalReference = (data) => {
5
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Reference' failed as data isn't a dictionary.`);
6
- return {
7
- createdAt: unmarshalDate(data.created_at),
8
- id: data.id,
9
- productResourceId: data.product_resource_id,
10
- productResourceType: data.product_resource_type,
11
- status: data.status,
12
- type: data.type
13
- };
14
- };
15
- const unmarshalSnapshotParentVolume = (data) => {
16
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`);
17
- return {
18
- id: data.id,
19
- name: data.name,
20
- status: data.status,
21
- type: data.type
22
- };
23
- };
24
- const unmarshalSnapshot = (data) => {
25
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
26
- return {
27
- class: data.class,
28
- createdAt: unmarshalDate(data.created_at),
29
- id: data.id,
30
- name: data.name,
31
- parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : void 0,
32
- projectId: data.project_id,
33
- public: data.public,
34
- references: unmarshalArrayOfObject(data.references, unmarshalReference),
35
- size: data.size,
36
- status: data.status,
37
- tags: data.tags,
38
- updatedAt: unmarshalDate(data.updated_at),
39
- zone: data.zone
40
- };
41
- };
42
- const unmarshalVolumeSpecifications = (data) => {
43
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`);
44
- return {
45
- class: data.class,
46
- perfIops: data.perf_iops
47
- };
48
- };
49
- const unmarshalVolume = (data) => {
50
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
51
- return {
52
- createdAt: unmarshalDate(data.created_at),
53
- id: data.id,
54
- kmsKeyId: data.kms_key_id,
55
- lastDetachedAt: unmarshalDate(data.last_detached_at),
56
- name: data.name,
57
- parentSnapshotId: data.parent_snapshot_id,
58
- projectId: data.project_id,
59
- references: unmarshalArrayOfObject(data.references, unmarshalReference),
60
- size: data.size,
61
- specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : void 0,
62
- status: data.status,
63
- tags: data.tags,
64
- type: data.type,
65
- updatedAt: unmarshalDate(data.updated_at),
66
- zone: data.zone
67
- };
68
- };
69
- const unmarshalListSnapshotsResponse = (data) => {
70
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
71
- return {
72
- snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
73
- totalCount: data.total_count
74
- };
75
- };
76
- const unmarshalVolumeType = (data) => {
77
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);
78
- return {
79
- pricing: data.pricing ? unmarshalMoney(data.pricing) : void 0,
80
- snapshotPricing: data.snapshot_pricing ? unmarshalMoney(data.snapshot_pricing) : void 0,
81
- specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : void 0,
82
- type: data.type,
83
- zone: data.zone
84
- };
85
- };
86
- const unmarshalListVolumeTypesResponse = (data) => {
87
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`);
88
- return {
89
- totalCount: data.total_count,
90
- volumeTypes: unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType)
91
- };
92
- };
93
- const unmarshalListVolumesResponse = (data) => {
94
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`);
95
- return {
96
- totalCount: data.total_count,
97
- volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
98
- };
99
- };
100
- const marshalCreateSnapshotRequest = (request, defaults) => ({
101
- name: request.name || randomName("snp"),
102
- project_id: request.projectId ?? defaults.defaultProjectId,
103
- public: request.public,
104
- tags: request.tags,
105
- volume_id: request.volumeId
106
- });
107
- const marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({ size: request.size });
108
- const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
109
- size: request.size,
110
- snapshot_id: request.snapshotId
111
- });
112
- const marshalCreateVolumeRequest = (request, defaults) => ({
113
- kms_key_id: request.kmsKeyId,
114
- name: request.name || randomName("vol"),
115
- project_id: request.projectId ?? defaults.defaultProjectId,
116
- tags: request.tags,
117
- ...resolveOneOf([{
118
- param: "from_empty",
119
- value: request.fromEmpty !== void 0 ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty, defaults) : void 0
120
- }, {
121
- param: "from_snapshot",
122
- value: request.fromSnapshot !== void 0 ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot, defaults) : void 0
123
- }]),
124
- ...resolveOneOf([{
125
- param: "perf_iops",
126
- value: request.perfIops
127
- }])
128
- });
129
- const marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({
130
- bucket: request.bucket,
131
- key: request.key
132
- });
133
- const marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({
134
- bucket: request.bucket,
135
- key: request.key,
136
- name: request.name,
137
- project_id: request.projectId ?? defaults.defaultProjectId,
138
- size: request.size,
139
- tags: request.tags
140
- });
141
- const marshalUpdateSnapshotRequest = (request, defaults) => ({
142
- name: request.name,
143
- public: request.public,
144
- tags: request.tags
145
- });
146
- const marshalUpdateVolumeRequest = (request, defaults) => ({
147
- name: request.name,
148
- perf_iops: request.perfIops,
149
- size: request.size,
150
- tags: request.tags
151
- });
152
- //#endregion
153
- export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalExportSnapshotToObjectStorageRequest, marshalImportSnapshotFromObjectStorageRequest, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalReference, unmarshalSnapshot, unmarshalVolume };
@@ -1,61 +0,0 @@
1
- export declare const queriesMetadata: {
2
- readonly namespace: 'block';
3
- readonly version: 'v1';
4
- readonly folderName: 'blockv1';
5
- readonly services: readonly [{
6
- readonly apiClass: 'API';
7
- readonly methods: readonly [{
8
- readonly methodName: 'listVolumeTypes';
9
- readonly protoName: 'ListVolumeTypes';
10
- readonly paramsType: 'ListVolumeTypesRequest';
11
- readonly returnType: 'ListVolumeTypesResponse';
12
- readonly isList: true;
13
- readonly paginationType: 'offset';
14
- readonly pageParamKey: 'page';
15
- readonly listItemType: 'VolumeType';
16
- readonly isPrivate: false;
17
- readonly description: '"';
18
- }, {
19
- readonly methodName: 'listVolumes';
20
- readonly protoName: 'ListVolumes';
21
- readonly paramsType: 'ListVolumesRequest';
22
- readonly returnType: 'ListVolumesResponse';
23
- readonly isList: true;
24
- readonly paginationType: 'offset';
25
- readonly pageParamKey: 'page';
26
- readonly listItemType: 'Volume';
27
- readonly isPrivate: false;
28
- readonly description: '"';
29
- }, {
30
- readonly methodName: 'getVolume';
31
- readonly protoName: 'GetVolume';
32
- readonly paramsType: 'GetVolumeRequest';
33
- readonly returnType: 'Volume';
34
- readonly isList: false;
35
- readonly paginationType: 'none';
36
- readonly isPrivate: false;
37
- readonly description: '"';
38
- }, {
39
- readonly methodName: 'listSnapshots';
40
- readonly protoName: 'ListSnapshots';
41
- readonly paramsType: 'ListSnapshotsRequest';
42
- readonly returnType: 'ListSnapshotsResponse';
43
- readonly isList: true;
44
- readonly paginationType: 'offset';
45
- readonly pageParamKey: 'page';
46
- readonly listItemType: 'Snapshot';
47
- readonly isPrivate: false;
48
- readonly description: '"';
49
- }, {
50
- readonly methodName: 'getSnapshot';
51
- readonly protoName: 'GetSnapshot';
52
- readonly paramsType: 'GetSnapshotRequest';
53
- readonly returnType: 'Snapshot';
54
- readonly isList: false;
55
- readonly paginationType: 'none';
56
- readonly isPrivate: false;
57
- readonly description: '"';
58
- }];
59
- }];
60
- };
61
- export type QueriesMetadata = typeof queriesMetadata;
@@ -1,69 +0,0 @@
1
- //#region src/v1/metadata.gen.ts
2
- const queriesMetadata = {
3
- namespace: "block",
4
- version: "v1",
5
- folderName: "blockv1",
6
- services: [{
7
- apiClass: "API",
8
- methods: [
9
- {
10
- methodName: "listVolumeTypes",
11
- protoName: "ListVolumeTypes",
12
- paramsType: "ListVolumeTypesRequest",
13
- returnType: "ListVolumeTypesResponse",
14
- isList: true,
15
- paginationType: "offset",
16
- pageParamKey: "page",
17
- listItemType: "VolumeType",
18
- isPrivate: false,
19
- description: "\""
20
- },
21
- {
22
- methodName: "listVolumes",
23
- protoName: "ListVolumes",
24
- paramsType: "ListVolumesRequest",
25
- returnType: "ListVolumesResponse",
26
- isList: true,
27
- paginationType: "offset",
28
- pageParamKey: "page",
29
- listItemType: "Volume",
30
- isPrivate: false,
31
- description: "\""
32
- },
33
- {
34
- methodName: "getVolume",
35
- protoName: "GetVolume",
36
- paramsType: "GetVolumeRequest",
37
- returnType: "Volume",
38
- isList: false,
39
- paginationType: "none",
40
- isPrivate: false,
41
- description: "\""
42
- },
43
- {
44
- methodName: "listSnapshots",
45
- protoName: "ListSnapshots",
46
- paramsType: "ListSnapshotsRequest",
47
- returnType: "ListSnapshotsResponse",
48
- isList: true,
49
- paginationType: "offset",
50
- pageParamKey: "page",
51
- listItemType: "Snapshot",
52
- isPrivate: false,
53
- description: "\""
54
- },
55
- {
56
- methodName: "getSnapshot",
57
- protoName: "GetSnapshot",
58
- paramsType: "GetSnapshotRequest",
59
- returnType: "Snapshot",
60
- isList: false,
61
- paginationType: "none",
62
- isPrivate: false,
63
- description: "\""
64
- }
65
- ]
66
- }]
67
- };
68
- //#endregion
69
- export { queriesMetadata };