@scaleway/sdk 2.59.0 → 2.61.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.
Files changed (77) hide show
  1. package/dist/api/applesilicon/v1alpha1/api.gen.cjs +117 -0
  2. package/dist/api/applesilicon/v1alpha1/api.gen.d.ts +54 -1
  3. package/dist/api/applesilicon/v1alpha1/api.gen.js +120 -3
  4. package/dist/api/applesilicon/v1alpha1/content.gen.cjs +4 -0
  5. package/dist/api/applesilicon/v1alpha1/content.gen.d.ts +5 -1
  6. package/dist/api/applesilicon/v1alpha1/content.gen.js +4 -0
  7. package/dist/api/applesilicon/v1alpha1/index.gen.cjs +3 -0
  8. package/dist/api/applesilicon/v1alpha1/index.gen.d.ts +2 -2
  9. package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -2
  10. package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +60 -0
  11. package/dist/api/applesilicon/v1alpha1/marshalling.gen.d.ts +6 -1
  12. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +60 -0
  13. package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +100 -0
  14. package/dist/api/container/v1beta1/api.gen.cjs +6 -8
  15. package/dist/api/container/v1beta1/api.gen.d.ts +6 -8
  16. package/dist/api/container/v1beta1/api.gen.js +6 -8
  17. package/dist/api/edge_services/v1alpha1/types.gen.d.ts +4 -4
  18. package/dist/api/index.gen.d.ts +2 -1
  19. package/dist/api/interlink/index.gen.cjs +4 -0
  20. package/dist/api/interlink/index.gen.d.ts +5 -0
  21. package/dist/api/interlink/index.gen.js +4 -0
  22. package/dist/api/interlink/v1beta1/api.gen.cjs +405 -0
  23. package/dist/api/interlink/v1beta1/api.gen.d.ts +208 -0
  24. package/dist/api/interlink/v1beta1/api.gen.js +405 -0
  25. package/dist/api/interlink/v1beta1/index.gen.cjs +6 -0
  26. package/dist/api/interlink/v1beta1/index.gen.d.ts +3 -0
  27. package/dist/api/interlink/v1beta1/index.gen.js +6 -0
  28. package/dist/api/interlink/v1beta1/marshalling.gen.cjs +180 -0
  29. package/dist/api/interlink/v1beta1/marshalling.gen.d.ts +16 -0
  30. package/dist/api/interlink/v1beta1/marshalling.gen.js +180 -0
  31. package/dist/api/interlink/v1beta1/types.gen.d.ts +455 -0
  32. package/dist/api/interlink/v1beta1/validation-rules.gen.cjs +107 -0
  33. package/dist/api/interlink/v1beta1/validation-rules.gen.d.ts +93 -0
  34. package/dist/api/interlink/v1beta1/validation-rules.gen.js +107 -0
  35. package/dist/api/ipam/v1/api.gen.cjs +1 -0
  36. package/dist/api/ipam/v1/api.gen.js +1 -0
  37. package/dist/api/ipam/v1/types.gen.d.ts +12 -10
  38. package/dist/api/k8s/v1/api.gen.cjs +22 -20
  39. package/dist/api/k8s/v1/api.gen.d.ts +22 -20
  40. package/dist/api/k8s/v1/api.gen.js +22 -20
  41. package/dist/api/k8s/v1/marshalling.gen.cjs +2 -5
  42. package/dist/api/k8s/v1/marshalling.gen.js +2 -5
  43. package/dist/api/k8s/v1/types.gen.d.ts +65 -49
  44. package/dist/api/lb/v1/types.gen.d.ts +6 -6
  45. package/dist/api/mongodb/v1alpha1/api.gen.cjs +13 -1
  46. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +8 -1
  47. package/dist/api/mongodb/v1alpha1/api.gen.js +13 -1
  48. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +1 -1
  49. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +11 -0
  50. package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +8 -0
  51. package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +7 -0
  52. package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +8 -0
  53. package/dist/api/secret/v1beta1/marshalling.gen.cjs +1 -0
  54. package/dist/api/secret/v1beta1/marshalling.gen.js +1 -0
  55. package/dist/api/secret/v1beta1/types.gen.d.ts +2 -0
  56. package/dist/api/vpcgw/v2/api.gen.cjs +49 -1
  57. package/dist/api/vpcgw/v2/api.gen.d.ts +25 -1
  58. package/dist/api/vpcgw/v2/api.gen.js +50 -2
  59. package/dist/api/vpcgw/v2/index.gen.d.ts +1 -1
  60. package/dist/api/vpcgw/v2/marshalling.gen.cjs +31 -0
  61. package/dist/api/vpcgw/v2/marshalling.gen.d.ts +5 -1
  62. package/dist/api/vpcgw/v2/marshalling.gen.js +31 -0
  63. package/dist/api/vpcgw/v2/types.gen.d.ts +39 -0
  64. package/dist/api/webhosting/v1/api.gen.cjs +20 -0
  65. package/dist/api/webhosting/v1/api.gen.d.ts +8 -1
  66. package/dist/api/webhosting/v1/api.gen.js +21 -1
  67. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  68. package/dist/api/webhosting/v1/marshalling.gen.cjs +16 -1
  69. package/dist/api/webhosting/v1/marshalling.gen.d.ts +2 -1
  70. package/dist/api/webhosting/v1/marshalling.gen.js +16 -1
  71. package/dist/api/webhosting/v1/types.gen.d.ts +30 -2
  72. package/dist/index.cjs +26 -24
  73. package/dist/index.js +26 -24
  74. package/dist/scw/constants.cjs +1 -1
  75. package/dist/scw/constants.d.ts +2 -2
  76. package/dist/scw/constants.js +1 -1
  77. package/package.json +2 -2
@@ -0,0 +1,405 @@
1
+ import { API as API$1 } from "../../../scw/api.js";
2
+ import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
3
+ import "../../../vendor/base64/index.js";
4
+ import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
5
+ import { unmarshalListPartnersResponse, unmarshalPartner, unmarshalListPopsResponse, unmarshalPop, unmarshalListLinksResponse, unmarshalLink, marshalCreateLinkRequest, marshalUpdateLinkRequest, marshalAttachVpcRequest, marshalAttachRoutingPolicyRequest, unmarshalListRoutingPoliciesResponse, unmarshalRoutingPolicy, marshalCreateRoutingPolicyRequest, marshalUpdateRoutingPolicyRequest } from "./marshalling.gen.js";
6
+ const jsonContentHeaders = {
7
+ "Content-Type": "application/json; charset=utf-8"
8
+ };
9
+ class API extends API$1 {
10
+ /** Lists the available regions of the API. */
11
+ static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"];
12
+ pageOfListPartners = (request = {}) => this.client.fetch(
13
+ {
14
+ method: "GET",
15
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners`,
16
+ urlParams: urlParams(
17
+ ["order_by", request.orderBy],
18
+ ["page", request.page],
19
+ [
20
+ "page_size",
21
+ request.pageSize ?? this.client.settings.defaultPageSize
22
+ ],
23
+ ["pop_ids", request.popIds]
24
+ )
25
+ },
26
+ unmarshalListPartnersResponse
27
+ );
28
+ /**
29
+ * List available partners. List all available partners. By default, the
30
+ * partners returned in the list are ordered by name in ascending order,
31
+ * though this can be modified via the `order_by` field.
32
+ *
33
+ * @param request - The request {@link ListPartnersRequest}
34
+ * @returns A Promise of ListPartnersResponse
35
+ */
36
+ listPartners = (request = {}) => enrichForPagination("partners", this.pageOfListPartners, request);
37
+ /**
38
+ * Get a partner. Get a partner for the given partner IP. The response object
39
+ * includes information such as the partner's name, email address and portal
40
+ * URL.
41
+ *
42
+ * @param request - The request {@link GetPartnerRequest}
43
+ * @returns A Promise of Partner
44
+ */
45
+ getPartner = (request) => this.client.fetch(
46
+ {
47
+ method: "GET",
48
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/partners/${validatePathParam("partnerId", request.partnerId)}`
49
+ },
50
+ unmarshalPartner
51
+ );
52
+ pageOfListPops = (request = {}) => this.client.fetch(
53
+ {
54
+ method: "GET",
55
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops`,
56
+ urlParams: urlParams(
57
+ ["hosting_provider_name", request.hostingProviderName],
58
+ ["link_bandwidth_mbps", request.linkBandwidthMbps],
59
+ ["name", request.name],
60
+ ["order_by", request.orderBy],
61
+ ["page", request.page],
62
+ [
63
+ "page_size",
64
+ request.pageSize ?? this.client.settings.defaultPageSize
65
+ ],
66
+ ["partner_id", request.partnerId]
67
+ )
68
+ },
69
+ unmarshalListPopsResponse
70
+ );
71
+ /**
72
+ * List PoPs. List all available PoPs (locations) for a given region. By
73
+ * default, the results are returned in ascending alphabetical order by name.
74
+ *
75
+ * @param request - The request {@link ListPopsRequest}
76
+ * @returns A Promise of ListPopsResponse
77
+ */
78
+ listPops = (request = {}) => enrichForPagination("pops", this.pageOfListPops, request);
79
+ /**
80
+ * Get a PoP. Get a PoP for the given PoP ID. The response object includes the
81
+ * PoP's name and information about its physical location.
82
+ *
83
+ * @param request - The request {@link GetPopRequest}
84
+ * @returns A Promise of Pop
85
+ */
86
+ getPop = (request) => this.client.fetch(
87
+ {
88
+ method: "GET",
89
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pops/${validatePathParam("popId", request.popId)}`
90
+ },
91
+ unmarshalPop
92
+ );
93
+ pageOfListLinks = (request = {}) => this.client.fetch(
94
+ {
95
+ method: "GET",
96
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`,
97
+ urlParams: urlParams(
98
+ ["bandwidth_mbps", request.bandwidthMbps],
99
+ ["bgp_v4_status", request.bgpV4Status],
100
+ ["bgp_v6_status", request.bgpV6Status],
101
+ ["name", request.name],
102
+ ["order_by", request.orderBy],
103
+ ["organization_id", request.organizationId],
104
+ ["page", request.page],
105
+ [
106
+ "page_size",
107
+ request.pageSize ?? this.client.settings.defaultPageSize
108
+ ],
109
+ ["pairing_key", request.pairingKey],
110
+ ["partner_id", request.partnerId],
111
+ ["pop_id", request.popId],
112
+ ["project_id", request.projectId],
113
+ ["routing_policy_id", request.routingPolicyId],
114
+ ["status", request.status],
115
+ ["tags", request.tags],
116
+ ["vpc_id", request.vpcId]
117
+ )
118
+ },
119
+ unmarshalListLinksResponse
120
+ );
121
+ /**
122
+ * List links. List all your links (InterLink connections). A number of
123
+ * filters are available, including Project ID, name, tags and status.
124
+ *
125
+ * @param request - The request {@link ListLinksRequest}
126
+ * @returns A Promise of ListLinksResponse
127
+ */
128
+ listLinks = (request = {}) => enrichForPagination("links", this.pageOfListLinks, request);
129
+ /**
130
+ * Get a link. Get a link (InterLink connection) for the given link ID. The
131
+ * response object includes information about the link's various configuration
132
+ * details.
133
+ *
134
+ * @param request - The request {@link GetLinkRequest}
135
+ * @returns A Promise of Link
136
+ */
137
+ getLink = (request) => this.client.fetch(
138
+ {
139
+ method: "GET",
140
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
141
+ },
142
+ unmarshalLink
143
+ );
144
+ /**
145
+ * Create a link. Create a link (InterLink connection) in a given PoP,
146
+ * specifying its various configuration details. For the moment only hosted
147
+ * links (faciliated by partners) are available, though in the future
148
+ * dedicated and shared links will also be possible.
149
+ *
150
+ * @param request - The request {@link CreateLinkRequest}
151
+ * @returns A Promise of Link
152
+ */
153
+ createLink = (request) => this.client.fetch(
154
+ {
155
+ body: JSON.stringify(
156
+ marshalCreateLinkRequest(request, this.client.settings)
157
+ ),
158
+ headers: jsonContentHeaders,
159
+ method: "POST",
160
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links`
161
+ },
162
+ unmarshalLink
163
+ );
164
+ /**
165
+ * Update a link. Update an existing link, specified by its link ID. Only its
166
+ * name and tags can be updated.
167
+ *
168
+ * @param request - The request {@link UpdateLinkRequest}
169
+ * @returns A Promise of Link
170
+ */
171
+ updateLink = (request) => this.client.fetch(
172
+ {
173
+ body: JSON.stringify(
174
+ marshalUpdateLinkRequest(request, this.client.settings)
175
+ ),
176
+ headers: jsonContentHeaders,
177
+ method: "PATCH",
178
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
179
+ },
180
+ unmarshalLink
181
+ );
182
+ /**
183
+ * Delete a link. Delete an existing link, specified by its link ID. Note that
184
+ * as well as deleting the link here on the Scaleway side, it is also
185
+ * necessary to request deletion from the partner on their side. Only when
186
+ * this action has been carried out on both sides will the resource be
187
+ * completely deleted.
188
+ *
189
+ * @param request - The request {@link DeleteLinkRequest}
190
+ * @returns A Promise of Link
191
+ */
192
+ deleteLink = (request) => this.client.fetch(
193
+ {
194
+ method: "DELETE",
195
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}`
196
+ },
197
+ unmarshalLink
198
+ );
199
+ /**
200
+ * Attach a VPC. Attach a VPC to an existing link. This facilitates
201
+ * communication between the resources in your Scaleway VPC, and your
202
+ * on-premises infrastructure.
203
+ *
204
+ * @param request - The request {@link AttachVpcRequest}
205
+ * @returns A Promise of Link
206
+ */
207
+ attachVpc = (request) => this.client.fetch(
208
+ {
209
+ body: JSON.stringify(
210
+ marshalAttachVpcRequest(request, this.client.settings)
211
+ ),
212
+ headers: jsonContentHeaders,
213
+ method: "POST",
214
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/attach-vpc`
215
+ },
216
+ unmarshalLink
217
+ );
218
+ /**
219
+ * Detach a VPC. Detach a VPC from an existing link.
220
+ *
221
+ * @param request - The request {@link DetachVpcRequest}
222
+ * @returns A Promise of Link
223
+ */
224
+ detachVpc = (request) => this.client.fetch(
225
+ {
226
+ body: "{}",
227
+ headers: jsonContentHeaders,
228
+ method: "POST",
229
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-vpc`
230
+ },
231
+ unmarshalLink
232
+ );
233
+ /**
234
+ * Attach a routing policy. Attach a routing policy to an existing link. As
235
+ * all routes across the link are blocked by default, you must attach a
236
+ * routing policy to set IP prefix filters for allowed routes, facilitating
237
+ * traffic flow.
238
+ *
239
+ * @param request - The request {@link AttachRoutingPolicyRequest}
240
+ * @returns A Promise of Link
241
+ */
242
+ attachRoutingPolicy = (request) => this.client.fetch(
243
+ {
244
+ body: JSON.stringify(
245
+ marshalAttachRoutingPolicyRequest(request, this.client.settings)
246
+ ),
247
+ headers: jsonContentHeaders,
248
+ method: "POST",
249
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/attach-routing-policy`
250
+ },
251
+ unmarshalLink
252
+ );
253
+ /**
254
+ * Detach a routing policy. Detach a routing policy from an existing link.
255
+ * Without a routing policy, all routes across the link are blocked by
256
+ * default.
257
+ *
258
+ * @param request - The request {@link DetachRoutingPolicyRequest}
259
+ * @returns A Promise of Link
260
+ */
261
+ detachRoutingPolicy = (request) => this.client.fetch(
262
+ {
263
+ body: "{}",
264
+ headers: jsonContentHeaders,
265
+ method: "POST",
266
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/detach-routing-policy`
267
+ },
268
+ unmarshalLink
269
+ );
270
+ /**
271
+ * Enable route propagation. Enable all allowed prefixes (defined in a routing
272
+ * policy) to be announced in the BGP session. This allows traffic to flow
273
+ * between the attached VPC and the on-premises infrastructure along the
274
+ * announced routes. Note that by default, even when route propagation is
275
+ * enabled, all routes are blocked. It is essential to attach a routing policy
276
+ * to define the ranges of routes to announce.
277
+ *
278
+ * @param request - The request {@link EnableRoutePropagationRequest}
279
+ * @returns A Promise of Link
280
+ */
281
+ enableRoutePropagation = (request) => this.client.fetch(
282
+ {
283
+ body: "{}",
284
+ headers: jsonContentHeaders,
285
+ method: "POST",
286
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/enable-route-propagation`
287
+ },
288
+ unmarshalLink
289
+ );
290
+ /**
291
+ * Disable route propagation. Prevent any prefixes from being announced in the
292
+ * BGP session. Traffic will not be able to flow over the InterLink until
293
+ * route propagation is re-enabled.
294
+ *
295
+ * @param request - The request {@link DisableRoutePropagationRequest}
296
+ * @returns A Promise of Link
297
+ */
298
+ disableRoutePropagation = (request) => this.client.fetch(
299
+ {
300
+ body: "{}",
301
+ headers: jsonContentHeaders,
302
+ method: "POST",
303
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/links/${validatePathParam("linkId", request.linkId)}/disable-route-propagation`
304
+ },
305
+ unmarshalLink
306
+ );
307
+ pageOfListRoutingPolicies = (request = {}) => this.client.fetch(
308
+ {
309
+ method: "GET",
310
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
311
+ urlParams: urlParams(
312
+ ["name", request.name],
313
+ ["order_by", request.orderBy],
314
+ ["organization_id", request.organizationId],
315
+ ["page", request.page],
316
+ [
317
+ "page_size",
318
+ request.pageSize ?? this.client.settings.defaultPageSize
319
+ ],
320
+ ["project_id", request.projectId],
321
+ ["tags", request.tags]
322
+ )
323
+ },
324
+ unmarshalListRoutingPoliciesResponse
325
+ );
326
+ /**
327
+ * List routing policies. List all routing policies in a given region. A
328
+ * routing policy can be attached to one or multiple links (InterLink
329
+ * connections).
330
+ *
331
+ * @param request - The request {@link ListRoutingPoliciesRequest}
332
+ * @returns A Promise of ListRoutingPoliciesResponse
333
+ */
334
+ listRoutingPolicies = (request = {}) => enrichForPagination(
335
+ "routingPolicies",
336
+ this.pageOfListRoutingPolicies,
337
+ request
338
+ );
339
+ /**
340
+ * Get routing policy. Get a routing policy for the given routing policy ID.
341
+ * The response object gives information including the policy's name, tags and
342
+ * prefix filters.
343
+ *
344
+ * @param request - The request {@link GetRoutingPolicyRequest}
345
+ * @returns A Promise of RoutingPolicy
346
+ */
347
+ getRoutingPolicy = (request) => this.client.fetch(
348
+ {
349
+ method: "GET",
350
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
351
+ },
352
+ unmarshalRoutingPolicy
353
+ );
354
+ /**
355
+ * Create a routing policy. Create a routing policy. Routing policies allow
356
+ * you to set IP prefix filters to define the incoming route announcements to
357
+ * accept from the peer, and the outgoing routes to announce to the peer.
358
+ *
359
+ * @param request - The request {@link CreateRoutingPolicyRequest}
360
+ * @returns A Promise of RoutingPolicy
361
+ */
362
+ createRoutingPolicy = (request) => this.client.fetch(
363
+ {
364
+ body: JSON.stringify(
365
+ marshalCreateRoutingPolicyRequest(request, this.client.settings)
366
+ ),
367
+ headers: jsonContentHeaders,
368
+ method: "POST",
369
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
370
+ },
371
+ unmarshalRoutingPolicy
372
+ );
373
+ /**
374
+ * Update a routing policy. Update an existing routing policy, specified by
375
+ * its routing policy ID. Its name, tags and incoming/outgoing prefix filters
376
+ * can be updated.
377
+ *
378
+ * @param request - The request {@link UpdateRoutingPolicyRequest}
379
+ * @returns A Promise of RoutingPolicy
380
+ */
381
+ updateRoutingPolicy = (request) => this.client.fetch(
382
+ {
383
+ body: JSON.stringify(
384
+ marshalUpdateRoutingPolicyRequest(request, this.client.settings)
385
+ ),
386
+ headers: jsonContentHeaders,
387
+ method: "PATCH",
388
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
389
+ },
390
+ unmarshalRoutingPolicy
391
+ );
392
+ /**
393
+ * Delete a routing policy. Delete an existing routing policy, specified by
394
+ * its routing policy ID.
395
+ *
396
+ * @param request - The request {@link DeleteRoutingPolicyRequest}
397
+ */
398
+ deleteRoutingPolicy = (request) => this.client.fetch({
399
+ method: "DELETE",
400
+ path: `/interlink/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
401
+ });
402
+ }
403
+ export {
404
+ API
405
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const validationRules_gen = require("./validation-rules.gen.cjs");
5
+ exports.API = api_gen.API;
6
+ exports.ValidationRules = validationRules_gen;
@@ -0,0 +1,3 @@
1
+ export { API } from './api.gen';
2
+ export type { AttachRoutingPolicyRequest, AttachVpcRequest, BgpStatus, CreateLinkRequest, CreateRoutingPolicyRequest, DeleteLinkRequest, DeleteRoutingPolicyRequest, DetachRoutingPolicyRequest, DetachVpcRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GetLinkRequest, GetPartnerRequest, GetPopRequest, GetRoutingPolicyRequest, Link, LinkStatus, ListLinksRequest, ListLinksRequestOrderBy, ListLinksResponse, ListPartnersRequest, ListPartnersRequestOrderBy, ListPartnersResponse, ListPopsRequest, ListPopsRequestOrderBy, ListPopsResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesRequestOrderBy, ListRoutingPoliciesResponse, Partner, Pop, RoutingPolicy, UpdateLinkRequest, UpdateRoutingPolicyRequest, } from './types.gen';
3
+ export * as ValidationRules from './validation-rules.gen';
@@ -0,0 +1,6 @@
1
+ import { API } from "./api.gen.js";
2
+ import * as validationRules_gen from "./validation-rules.gen.js";
3
+ export {
4
+ API,
5
+ validationRules_gen as ValidationRules
6
+ };
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const json = require("../../../helpers/json.cjs");
4
+ const marshalling = require("../../../helpers/marshalling.cjs");
5
+ require("../../../vendor/base64/index.cjs");
6
+ const unmarshalLink = (data) => {
7
+ if (!json.isJSONObject(data)) {
8
+ throw new TypeError(
9
+ `Unmarshalling the type 'Link' failed as data isn't a dictionary.`
10
+ );
11
+ }
12
+ return {
13
+ bandwidthMbps: data.bandwidth_mbps,
14
+ bgpV4Status: data.bgp_v4_status,
15
+ bgpV6Status: data.bgp_v6_status,
16
+ createdAt: marshalling.unmarshalDate(data.created_at),
17
+ enableRoutePropagation: data.enable_route_propagation,
18
+ id: data.id,
19
+ name: data.name,
20
+ organizationId: data.organization_id,
21
+ pairingKey: data.pairing_key,
22
+ partnerId: data.partner_id,
23
+ popId: data.pop_id,
24
+ projectId: data.project_id,
25
+ region: data.region,
26
+ routingPolicyId: data.routing_policy_id,
27
+ status: data.status,
28
+ tags: data.tags,
29
+ updatedAt: marshalling.unmarshalDate(data.updated_at),
30
+ vpcId: data.vpc_id
31
+ };
32
+ };
33
+ const unmarshalPartner = (data) => {
34
+ if (!json.isJSONObject(data)) {
35
+ throw new TypeError(
36
+ `Unmarshalling the type 'Partner' failed as data isn't a dictionary.`
37
+ );
38
+ }
39
+ return {
40
+ contactEmail: data.contact_email,
41
+ createdAt: marshalling.unmarshalDate(data.created_at),
42
+ id: data.id,
43
+ logoUrl: data.logo_url,
44
+ name: data.name,
45
+ portalUrl: data.portal_url,
46
+ updatedAt: marshalling.unmarshalDate(data.updated_at)
47
+ };
48
+ };
49
+ const unmarshalPop = (data) => {
50
+ if (!json.isJSONObject(data)) {
51
+ throw new TypeError(
52
+ `Unmarshalling the type 'Pop' failed as data isn't a dictionary.`
53
+ );
54
+ }
55
+ return {
56
+ address: data.address,
57
+ availableLinkBandwidthsMbps: data.available_link_bandwidths_mbps,
58
+ city: data.city,
59
+ hostingProviderName: data.hosting_provider_name,
60
+ id: data.id,
61
+ logoUrl: data.logo_url,
62
+ name: data.name,
63
+ region: data.region
64
+ };
65
+ };
66
+ const unmarshalRoutingPolicy = (data) => {
67
+ if (!json.isJSONObject(data)) {
68
+ throw new TypeError(
69
+ `Unmarshalling the type 'RoutingPolicy' failed as data isn't a dictionary.`
70
+ );
71
+ }
72
+ return {
73
+ createdAt: marshalling.unmarshalDate(data.created_at),
74
+ id: data.id,
75
+ name: data.name,
76
+ organizationId: data.organization_id,
77
+ prefixFilterIn: data.prefix_filter_in,
78
+ prefixFilterOut: data.prefix_filter_out,
79
+ projectId: data.project_id,
80
+ region: data.region,
81
+ tags: data.tags,
82
+ updatedAt: marshalling.unmarshalDate(data.updated_at)
83
+ };
84
+ };
85
+ const unmarshalListLinksResponse = (data) => {
86
+ if (!json.isJSONObject(data)) {
87
+ throw new TypeError(
88
+ `Unmarshalling the type 'ListLinksResponse' failed as data isn't a dictionary.`
89
+ );
90
+ }
91
+ return {
92
+ links: marshalling.unmarshalArrayOfObject(data.links, unmarshalLink),
93
+ totalCount: data.total_count
94
+ };
95
+ };
96
+ const unmarshalListPartnersResponse = (data) => {
97
+ if (!json.isJSONObject(data)) {
98
+ throw new TypeError(
99
+ `Unmarshalling the type 'ListPartnersResponse' failed as data isn't a dictionary.`
100
+ );
101
+ }
102
+ return {
103
+ partners: marshalling.unmarshalArrayOfObject(data.partners, unmarshalPartner),
104
+ totalCount: data.total_count
105
+ };
106
+ };
107
+ const unmarshalListPopsResponse = (data) => {
108
+ if (!json.isJSONObject(data)) {
109
+ throw new TypeError(
110
+ `Unmarshalling the type 'ListPopsResponse' failed as data isn't a dictionary.`
111
+ );
112
+ }
113
+ return {
114
+ pops: marshalling.unmarshalArrayOfObject(data.pops, unmarshalPop),
115
+ totalCount: data.total_count
116
+ };
117
+ };
118
+ const unmarshalListRoutingPoliciesResponse = (data) => {
119
+ if (!json.isJSONObject(data)) {
120
+ throw new TypeError(
121
+ `Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`
122
+ );
123
+ }
124
+ return {
125
+ routingPolicies: marshalling.unmarshalArrayOfObject(
126
+ data.routing_policies,
127
+ unmarshalRoutingPolicy
128
+ ),
129
+ totalCount: data.total_count
130
+ };
131
+ };
132
+ const marshalAttachRoutingPolicyRequest = (request, defaults) => ({
133
+ routing_policy_id: request.routingPolicyId
134
+ });
135
+ const marshalAttachVpcRequest = (request, defaults) => ({
136
+ vpc_id: request.vpcId
137
+ });
138
+ const marshalCreateLinkRequest = (request, defaults) => ({
139
+ bandwidth_mbps: request.bandwidthMbps,
140
+ name: request.name,
141
+ pop_id: request.popId,
142
+ project_id: request.projectId ?? defaults.defaultProjectId,
143
+ tags: request.tags,
144
+ ...marshalling.resolveOneOf([
145
+ { param: "dedicated", value: request.dedicated },
146
+ { param: "port_id", value: request.portId },
147
+ { param: "partner_id", value: request.partnerId }
148
+ ])
149
+ });
150
+ const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
151
+ name: request.name,
152
+ prefix_filter_in: request.prefixFilterIn,
153
+ prefix_filter_out: request.prefixFilterOut,
154
+ project_id: request.projectId ?? defaults.defaultProjectId,
155
+ tags: request.tags
156
+ });
157
+ const marshalUpdateLinkRequest = (request, defaults) => ({
158
+ name: request.name,
159
+ tags: request.tags
160
+ });
161
+ const marshalUpdateRoutingPolicyRequest = (request, defaults) => ({
162
+ name: request.name,
163
+ prefix_filter_in: request.prefixFilterIn,
164
+ prefix_filter_out: request.prefixFilterOut,
165
+ tags: request.tags
166
+ });
167
+ exports.marshalAttachRoutingPolicyRequest = marshalAttachRoutingPolicyRequest;
168
+ exports.marshalAttachVpcRequest = marshalAttachVpcRequest;
169
+ exports.marshalCreateLinkRequest = marshalCreateLinkRequest;
170
+ exports.marshalCreateRoutingPolicyRequest = marshalCreateRoutingPolicyRequest;
171
+ exports.marshalUpdateLinkRequest = marshalUpdateLinkRequest;
172
+ exports.marshalUpdateRoutingPolicyRequest = marshalUpdateRoutingPolicyRequest;
173
+ exports.unmarshalLink = unmarshalLink;
174
+ exports.unmarshalListLinksResponse = unmarshalListLinksResponse;
175
+ exports.unmarshalListPartnersResponse = unmarshalListPartnersResponse;
176
+ exports.unmarshalListPopsResponse = unmarshalListPopsResponse;
177
+ exports.unmarshalListRoutingPoliciesResponse = unmarshalListRoutingPoliciesResponse;
178
+ exports.unmarshalPartner = unmarshalPartner;
179
+ exports.unmarshalPop = unmarshalPop;
180
+ exports.unmarshalRoutingPolicy = unmarshalRoutingPolicy;
@@ -0,0 +1,16 @@
1
+ import type { DefaultValues } from '../../../bridge';
2
+ import type { AttachRoutingPolicyRequest, AttachVpcRequest, CreateLinkRequest, CreateRoutingPolicyRequest, Link, ListLinksResponse, ListPartnersResponse, ListPopsResponse, ListRoutingPoliciesResponse, Partner, Pop, RoutingPolicy, UpdateLinkRequest, UpdateRoutingPolicyRequest } from './types.gen';
3
+ export declare const unmarshalLink: (data: unknown) => Link;
4
+ export declare const unmarshalPartner: (data: unknown) => Partner;
5
+ export declare const unmarshalPop: (data: unknown) => Pop;
6
+ export declare const unmarshalRoutingPolicy: (data: unknown) => RoutingPolicy;
7
+ export declare const unmarshalListLinksResponse: (data: unknown) => ListLinksResponse;
8
+ export declare const unmarshalListPartnersResponse: (data: unknown) => ListPartnersResponse;
9
+ export declare const unmarshalListPopsResponse: (data: unknown) => ListPopsResponse;
10
+ export declare const unmarshalListRoutingPoliciesResponse: (data: unknown) => ListRoutingPoliciesResponse;
11
+ export declare const marshalAttachRoutingPolicyRequest: (request: AttachRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
12
+ export declare const marshalAttachVpcRequest: (request: AttachVpcRequest, defaults: DefaultValues) => Record<string, unknown>;
13
+ export declare const marshalCreateLinkRequest: (request: CreateLinkRequest, defaults: DefaultValues) => Record<string, unknown>;
14
+ export declare const marshalCreateRoutingPolicyRequest: (request: CreateRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
15
+ export declare const marshalUpdateLinkRequest: (request: UpdateLinkRequest, defaults: DefaultValues) => Record<string, unknown>;
16
+ export declare const marshalUpdateRoutingPolicyRequest: (request: UpdateRoutingPolicyRequest, defaults: DefaultValues) => Record<string, unknown>;