@scaleway/sdk 2.0.0-alpha.12 → 2.0.0-alpha.13

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 (204) hide show
  1. package/package.json +2 -2
  2. package/dist/api/account/index.js +0 -4
  3. package/dist/api/account/v2/api.gen.js +0 -147
  4. package/dist/api/account/v2/index.gen.js +0 -4
  5. package/dist/api/account/v2/marshalling.gen.js +0 -39
  6. package/dist/api/account/v3/api.gen.js +0 -129
  7. package/dist/api/account/v3/index.gen.js +0 -6
  8. package/dist/api/account/v3/marshalling.gen.js +0 -39
  9. package/dist/api/account/v3/validation-rules.gen.js +0 -39
  10. package/dist/api/applesilicon/index.js +0 -2
  11. package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
  12. package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
  13. package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
  14. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
  15. package/dist/api/baremetal/index.js +0 -2
  16. package/dist/api/baremetal/v1/api.gen.js +0 -523
  17. package/dist/api/baremetal/v1/api.utils.js +0 -27
  18. package/dist/api/baremetal/v1/content.gen.js +0 -13
  19. package/dist/api/baremetal/v1/index.js +0 -5
  20. package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
  21. package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
  22. package/dist/api/billing/index.js +0 -2
  23. package/dist/api/billing/v2alpha1/api.gen.js +0 -80
  24. package/dist/api/billing/v2alpha1/index.gen.js +0 -4
  25. package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
  26. package/dist/api/block/index.js +0 -2
  27. package/dist/api/block/v1alpha1/api.gen.js +0 -245
  28. package/dist/api/block/v1alpha1/content.gen.js +0 -13
  29. package/dist/api/block/v1alpha1/index.gen.js +0 -7
  30. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
  31. package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
  32. package/dist/api/cockpit/index.js +0 -2
  33. package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
  34. package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
  35. package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
  36. package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
  37. package/dist/api/container/index.js +0 -2
  38. package/dist/api/container/v1beta1/api.gen.js +0 -549
  39. package/dist/api/container/v1beta1/content.gen.js +0 -22
  40. package/dist/api/container/v1beta1/index.gen.js +0 -5
  41. package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
  42. package/dist/api/document_db/index.js +0 -2
  43. package/dist/api/document_db/v1beta1/api.gen.js +0 -830
  44. package/dist/api/document_db/v1beta1/content.gen.js +0 -19
  45. package/dist/api/document_db/v1beta1/index.gen.js +0 -7
  46. package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
  47. package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
  48. package/dist/api/domain/index.js +0 -2
  49. package/dist/api/domain/v2beta1/api.gen.js +0 -875
  50. package/dist/api/domain/v2beta1/content.gen.js +0 -28
  51. package/dist/api/domain/v2beta1/index.gen.js +0 -7
  52. package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
  53. package/dist/api/flexibleip/index.js +0 -2
  54. package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
  55. package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
  56. package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
  57. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
  58. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
  59. package/dist/api/function/index.js +0 -2
  60. package/dist/api/function/v1beta1/api.gen.js +0 -560
  61. package/dist/api/function/v1beta1/content.gen.js +0 -22
  62. package/dist/api/function/v1beta1/index.gen.js +0 -5
  63. package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
  64. package/dist/api/iam/index.js +0 -2
  65. package/dist/api/iam/v1alpha1/api.gen.js +0 -799
  66. package/dist/api/iam/v1alpha1/index.gen.js +0 -6
  67. package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
  68. package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
  69. package/dist/api/instance/index.js +0 -2
  70. package/dist/api/instance/v1/api.gen.js +0 -1003
  71. package/dist/api/instance/v1/api.utils.js +0 -369
  72. package/dist/api/instance/v1/content.gen.js +0 -31
  73. package/dist/api/instance/v1/index.js +0 -2
  74. package/dist/api/instance/v1/marshalling.gen.js +0 -1206
  75. package/dist/api/instance/v1/marshalling.utils.js +0 -63
  76. package/dist/api/iot/index.js +0 -2
  77. package/dist/api/iot/v1/api.gen.js +0 -581
  78. package/dist/api/iot/v1/content.gen.js +0 -7
  79. package/dist/api/iot/v1/index.gen.js +0 -5
  80. package/dist/api/iot/v1/marshalling.gen.js +0 -388
  81. package/dist/api/ipfs/index.js +0 -2
  82. package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
  83. package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
  84. package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
  85. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
  86. package/dist/api/k8s/index.js +0 -2
  87. package/dist/api/k8s/v1/api.gen.js +0 -454
  88. package/dist/api/k8s/v1/api.utils.js +0 -13
  89. package/dist/api/k8s/v1/content.gen.js +0 -13
  90. package/dist/api/k8s/v1/index.js +0 -4
  91. package/dist/api/k8s/v1/marshalling.gen.js +0 -333
  92. package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
  93. package/dist/api/lb/index.js +0 -2
  94. package/dist/api/lb/v1/api.gen.js +0 -1669
  95. package/dist/api/lb/v1/api.utils.js +0 -81
  96. package/dist/api/lb/v1/content.gen.js +0 -16
  97. package/dist/api/lb/v1/index.js +0 -2
  98. package/dist/api/lb/v1/marshalling.gen.js +0 -923
  99. package/dist/api/marketplace/index.js +0 -4
  100. package/dist/api/marketplace/v1/api.gen.js +0 -60
  101. package/dist/api/marketplace/v1/index.gen.js +0 -4
  102. package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
  103. package/dist/api/marketplace/v2/api.gen.js +0 -162
  104. package/dist/api/marketplace/v2/index.gen.js +0 -4
  105. package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
  106. package/dist/api/mnq/index.js +0 -2
  107. package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
  108. package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
  109. package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
  110. package/dist/api/rdb/index.js +0 -2
  111. package/dist/api/rdb/v1/api.gen.js +0 -972
  112. package/dist/api/rdb/v1/content.gen.js +0 -22
  113. package/dist/api/rdb/v1/index.gen.js +0 -7
  114. package/dist/api/rdb/v1/marshalling.gen.js +0 -636
  115. package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
  116. package/dist/api/redis/index.js +0 -2
  117. package/dist/api/redis/v1/api.gen.js +0 -389
  118. package/dist/api/redis/v1/content.gen.js +0 -7
  119. package/dist/api/redis/v1/index.gen.js +0 -5
  120. package/dist/api/redis/v1/marshalling.gen.js +0 -259
  121. package/dist/api/registry/index.js +0 -2
  122. package/dist/api/registry/v1/api.gen.js +0 -252
  123. package/dist/api/registry/v1/content.gen.js +0 -13
  124. package/dist/api/registry/v1/index.gen.js +0 -5
  125. package/dist/api/registry/v1/marshalling.gen.js +0 -106
  126. package/dist/api/secret/index.js +0 -2
  127. package/dist/api/secret/v1alpha1/api.gen.js +0 -415
  128. package/dist/api/secret/v1alpha1/index.gen.js +0 -4
  129. package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
  130. package/dist/api/tem/index.js +0 -2
  131. package/dist/api/tem/v1alpha1/api.gen.js +0 -229
  132. package/dist/api/tem/v1alpha1/content.gen.js +0 -10
  133. package/dist/api/tem/v1alpha1/index.gen.js +0 -5
  134. package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
  135. package/dist/api/test/index.js +0 -2
  136. package/dist/api/test/v1/api.gen.js +0 -152
  137. package/dist/api/test/v1/content.gen.js +0 -7
  138. package/dist/api/test/v1/index.gen.js +0 -5
  139. package/dist/api/test/v1/marshalling.gen.js +0 -79
  140. package/dist/api/vpc/index.js +0 -4
  141. package/dist/api/vpc/v1/api.gen.js +0 -110
  142. package/dist/api/vpc/v1/index.gen.js +0 -4
  143. package/dist/api/vpc/v1/marshalling.gen.js +0 -44
  144. package/dist/api/vpc/v2/api.gen.js +0 -276
  145. package/dist/api/vpc/v2/index.gen.js +0 -4
  146. package/dist/api/vpc/v2/marshalling.gen.js +0 -135
  147. package/dist/api/vpcgw/index.js +0 -2
  148. package/dist/api/vpcgw/v1/api.gen.js +0 -669
  149. package/dist/api/vpcgw/v1/content.gen.js +0 -10
  150. package/dist/api/vpcgw/v1/index.gen.js +0 -5
  151. package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
  152. package/dist/api/webhosting/index.js +0 -2
  153. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
  154. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
  155. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
  156. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
  157. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
  158. package/dist/helpers/is-browser.js +0 -5
  159. package/dist/helpers/is-response.js +0 -10
  160. package/dist/helpers/json.js +0 -11
  161. package/dist/helpers/marshalling.js +0 -130
  162. package/dist/index.cjs +0 -24364
  163. package/dist/index.d.ts +0 -27584
  164. package/dist/index.js +0 -69
  165. package/dist/internal/async/interval-retrier.js +0 -105
  166. package/dist/internal/async/sleep.js +0 -13
  167. package/dist/internal/interceptors/composer.js +0 -46
  168. package/dist/internal/interceptors/helpers.js +0 -32
  169. package/dist/internal/logger/console-logger.js +0 -38
  170. package/dist/internal/logger/index.js +0 -41
  171. package/dist/internal/logger/level-resolver.js +0 -13
  172. package/dist/internal/validations/string-validation.js +0 -38
  173. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
  174. package/dist/scw/api.js +0 -12
  175. package/dist/scw/auth.js +0 -68
  176. package/dist/scw/client-ini-factory.js +0 -174
  177. package/dist/scw/client-ini-profile.js +0 -54
  178. package/dist/scw/client-settings.js +0 -78
  179. package/dist/scw/client.js +0 -98
  180. package/dist/scw/constants.js +0 -4
  181. package/dist/scw/custom-marshalling.js +0 -131
  182. package/dist/scw/errors/error-parser.js +0 -107
  183. package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
  184. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
  185. package/dist/scw/errors/scw-error.js +0 -66
  186. package/dist/scw/errors/standard/already-exists-error.js +0 -26
  187. package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
  188. package/dist/scw/errors/standard/index.js +0 -13
  189. package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
  190. package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
  191. package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
  192. package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
  193. package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
  194. package/dist/scw/errors/standard/resource-expired-error.js +0 -26
  195. package/dist/scw/errors/standard/resource-locked-error.js +0 -25
  196. package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
  197. package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
  198. package/dist/scw/errors/standard/transient-state-error.js +0 -26
  199. package/dist/scw/errors/types.js +0 -23
  200. package/dist/scw/fetch/build-fetcher.js +0 -72
  201. package/dist/scw/fetch/http-dumper.js +0 -54
  202. package/dist/scw/fetch/http-interceptors.js +0 -99
  203. package/dist/scw/fetch/resource-paginator.js +0 -84
  204. package/dist/scw/fetch/response-parser.js +0 -72
@@ -1,245 +0,0 @@
1
- import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
- import { API as API$1 } from '../../../scw/api.js';
3
- import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
- import { VOLUME_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalUpdateSnapshotRequest } from './marshalling.gen.js';
7
-
8
- // This file was automatically generated. DO NOT EDIT.
9
- // If you have any remark or suggestion do not hesitate to open an issue.
10
- const jsonContentHeaders = {
11
- 'Content-Type': 'application/json; charset=utf-8'
12
- };
13
-
14
- /**
15
- * Scaleway Block Storage (SBS) API.
16
- *
17
- * This API allows you to use and manage your Block Storage volumes. Scaleway
18
- * Block Storage (SBS) API.
19
- */
20
- class API extends API$1 {
21
- /** Lists the available zones of the API. */
22
- static LOCALITIES = ['fr-par-1', 'pl-waw-3'];
23
- pageOfListVolumeTypes = (() => {
24
- var _this = this;
25
- return function (request) {
26
- if (request === void 0) {
27
- request = {};
28
- }
29
- return _this.client.fetch({
30
- method: 'GET',
31
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/volume-types`,
32
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
33
- }, unmarshalListVolumeTypesResponse);
34
- };
35
- })();
36
-
37
- /**
38
- * List volume types. List all available volume types in a specified zone. The
39
- * volume types listed are ordered by name in ascending order.
40
- *
41
- * @param request - The request {@link ListVolumeTypesRequest}
42
- * @returns A Promise of ListVolumeTypesResponse
43
- */
44
- listVolumeTypes = (() => {
45
- var _this2 = this;
46
- return function (request) {
47
- if (request === void 0) {
48
- request = {};
49
- }
50
- return enrichForPagination('volumeTypes', _this2.pageOfListVolumeTypes, request);
51
- };
52
- })();
53
- pageOfListVolumes = (() => {
54
- var _this3 = this;
55
- return function (request) {
56
- if (request === void 0) {
57
- request = {};
58
- }
59
- return _this3.client.fetch({
60
- method: 'GET',
61
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/volumes`,
62
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['product_resource_id', request.productResourceId], ['project_id', request.projectId])
63
- }, unmarshalListVolumesResponse);
64
- };
65
- })();
66
-
67
- /**
68
- * List volumes. List all existing volumes in a specified zone. By default,
69
- * the volume listed are ordered by creation date in ascending order. This can
70
- * be modified via the `order_by` field.
71
- *
72
- * @param request - The request {@link ListVolumesRequest}
73
- * @returns A Promise of ListVolumesResponse
74
- */
75
- listVolumes = (() => {
76
- var _this4 = this;
77
- return function (request) {
78
- if (request === void 0) {
79
- request = {};
80
- }
81
- return enrichForPagination('volumes', _this4.pageOfListVolumes, request);
82
- };
83
- })();
84
-
85
- /**
86
- * Create a new empty volume by specifying the `size`. To create a volume from
87
- * an existing snapshot, specify the `snapshot_id` in the request payload
88
- * instead, size is optional and can be specified if you need to extend the
89
- * original size. In that case the created volume will have the same volume
90
- * class (and underlying IOPS limitations) as the originating snapshot. You
91
- * can specify the desired performance of the volume by setting `requirements`
92
- * accordingly.
93
- *
94
- * @param request - The request {@link CreateVolumeRequest}
95
- * @returns A Promise of Volume
96
- */
97
- createVolume = request => this.client.fetch({
98
- body: JSON.stringify(marshalCreateVolumeRequest(request, this.client.settings)),
99
- headers: jsonContentHeaders,
100
- method: 'POST',
101
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`
102
- }, unmarshalVolume);
103
-
104
- /**
105
- * Get a volume. Retrieve technical information about a specific volume.
106
- * Details such as size, type, and status are returned in the response.
107
- *
108
- * @param request - The request {@link GetVolumeRequest}
109
- * @returns A Promise of Volume
110
- */
111
- getVolume = request => this.client.fetch({
112
- method: 'GET',
113
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`
114
- }, unmarshalVolume);
115
-
116
- /**
117
- * Waits for {@link Volume} to be in a final state.
118
- *
119
- * @param request - The request {@link GetVolumeRequest}
120
- * @param options - The waiting options
121
- * @returns A Promise of Volume
122
- */
123
- waitForVolume = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!VOLUME_TRANSIENT_STATUSES.includes(res.status))), this.getVolume, request, options);
124
-
125
- /**
126
- * Delete a detached volume. You must specify the `volume_id` of the volume
127
- * you want to delete. The volume must not be in the `in_use` status.
128
- *
129
- * @param request - The request {@link DeleteVolumeRequest}
130
- */
131
- deleteVolume = request => this.client.fetch({
132
- method: 'DELETE',
133
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`
134
- });
135
-
136
- /**
137
- * Update a volume. Update technical details about a volume, such as its name,
138
- * tags, or its new size and `volume_type` (within the same Block Storage
139
- * class). You can only resize a volume to a larger size. It is not possible
140
- * for now to change your Block Storage Class.
141
- *
142
- * @param request - The request {@link UpdateVolumeRequest}
143
- * @returns A Promise of Volume
144
- */
145
- updateVolume = request => this.client.fetch({
146
- body: JSON.stringify(marshalUpdateVolumeRequest(request, this.client.settings)),
147
- headers: jsonContentHeaders,
148
- method: 'PATCH',
149
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`
150
- }, unmarshalVolume);
151
- pageOfListSnapshots = (() => {
152
- var _this5 = this;
153
- return function (request) {
154
- if (request === void 0) {
155
- request = {};
156
- }
157
- return _this5.client.fetch({
158
- method: 'GET',
159
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this5.client.settings.defaultZone)}/snapshots`,
160
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId], ['volume_id', request.volumeId])
161
- }, unmarshalListSnapshotsResponse);
162
- };
163
- })();
164
-
165
- /**
166
- * List all snapshots. List all available snapshots in a specified zone. By
167
- * default, the snapshots listed are ordered by creation date in ascending
168
- * order. This can be modified via the `order_by` field.
169
- *
170
- * @param request - The request {@link ListSnapshotsRequest}
171
- * @returns A Promise of ListSnapshotsResponse
172
- */
173
- listSnapshots = (() => {
174
- var _this6 = this;
175
- return function (request) {
176
- if (request === void 0) {
177
- request = {};
178
- }
179
- return enrichForPagination('snapshots', _this6.pageOfListSnapshots, request);
180
- };
181
- })();
182
-
183
- /**
184
- * Get a snapshot. Retrieve technical information about a specific snapshot.
185
- * Details such as size, volume type, and status are returned in the
186
- * response.
187
- *
188
- * @param request - The request {@link GetSnapshotRequest}
189
- * @returns A Promise of Snapshot
190
- */
191
- getSnapshot = request => this.client.fetch({
192
- method: 'GET',
193
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
194
- }, unmarshalSnapshot);
195
-
196
- /**
197
- * Waits for {@link Snapshot} to be in a final state.
198
- *
199
- * @param request - The request {@link GetSnapshotRequest}
200
- * @param options - The waiting options
201
- * @returns A Promise of Snapshot
202
- */
203
- waitForSnapshot = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), this.getSnapshot, request, options);
204
-
205
- /**
206
- * Create a snapshot of a volume. To create a snapshot, the volume must be in
207
- * the `in_use` or the `available` status. If your volume is in a transient
208
- * state, you need to wait until the end of the current operation.
209
- *
210
- * @param request - The request {@link CreateSnapshotRequest}
211
- * @returns A Promise of Snapshot
212
- */
213
- createSnapshot = request => this.client.fetch({
214
- body: JSON.stringify(marshalCreateSnapshotRequest(request, this.client.settings)),
215
- headers: jsonContentHeaders,
216
- method: 'POST',
217
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`
218
- }, unmarshalSnapshot);
219
-
220
- /**
221
- * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you
222
- * want to delete. The snapshot must not be in use.
223
- *
224
- * @param request - The request {@link DeleteSnapshotRequest}
225
- */
226
- deleteSnapshot = request => this.client.fetch({
227
- method: 'DELETE',
228
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
229
- });
230
-
231
- /**
232
- * Update a snapshot. Update name or tags of the snapshot.
233
- *
234
- * @param request - The request {@link UpdateSnapshotRequest}
235
- * @returns A Promise of Snapshot
236
- */
237
- updateSnapshot = request => this.client.fetch({
238
- body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),
239
- headers: jsonContentHeaders,
240
- method: 'PATCH',
241
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`
242
- }, unmarshalSnapshot);
243
- }
244
-
245
- export { API };
@@ -1,13 +0,0 @@
1
- // This file was automatically generated. DO NOT EDIT.
2
- // If you have any remark or suggestion do not hesitate to open an issue.
3
-
4
- /** Lists transient statutes of the enum {@link ReferenceStatus}. */
5
- const REFERENCE_TRANSIENT_STATUSES = ['attaching', 'detaching', 'snapshotting'];
6
-
7
- /** Lists transient statutes of the enum {@link SnapshotStatus}. */
8
- const SNAPSHOT_TRANSIENT_STATUSES = ['creating', 'deleting'];
9
-
10
- /** Lists transient statutes of the enum {@link VolumeStatus}. */
11
- const VOLUME_TRANSIENT_STATUSES = ['creating', 'deleting', 'resizing', 'snapshotting'];
12
-
13
- export { REFERENCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES };
@@ -1,7 +0,0 @@
1
- export { API } from './api.gen.js';
2
- export { REFERENCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, VOLUME_TRANSIENT_STATUSES } from './content.gen.js';
3
- import * as validationRules_gen from './validation-rules.gen.js';
4
- export { validationRules_gen as ValidationRules };
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,175 +0,0 @@
1
- import { isJSONObject } from '../../../helpers/json.js';
2
- import { unmarshalMoney } from '../../../scw/custom-marshalling.js';
3
- import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
-
5
- // This file was automatically generated. DO NOT EDIT.
6
- // If you have any remark or suggestion do not hesitate to open an issue.
7
- const unmarshalReference = data => {
8
- if (!isJSONObject(data)) {
9
- throw new TypeError(`Unmarshalling the type 'Reference' failed as data isn't a dictionary.`);
10
- }
11
- return {
12
- createdAt: unmarshalDate(data.created_at),
13
- id: data.id,
14
- productResourceId: data.product_resource_id,
15
- productResourceType: data.product_resource_type,
16
- status: data.status,
17
- type: data.type
18
- };
19
- };
20
- const unmarshalSnapshotParentVolume = data => {
21
- if (!isJSONObject(data)) {
22
- throw new TypeError(`Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`);
23
- }
24
- return {
25
- id: data.id,
26
- name: data.name,
27
- status: data.status,
28
- type: data.type
29
- };
30
- };
31
- const unmarshalVolumeSpecifications = data => {
32
- if (!isJSONObject(data)) {
33
- throw new TypeError(`Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`);
34
- }
35
- return {
36
- class: data.class,
37
- perfIops: data.perf_iops
38
- };
39
- };
40
- const unmarshalSnapshotSummary = data => {
41
- if (!isJSONObject(data)) {
42
- throw new TypeError(`Unmarshalling the type 'SnapshotSummary' failed as data isn't a dictionary.`);
43
- }
44
- return {
45
- class: data.class,
46
- createdAt: unmarshalDate(data.created_at),
47
- id: data.id,
48
- name: data.name,
49
- parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined,
50
- projectId: data.project_id,
51
- size: data.size,
52
- status: data.status,
53
- tags: data.tags,
54
- updatedAt: unmarshalDate(data.updated_at),
55
- zone: data.zone
56
- };
57
- };
58
- const unmarshalVolume = data => {
59
- if (!isJSONObject(data)) {
60
- throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
61
- }
62
- return {
63
- createdAt: unmarshalDate(data.created_at),
64
- id: data.id,
65
- name: data.name,
66
- parentSnapshotId: data.parent_snapshot_id,
67
- projectId: data.project_id,
68
- references: unmarshalArrayOfObject(data.references, unmarshalReference),
69
- size: data.size,
70
- specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,
71
- status: data.status,
72
- tags: data.tags,
73
- type: data.type,
74
- updatedAt: unmarshalDate(data.updated_at),
75
- zone: data.zone
76
- };
77
- };
78
- const unmarshalVolumeType = data => {
79
- if (!isJSONObject(data)) {
80
- throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);
81
- }
82
- return {
83
- pricing: data.pricing ? unmarshalMoney(data.pricing) : undefined,
84
- snapshotPricing: data.snapshot_pricing ? unmarshalMoney(data.snapshot_pricing) : undefined,
85
- specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,
86
- type: data.type
87
- };
88
- };
89
- const unmarshalListSnapshotsResponse = data => {
90
- if (!isJSONObject(data)) {
91
- throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
92
- }
93
- return {
94
- snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshotSummary),
95
- totalCount: data.total_count
96
- };
97
- };
98
- const unmarshalListVolumeTypesResponse = data => {
99
- if (!isJSONObject(data)) {
100
- throw new TypeError(`Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`);
101
- }
102
- return {
103
- totalCount: data.total_count,
104
- volumeTypes: unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType)
105
- };
106
- };
107
- const unmarshalListVolumesResponse = data => {
108
- if (!isJSONObject(data)) {
109
- throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`);
110
- }
111
- return {
112
- totalCount: data.total_count,
113
- volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
114
- };
115
- };
116
- const unmarshalSnapshot = data => {
117
- if (!isJSONObject(data)) {
118
- throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
119
- }
120
- return {
121
- class: data.class,
122
- createdAt: unmarshalDate(data.created_at),
123
- id: data.id,
124
- name: data.name,
125
- parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined,
126
- projectId: data.project_id,
127
- references: unmarshalArrayOfObject(data.references, unmarshalReference),
128
- size: data.size,
129
- status: data.status,
130
- tags: data.tags,
131
- updatedAt: unmarshalDate(data.updated_at),
132
- zone: data.zone
133
- };
134
- };
135
- const marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({
136
- size: request.size
137
- });
138
- const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
139
- size: request.size,
140
- snapshot_id: request.snapshotId
141
- });
142
- const marshalCreateSnapshotRequest = (request, defaults) => ({
143
- name: request.name,
144
- project_id: request.projectId ?? defaults.defaultProjectId,
145
- tags: request.tags,
146
- volume_id: request.volumeId
147
- });
148
- const marshalCreateVolumeRequest = (request, defaults) => ({
149
- name: request.name,
150
- project_id: request.projectId ?? defaults.defaultProjectId,
151
- tags: request.tags,
152
- ...resolveOneOf([{
153
- param: 'from_empty',
154
- value: request.fromEmpty ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty) : undefined
155
- }, {
156
- param: 'from_snapshot',
157
- value: request.fromSnapshot ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot) : undefined
158
- }]),
159
- ...resolveOneOf([{
160
- param: 'perf_iops',
161
- value: request.perfIops
162
- }], true)
163
- });
164
- const marshalUpdateSnapshotRequest = (request, defaults) => ({
165
- name: request.name,
166
- tags: request.tags
167
- });
168
- const marshalUpdateVolumeRequest = (request, defaults) => ({
169
- name: request.name,
170
- perf_iops: request.perfIops,
171
- size: request.size,
172
- tags: request.tags
173
- });
174
-
175
- export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalSnapshot, unmarshalVolume };
@@ -1,42 +0,0 @@
1
- // This file was automatically generated. DO NOT EDIT.
2
- // If you have any remark or suggestion do not hesitate to open an issue.
3
-
4
- const CreateSnapshotRequest = {
5
- name: {
6
- minLength: 1
7
- }
8
- };
9
- const CreateVolumeRequest = {
10
- name: {
11
- minLength: 1
12
- }
13
- };
14
- const ListSnapshotsRequest = {
15
- page: {
16
- greaterThan: 0
17
- },
18
- pageSize: {
19
- greaterThan: 0,
20
- lessThanOrEqual: 100
21
- }
22
- };
23
- const ListVolumeTypesRequest = {
24
- page: {
25
- greaterThan: 0
26
- },
27
- pageSize: {
28
- greaterThan: 0,
29
- lessThanOrEqual: 100
30
- }
31
- };
32
- const ListVolumesRequest = {
33
- page: {
34
- greaterThan: 0
35
- },
36
- pageSize: {
37
- greaterThan: 0,
38
- lessThanOrEqual: 100
39
- }
40
- };
41
-
42
- export { CreateSnapshotRequest, CreateVolumeRequest, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1beta1/index.gen.js';
2
- export { index_gen as v1beta1 };