@scaleway/sdk 2.0.0-alpha.11 → 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,110 +0,0 @@
1
- import { API as API$1 } from '../../../scw/api.js';
2
- import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
3
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest } from './marshalling.gen.js';
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.
8
- const jsonContentHeaders = {
9
- 'Content-Type': 'application/json; charset=utf-8'
10
- };
11
-
12
- /** VPC API. */
13
- class API extends API$1 {
14
- /** Lists the available zones of the API. */
15
- static LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2'];
16
- pageOfListPrivateNetworks = (() => {
17
- var _this = this;
18
- return function (request) {
19
- if (request === void 0) {
20
- request = {};
21
- }
22
- return _this.client.fetch({
23
- method: 'GET',
24
- path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/private-networks`,
25
- urlParams: urlParams(['include_regional', request.includeRegional], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags])
26
- }, unmarshalListPrivateNetworksResponse);
27
- };
28
- })();
29
-
30
- /**
31
- * List Private Networks. List existing Private Networks in a specified
32
- * Availability Zone. By default, the Private Networks returned in the list
33
- * are ordered by creation date in ascending order, though this can be
34
- * modified via the order_by field.
35
- *
36
- * @param request - The request {@link ListPrivateNetworksRequest}
37
- * @returns A Promise of ListPrivateNetworksResponse
38
- */
39
- listPrivateNetworks = (() => {
40
- var _this2 = this;
41
- return function (request) {
42
- if (request === void 0) {
43
- request = {};
44
- }
45
- return enrichForPagination('privateNetworks', _this2.pageOfListPrivateNetworks, request);
46
- };
47
- })();
48
-
49
- /**
50
- * Create a Private Network. Create a new Private Network. Once created, you
51
- * can attach Scaleway resources in the same Availability Zone.
52
- *
53
- * @param request - The request {@link CreatePrivateNetworkRequest}
54
- * @returns A Promise of PrivateNetwork
55
- */
56
- createPrivateNetwork = (() => {
57
- var _this3 = this;
58
- return function (request) {
59
- if (request === void 0) {
60
- request = {};
61
- }
62
- return _this3.client.fetch({
63
- body: JSON.stringify(marshalCreatePrivateNetworkRequest(request, _this3.client.settings)),
64
- headers: jsonContentHeaders,
65
- method: 'POST',
66
- path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/private-networks`
67
- }, unmarshalPrivateNetwork);
68
- };
69
- })();
70
-
71
- /**
72
- * Get a Private Network. Retrieve information about an existing Private
73
- * Network, specified by its Private Network ID. Its full details are returned
74
- * in the response object.
75
- *
76
- * @param request - The request {@link GetPrivateNetworkRequest}
77
- * @returns A Promise of PrivateNetwork
78
- */
79
- getPrivateNetwork = request => this.client.fetch({
80
- method: 'GET',
81
- path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
82
- }, unmarshalPrivateNetwork);
83
-
84
- /**
85
- * Update Private Network. Update parameters (such as name or tags) of an
86
- * existing Private Network, specified by its Private Network ID.
87
- *
88
- * @param request - The request {@link UpdatePrivateNetworkRequest}
89
- * @returns A Promise of PrivateNetwork
90
- */
91
- updatePrivateNetwork = request => this.client.fetch({
92
- body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)),
93
- headers: jsonContentHeaders,
94
- method: 'PATCH',
95
- path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
96
- }, unmarshalPrivateNetwork);
97
-
98
- /**
99
- * Delete a Private Network. Delete an existing Private Network. Note that you
100
- * must first detach all resources from the network, in order to delete it.
101
- *
102
- * @param request - The request {@link DeletePrivateNetworkRequest}
103
- */
104
- deletePrivateNetwork = request => this.client.fetch({
105
- method: 'DELETE',
106
- path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
107
- });
108
- }
109
-
110
- export { API };
@@ -1,4 +0,0 @@
1
- export { API } from './api.gen.js';
2
-
3
- // This file was automatically generated. DO NOT EDIT.
4
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,44 +0,0 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
2
- import { isJSONObject } from '../../../helpers/json.js';
3
- import { unmarshalDate, unmarshalArrayOfObject } 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 unmarshalPrivateNetwork = data => {
8
- if (!isJSONObject(data)) {
9
- throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
10
- }
11
- return {
12
- createdAt: unmarshalDate(data.created_at),
13
- id: data.id,
14
- name: data.name,
15
- organizationId: data.organization_id,
16
- projectId: data.project_id,
17
- subnets: data.subnets,
18
- tags: data.tags,
19
- updatedAt: unmarshalDate(data.updated_at),
20
- zone: data.zone
21
- };
22
- };
23
- const unmarshalListPrivateNetworksResponse = data => {
24
- if (!isJSONObject(data)) {
25
- throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);
26
- }
27
- return {
28
- privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),
29
- totalCount: data.total_count
30
- };
31
- };
32
- const marshalCreatePrivateNetworkRequest = (request, defaults) => ({
33
- name: request.name || randomName('pn'),
34
- project_id: request.projectId ?? defaults.defaultProjectId,
35
- subnets: request.subnets,
36
- tags: request.tags
37
- });
38
- const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({
39
- name: request.name,
40
- subnets: request.subnets,
41
- tags: request.tags
42
- });
43
-
44
- export { marshalCreatePrivateNetworkRequest, marshalUpdatePrivateNetworkRequest, unmarshalListPrivateNetworksResponse, unmarshalPrivateNetwork };
@@ -1,276 +0,0 @@
1
- import { API as API$1 } from '../../../scw/api.js';
2
- import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
3
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { unmarshalListVPCsResponse, marshalCreateVPCRequest, unmarshalVPC, marshalUpdateVPCRequest, unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest, marshalMigrateZonalPrivateNetworksRequest, marshalSetSubnetsRequest, unmarshalSetSubnetsResponse, marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, marshalDeleteSubnetsRequest, unmarshalDeleteSubnetsResponse } from './marshalling.gen.js';
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.
8
- const jsonContentHeaders = {
9
- 'Content-Type': 'application/json; charset=utf-8'
10
- };
11
-
12
- /** VPC API. */
13
- class API extends API$1 {
14
- /** Lists the available regions of the API. */
15
- static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
16
- pageOfListVPCs = (() => {
17
- var _this = this;
18
- return function (request) {
19
- if (request === void 0) {
20
- request = {};
21
- }
22
- return _this.client.fetch({
23
- method: 'GET',
24
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/vpcs`,
25
- urlParams: urlParams(['is_default', request.isDefault], ['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])
26
- }, unmarshalListVPCsResponse);
27
- };
28
- })();
29
-
30
- /**
31
- * List VPCs. List existing VPCs in the specified region.
32
- *
33
- * @param request - The request {@link ListVPCsRequest}
34
- * @returns A Promise of ListVPCsResponse
35
- */
36
- listVPCs = (() => {
37
- var _this2 = this;
38
- return function (request) {
39
- if (request === void 0) {
40
- request = {};
41
- }
42
- return enrichForPagination('vpcs', _this2.pageOfListVPCs, request);
43
- };
44
- })();
45
-
46
- /**
47
- * Create a VPC. Create a new VPC in the specified region.
48
- *
49
- * @param request - The request {@link CreateVPCRequest}
50
- * @returns A Promise of VPC
51
- */
52
- createVPC = (() => {
53
- var _this3 = this;
54
- return function (request) {
55
- if (request === void 0) {
56
- request = {};
57
- }
58
- return _this3.client.fetch({
59
- body: JSON.stringify(marshalCreateVPCRequest(request, _this3.client.settings)),
60
- headers: jsonContentHeaders,
61
- method: 'POST',
62
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/vpcs`
63
- }, unmarshalVPC);
64
- };
65
- })();
66
-
67
- /**
68
- * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.
69
- *
70
- * @param request - The request {@link GetVPCRequest}
71
- * @returns A Promise of VPC
72
- */
73
- getVPC = request => this.client.fetch({
74
- method: 'GET',
75
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`
76
- }, unmarshalVPC);
77
-
78
- /**
79
- * Update VPC. Update parameters including name and tags of the specified VPC.
80
- *
81
- * @param request - The request {@link UpdateVPCRequest}
82
- * @returns A Promise of VPC
83
- */
84
- updateVPC = request => this.client.fetch({
85
- body: JSON.stringify(marshalUpdateVPCRequest(request, this.client.settings)),
86
- headers: jsonContentHeaders,
87
- method: 'PATCH',
88
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`
89
- }, unmarshalVPC);
90
-
91
- /**
92
- * Delete a VPC. Delete a VPC specified by its VPC ID.
93
- *
94
- * @param request - The request {@link DeleteVPCRequest}
95
- */
96
- deleteVPC = request => this.client.fetch({
97
- method: 'DELETE',
98
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`
99
- });
100
- pageOfListPrivateNetworks = (() => {
101
- var _this4 = this;
102
- return function (request) {
103
- if (request === void 0) {
104
- request = {};
105
- }
106
- return _this4.client.fetch({
107
- method: 'GET',
108
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? _this4.client.settings.defaultRegion)}/private-networks`,
109
- urlParams: urlParams(['dhcp_enabled', request.dhcpEnabled], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags], ['vpc_id', request.vpcId])
110
- }, unmarshalListPrivateNetworksResponse);
111
- };
112
- })();
113
-
114
- /**
115
- * List Private Networks. List existing Private Networks in the specified
116
- * region. By default, the Private Networks returned in the list are ordered
117
- * by creation date in ascending order, though this can be modified via the
118
- * order_by field.
119
- *
120
- * @param request - The request {@link ListPrivateNetworksRequest}
121
- * @returns A Promise of ListPrivateNetworksResponse
122
- */
123
- listPrivateNetworks = (() => {
124
- var _this5 = this;
125
- return function (request) {
126
- if (request === void 0) {
127
- request = {};
128
- }
129
- return enrichForPagination('privateNetworks', _this5.pageOfListPrivateNetworks, request);
130
- };
131
- })();
132
-
133
- /**
134
- * Create a Private Network. Create a new Private Network. Once created, you
135
- * can attach Scaleway resources which are in the same region.
136
- *
137
- * @param request - The request {@link CreatePrivateNetworkRequest}
138
- * @returns A Promise of PrivateNetwork
139
- */
140
- createPrivateNetwork = (() => {
141
- var _this6 = this;
142
- return function (request) {
143
- if (request === void 0) {
144
- request = {};
145
- }
146
- return _this6.client.fetch({
147
- body: JSON.stringify(marshalCreatePrivateNetworkRequest(request, _this6.client.settings)),
148
- headers: jsonContentHeaders,
149
- method: 'POST',
150
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? _this6.client.settings.defaultRegion)}/private-networks`
151
- }, unmarshalPrivateNetwork);
152
- };
153
- })();
154
-
155
- /**
156
- * Get a Private Network. Retrieve information about an existing Private
157
- * Network, specified by its Private Network ID. Its full details are returned
158
- * in the response object.
159
- *
160
- * @param request - The request {@link GetPrivateNetworkRequest}
161
- * @returns A Promise of PrivateNetwork
162
- */
163
- getPrivateNetwork = request => this.client.fetch({
164
- method: 'GET',
165
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
166
- }, unmarshalPrivateNetwork);
167
-
168
- /**
169
- * Update Private Network. Update parameters (such as name or tags) of an
170
- * existing Private Network, specified by its Private Network ID.
171
- *
172
- * @param request - The request {@link UpdatePrivateNetworkRequest}
173
- * @returns A Promise of PrivateNetwork
174
- */
175
- updatePrivateNetwork = request => this.client.fetch({
176
- body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)),
177
- headers: jsonContentHeaders,
178
- method: 'PATCH',
179
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
180
- }, unmarshalPrivateNetwork);
181
-
182
- /**
183
- * Delete a Private Network. Delete an existing Private Network. Note that you
184
- * must first detach all resources from the network, in order to delete it.
185
- *
186
- * @param request - The request {@link DeletePrivateNetworkRequest}
187
- */
188
- deletePrivateNetwork = request => this.client.fetch({
189
- method: 'DELETE',
190
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
191
- });
192
-
193
- /**
194
- * Migrate Private Networks from zoned to regional. Transform multiple
195
- * existing zoned Private Networks (scoped to a single Availability Zone) into
196
- * regional Private Networks, scoped to an entire region. You can transform
197
- * one or many Private Networks (specified by their Private Network IDs)
198
- * within a single Scaleway Organization or Project, with the same call.
199
- *
200
- * @param request - The request {@link MigrateZonalPrivateNetworksRequest}
201
- */
202
- migrateZonalPrivateNetworks = (() => {
203
- var _this7 = this;
204
- return function (request) {
205
- if (request === void 0) {
206
- request = {};
207
- }
208
- return _this7.client.fetch({
209
- body: JSON.stringify(marshalMigrateZonalPrivateNetworksRequest(request, _this7.client.settings)),
210
- headers: jsonContentHeaders,
211
- method: 'POST',
212
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? _this7.client.settings.defaultRegion)}/private-networks/migrate-zonal`
213
- });
214
- };
215
- })();
216
-
217
- /**
218
- * Enable DHCP on a Private Network. Enable DHCP managed on an existing
219
- * Private Network. Note that you will not be able to deactivate it
220
- * afterwards.
221
- *
222
- * @param request - The request {@link EnableDHCPRequest}
223
- * @returns A Promise of PrivateNetwork
224
- */
225
- enableDHCP = request => this.client.fetch({
226
- body: '{}',
227
- headers: jsonContentHeaders,
228
- method: 'POST',
229
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/enable-dhcp`
230
- }, unmarshalPrivateNetwork);
231
-
232
- /**
233
- * Set the subnets of a Private Network. Set subnets for an existing Private
234
- * Network. Note that the method is PUT and not PATCH. Any existing subnets
235
- * will be removed in favor of the new specified set of subnets.
236
- *
237
- * @param request - The request {@link SetSubnetsRequest}
238
- * @returns A Promise of SetSubnetsResponse
239
- */
240
- setSubnets = request => this.client.fetch({
241
- body: JSON.stringify(marshalSetSubnetsRequest(request, this.client.settings)),
242
- headers: jsonContentHeaders,
243
- method: 'PUT',
244
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets`
245
- }, unmarshalSetSubnetsResponse);
246
-
247
- /**
248
- * Add subnets to a Private Network. Add new subnets to an existing Private
249
- * Network.
250
- *
251
- * @param request - The request {@link AddSubnetsRequest}
252
- * @returns A Promise of AddSubnetsResponse
253
- */
254
- addSubnets = request => this.client.fetch({
255
- body: JSON.stringify(marshalAddSubnetsRequest(request, this.client.settings)),
256
- headers: jsonContentHeaders,
257
- method: 'POST',
258
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets`
259
- }, unmarshalAddSubnetsResponse);
260
-
261
- /**
262
- * Delete subnets from a Private Network. Delete the specified subnets from a
263
- * Private Network.
264
- *
265
- * @param request - The request {@link DeleteSubnetsRequest}
266
- * @returns A Promise of DeleteSubnetsResponse
267
- */
268
- deleteSubnets = request => this.client.fetch({
269
- body: JSON.stringify(marshalDeleteSubnetsRequest(request, this.client.settings)),
270
- headers: jsonContentHeaders,
271
- method: 'DELETE',
272
- path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets`
273
- }, unmarshalDeleteSubnetsResponse);
274
- }
275
-
276
- export { API };
@@ -1,4 +0,0 @@
1
- export { API } from './api.gen.js';
2
-
3
- // This file was automatically generated. DO NOT EDIT.
4
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,135 +0,0 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
2
- import { isJSONObject } from '../../../helpers/json.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 unmarshalSubnet = data => {
8
- if (!isJSONObject(data)) {
9
- throw new TypeError(`Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`);
10
- }
11
- return {
12
- createdAt: unmarshalDate(data.created_at),
13
- id: data.id,
14
- subnet: data.subnet,
15
- updatedAt: unmarshalDate(data.updated_at)
16
- };
17
- };
18
- const unmarshalPrivateNetwork = data => {
19
- if (!isJSONObject(data)) {
20
- throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
21
- }
22
- return {
23
- createdAt: unmarshalDate(data.created_at),
24
- dhcpEnabled: data.dhcp_enabled,
25
- id: data.id,
26
- name: data.name,
27
- organizationId: data.organization_id,
28
- projectId: data.project_id,
29
- region: data.region,
30
- subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
31
- tags: data.tags,
32
- updatedAt: unmarshalDate(data.updated_at),
33
- vpcId: data.vpc_id
34
- };
35
- };
36
- const unmarshalVPC = data => {
37
- if (!isJSONObject(data)) {
38
- throw new TypeError(`Unmarshalling the type 'VPC' failed as data isn't a dictionary.`);
39
- }
40
- return {
41
- createdAt: unmarshalDate(data.created_at),
42
- id: data.id,
43
- isDefault: data.is_default,
44
- name: data.name,
45
- organizationId: data.organization_id,
46
- privateNetworkCount: data.private_network_count,
47
- projectId: data.project_id,
48
- region: data.region,
49
- tags: data.tags,
50
- updatedAt: unmarshalDate(data.updated_at)
51
- };
52
- };
53
- const unmarshalAddSubnetsResponse = data => {
54
- if (!isJSONObject(data)) {
55
- throw new TypeError(`Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`);
56
- }
57
- return {
58
- subnets: data.subnets
59
- };
60
- };
61
- const unmarshalDeleteSubnetsResponse = data => {
62
- if (!isJSONObject(data)) {
63
- throw new TypeError(`Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`);
64
- }
65
- return {
66
- subnets: data.subnets
67
- };
68
- };
69
- const unmarshalListPrivateNetworksResponse = data => {
70
- if (!isJSONObject(data)) {
71
- throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);
72
- }
73
- return {
74
- privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),
75
- totalCount: data.total_count
76
- };
77
- };
78
- const unmarshalListVPCsResponse = data => {
79
- if (!isJSONObject(data)) {
80
- throw new TypeError(`Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`);
81
- }
82
- return {
83
- totalCount: data.total_count,
84
- vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
85
- };
86
- };
87
- const unmarshalSetSubnetsResponse = data => {
88
- if (!isJSONObject(data)) {
89
- throw new TypeError(`Unmarshalling the type 'SetSubnetsResponse' failed as data isn't a dictionary.`);
90
- }
91
- return {
92
- subnets: data.subnets
93
- };
94
- };
95
- const marshalAddSubnetsRequest = (request, defaults) => ({
96
- subnets: request.subnets
97
- });
98
- const marshalCreatePrivateNetworkRequest = (request, defaults) => ({
99
- name: request.name || randomName('pn'),
100
- project_id: request.projectId ?? defaults.defaultProjectId,
101
- subnets: request.subnets,
102
- tags: request.tags,
103
- vpc_id: request.vpcId
104
- });
105
- const marshalCreateVPCRequest = (request, defaults) => ({
106
- name: request.name || randomName('vpc'),
107
- project_id: request.projectId ?? defaults.defaultProjectId,
108
- tags: request.tags
109
- });
110
- const marshalDeleteSubnetsRequest = (request, defaults) => ({
111
- subnets: request.subnets
112
- });
113
- const marshalMigrateZonalPrivateNetworksRequest = (request, defaults) => ({
114
- private_network_ids: request.privateNetworkIds,
115
- ...resolveOneOf([{
116
- param: 'organization_id',
117
- value: request.organizationId
118
- }, {
119
- param: 'project_id',
120
- value: request.projectId
121
- }])
122
- });
123
- const marshalSetSubnetsRequest = (request, defaults) => ({
124
- subnets: request.subnets
125
- });
126
- const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({
127
- name: request.name,
128
- tags: request.tags
129
- });
130
- const marshalUpdateVPCRequest = (request, defaults) => ({
131
- name: request.name,
132
- tags: request.tags
133
- });
134
-
135
- export { marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalMigrateZonalPrivateNetworksRequest, marshalSetSubnetsRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateVPCRequest, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalListPrivateNetworksResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalSetSubnetsResponse, unmarshalVPC };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1/index.gen.js';
2
- export { index_gen as v1 };