@scaleway/sdk-lb 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1304 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const randomName = require("@scaleway/random-name");
4
+ const sdkClient = require("@scaleway/sdk-client");
5
+ const unmarshalIp = (data) => {
6
+ if (!sdkClient.isJSONObject(data)) {
7
+ throw new TypeError(
8
+ `Unmarshalling the type 'Ip' failed as data isn't a dictionary.`
9
+ );
10
+ }
11
+ return {
12
+ id: data.id,
13
+ ipAddress: data.ip_address,
14
+ lbId: data.lb_id,
15
+ organizationId: data.organization_id,
16
+ projectId: data.project_id,
17
+ region: data.region,
18
+ reverse: data.reverse,
19
+ tags: data.tags,
20
+ zone: data.zone
21
+ };
22
+ };
23
+ const unmarshalSubscriberEmailConfig = (data) => {
24
+ if (!sdkClient.isJSONObject(data)) {
25
+ throw new TypeError(
26
+ `Unmarshalling the type 'SubscriberEmailConfig' failed as data isn't a dictionary.`
27
+ );
28
+ }
29
+ return {
30
+ email: data.email
31
+ };
32
+ };
33
+ const unmarshalSubscriberWebhookConfig = (data) => {
34
+ if (!sdkClient.isJSONObject(data)) {
35
+ throw new TypeError(
36
+ `Unmarshalling the type 'SubscriberWebhookConfig' failed as data isn't a dictionary.`
37
+ );
38
+ }
39
+ return {
40
+ uri: data.uri
41
+ };
42
+ };
43
+ const unmarshalSubscriber = (data) => {
44
+ if (!sdkClient.isJSONObject(data)) {
45
+ throw new TypeError(
46
+ `Unmarshalling the type 'Subscriber' failed as data isn't a dictionary.`
47
+ );
48
+ }
49
+ return {
50
+ emailConfig: data.email_config ? unmarshalSubscriberEmailConfig(data.email_config) : void 0,
51
+ id: data.id,
52
+ name: data.name,
53
+ webhookConfig: data.webhook_config ? unmarshalSubscriberWebhookConfig(data.webhook_config) : void 0
54
+ };
55
+ };
56
+ const unmarshalHealthCheckHttpConfig = (data) => {
57
+ if (!sdkClient.isJSONObject(data)) {
58
+ throw new TypeError(
59
+ `Unmarshalling the type 'HealthCheckHttpConfig' failed as data isn't a dictionary.`
60
+ );
61
+ }
62
+ return {
63
+ code: data.code,
64
+ hostHeader: data.host_header,
65
+ method: data.method,
66
+ uri: data.uri
67
+ };
68
+ };
69
+ const unmarshalHealthCheckHttpsConfig = (data) => {
70
+ if (!sdkClient.isJSONObject(data)) {
71
+ throw new TypeError(
72
+ `Unmarshalling the type 'HealthCheckHttpsConfig' failed as data isn't a dictionary.`
73
+ );
74
+ }
75
+ return {
76
+ code: data.code,
77
+ hostHeader: data.host_header,
78
+ method: data.method,
79
+ sni: data.sni,
80
+ uri: data.uri
81
+ };
82
+ };
83
+ const unmarshalHealthCheckLdapConfig = (data) => {
84
+ if (!sdkClient.isJSONObject(data)) {
85
+ throw new TypeError(
86
+ `Unmarshalling the type 'HealthCheckLdapConfig' failed as data isn't a dictionary.`
87
+ );
88
+ }
89
+ return {};
90
+ };
91
+ const unmarshalHealthCheckMysqlConfig = (data) => {
92
+ if (!sdkClient.isJSONObject(data)) {
93
+ throw new TypeError(
94
+ `Unmarshalling the type 'HealthCheckMysqlConfig' failed as data isn't a dictionary.`
95
+ );
96
+ }
97
+ return {
98
+ user: data.user
99
+ };
100
+ };
101
+ const unmarshalHealthCheckPgsqlConfig = (data) => {
102
+ if (!sdkClient.isJSONObject(data)) {
103
+ throw new TypeError(
104
+ `Unmarshalling the type 'HealthCheckPgsqlConfig' failed as data isn't a dictionary.`
105
+ );
106
+ }
107
+ return {
108
+ user: data.user
109
+ };
110
+ };
111
+ const unmarshalHealthCheckRedisConfig = (data) => {
112
+ if (!sdkClient.isJSONObject(data)) {
113
+ throw new TypeError(
114
+ `Unmarshalling the type 'HealthCheckRedisConfig' failed as data isn't a dictionary.`
115
+ );
116
+ }
117
+ return {};
118
+ };
119
+ const unmarshalHealthCheckTcpConfig = (data) => {
120
+ if (!sdkClient.isJSONObject(data)) {
121
+ throw new TypeError(
122
+ `Unmarshalling the type 'HealthCheckTcpConfig' failed as data isn't a dictionary.`
123
+ );
124
+ }
125
+ return {};
126
+ };
127
+ const unmarshalHealthCheck = (data) => {
128
+ if (!sdkClient.isJSONObject(data)) {
129
+ throw new TypeError(
130
+ `Unmarshalling the type 'HealthCheck' failed as data isn't a dictionary.`
131
+ );
132
+ }
133
+ return {
134
+ checkDelay: data.check_delay,
135
+ checkMaxRetries: data.check_max_retries,
136
+ checkSendProxy: data.check_send_proxy,
137
+ checkTimeout: data.check_timeout,
138
+ httpConfig: data.http_config ? unmarshalHealthCheckHttpConfig(data.http_config) : void 0,
139
+ httpsConfig: data.https_config ? unmarshalHealthCheckHttpsConfig(data.https_config) : void 0,
140
+ ldapConfig: data.ldap_config ? unmarshalHealthCheckLdapConfig(data.ldap_config) : void 0,
141
+ mysqlConfig: data.mysql_config ? unmarshalHealthCheckMysqlConfig(data.mysql_config) : void 0,
142
+ pgsqlConfig: data.pgsql_config ? unmarshalHealthCheckPgsqlConfig(data.pgsql_config) : void 0,
143
+ port: data.port,
144
+ redisConfig: data.redis_config ? unmarshalHealthCheckRedisConfig(data.redis_config) : void 0,
145
+ tcpConfig: data.tcp_config ? unmarshalHealthCheckTcpConfig(data.tcp_config) : void 0,
146
+ transientCheckDelay: data.transient_check_delay
147
+ };
148
+ };
149
+ const unmarshalInstance = (data) => {
150
+ if (!sdkClient.isJSONObject(data)) {
151
+ throw new TypeError(
152
+ `Unmarshalling the type 'Instance' failed as data isn't a dictionary.`
153
+ );
154
+ }
155
+ return {
156
+ createdAt: sdkClient.unmarshalDate(data.created_at),
157
+ id: data.id,
158
+ ipAddress: data.ip_address,
159
+ region: data.region,
160
+ status: data.status,
161
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
162
+ zone: data.zone
163
+ };
164
+ };
165
+ const unmarshalLb = (data) => {
166
+ if (!sdkClient.isJSONObject(data)) {
167
+ throw new TypeError(
168
+ `Unmarshalling the type 'Lb' failed as data isn't a dictionary.`
169
+ );
170
+ }
171
+ return {
172
+ backendCount: data.backend_count,
173
+ createdAt: sdkClient.unmarshalDate(data.created_at),
174
+ description: data.description,
175
+ frontendCount: data.frontend_count,
176
+ id: data.id,
177
+ instances: sdkClient.unmarshalArrayOfObject(data.instances, unmarshalInstance),
178
+ ip: sdkClient.unmarshalArrayOfObject(data.ip, unmarshalIp),
179
+ name: data.name,
180
+ organizationId: data.organization_id,
181
+ privateNetworkCount: data.private_network_count,
182
+ projectId: data.project_id,
183
+ region: data.region,
184
+ routeCount: data.route_count,
185
+ sslCompatibilityLevel: data.ssl_compatibility_level,
186
+ status: data.status,
187
+ subscriber: data.subscriber ? unmarshalSubscriber(data.subscriber) : void 0,
188
+ tags: data.tags,
189
+ type: data.type,
190
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
191
+ zone: data.zone
192
+ };
193
+ };
194
+ const unmarshalBackend = (data) => {
195
+ if (!sdkClient.isJSONObject(data)) {
196
+ throw new TypeError(
197
+ `Unmarshalling the type 'Backend' failed as data isn't a dictionary.`
198
+ );
199
+ }
200
+ return {
201
+ createdAt: sdkClient.unmarshalDate(data.created_at),
202
+ failoverHost: data.failover_host,
203
+ forwardPort: data.forward_port,
204
+ forwardPortAlgorithm: data.forward_port_algorithm,
205
+ forwardProtocol: data.forward_protocol,
206
+ healthCheck: data.health_check ? unmarshalHealthCheck(data.health_check) : void 0,
207
+ id: data.id,
208
+ ignoreSslServerVerify: data.ignore_ssl_server_verify,
209
+ lb: data.lb ? unmarshalLb(data.lb) : void 0,
210
+ maxConnections: data.max_connections,
211
+ maxRetries: data.max_retries,
212
+ name: data.name,
213
+ onMarkedDownAction: data.on_marked_down_action,
214
+ pool: data.pool,
215
+ proxyProtocol: data.proxy_protocol,
216
+ redispatchAttemptCount: data.redispatch_attempt_count,
217
+ sendProxyV2: data.send_proxy_v2,
218
+ sslBridging: data.ssl_bridging,
219
+ stickySessions: data.sticky_sessions,
220
+ stickySessionsCookieName: data.sticky_sessions_cookie_name,
221
+ timeoutConnect: data.timeout_connect,
222
+ timeoutQueue: data.timeout_queue,
223
+ timeoutServer: data.timeout_server,
224
+ timeoutTunnel: data.timeout_tunnel,
225
+ updatedAt: sdkClient.unmarshalDate(data.updated_at)
226
+ };
227
+ };
228
+ const unmarshalCertificate = (data) => {
229
+ if (!sdkClient.isJSONObject(data)) {
230
+ throw new TypeError(
231
+ `Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`
232
+ );
233
+ }
234
+ return {
235
+ commonName: data.common_name,
236
+ createdAt: sdkClient.unmarshalDate(data.created_at),
237
+ fingerprint: data.fingerprint,
238
+ id: data.id,
239
+ lb: data.lb ? unmarshalLb(data.lb) : void 0,
240
+ name: data.name,
241
+ notValidAfter: sdkClient.unmarshalDate(data.not_valid_after),
242
+ notValidBefore: sdkClient.unmarshalDate(data.not_valid_before),
243
+ status: data.status,
244
+ statusDetails: data.status_details,
245
+ subjectAlternativeName: data.subject_alternative_name,
246
+ type: data.type,
247
+ updatedAt: sdkClient.unmarshalDate(data.updated_at)
248
+ };
249
+ };
250
+ const unmarshalFrontend = (data) => {
251
+ if (!sdkClient.isJSONObject(data)) {
252
+ throw new TypeError(
253
+ `Unmarshalling the type 'Frontend' failed as data isn't a dictionary.`
254
+ );
255
+ }
256
+ return {
257
+ backend: data.backend ? unmarshalBackend(data.backend) : void 0,
258
+ certificate: data.certificate ? unmarshalCertificate(data.certificate) : void 0,
259
+ certificateIds: data.certificate_ids,
260
+ connectionRateLimit: data.connection_rate_limit,
261
+ createdAt: sdkClient.unmarshalDate(data.created_at),
262
+ enableHttp3: data.enable_http3,
263
+ id: data.id,
264
+ inboundPort: data.inbound_port,
265
+ lb: data.lb ? unmarshalLb(data.lb) : void 0,
266
+ name: data.name,
267
+ timeoutClient: data.timeout_client,
268
+ updatedAt: sdkClient.unmarshalDate(data.updated_at)
269
+ };
270
+ };
271
+ const unmarshalAclActionRedirect = (data) => {
272
+ if (!sdkClient.isJSONObject(data)) {
273
+ throw new TypeError(
274
+ `Unmarshalling the type 'AclActionRedirect' failed as data isn't a dictionary.`
275
+ );
276
+ }
277
+ return {
278
+ code: data.code,
279
+ target: data.target,
280
+ type: data.type
281
+ };
282
+ };
283
+ const unmarshalAclAction = (data) => {
284
+ if (!sdkClient.isJSONObject(data)) {
285
+ throw new TypeError(
286
+ `Unmarshalling the type 'AclAction' failed as data isn't a dictionary.`
287
+ );
288
+ }
289
+ return {
290
+ redirect: data.redirect ? unmarshalAclActionRedirect(data.redirect) : void 0,
291
+ type: data.type
292
+ };
293
+ };
294
+ const unmarshalAclMatch = (data) => {
295
+ if (!sdkClient.isJSONObject(data)) {
296
+ throw new TypeError(
297
+ `Unmarshalling the type 'AclMatch' failed as data isn't a dictionary.`
298
+ );
299
+ }
300
+ return {
301
+ httpFilter: data.http_filter,
302
+ httpFilterOption: data.http_filter_option,
303
+ httpFilterValue: data.http_filter_value,
304
+ invert: data.invert,
305
+ ipSubnet: data.ip_subnet,
306
+ ipsEdgeServices: data.ips_edge_services
307
+ };
308
+ };
309
+ const unmarshalAcl = (data) => {
310
+ if (!sdkClient.isJSONObject(data)) {
311
+ throw new TypeError(
312
+ `Unmarshalling the type 'Acl' failed as data isn't a dictionary.`
313
+ );
314
+ }
315
+ return {
316
+ action: data.action ? unmarshalAclAction(data.action) : void 0,
317
+ createdAt: sdkClient.unmarshalDate(data.created_at),
318
+ description: data.description,
319
+ frontend: data.frontend ? unmarshalFrontend(data.frontend) : void 0,
320
+ id: data.id,
321
+ index: data.index,
322
+ match: data.match ? unmarshalAclMatch(data.match) : void 0,
323
+ name: data.name,
324
+ updatedAt: sdkClient.unmarshalDate(data.updated_at)
325
+ };
326
+ };
327
+ const unmarshalPrivateNetworkDHCPConfig = (data) => {
328
+ if (!sdkClient.isJSONObject(data)) {
329
+ throw new TypeError(
330
+ `Unmarshalling the type 'PrivateNetworkDHCPConfig' failed as data isn't a dictionary.`
331
+ );
332
+ }
333
+ return {
334
+ ipId: data.ip_id
335
+ };
336
+ };
337
+ const unmarshalPrivateNetworkIpamConfig = (data) => {
338
+ if (!sdkClient.isJSONObject(data)) {
339
+ throw new TypeError(
340
+ `Unmarshalling the type 'PrivateNetworkIpamConfig' failed as data isn't a dictionary.`
341
+ );
342
+ }
343
+ return {};
344
+ };
345
+ const unmarshalPrivateNetworkStaticConfig = (data) => {
346
+ if (!sdkClient.isJSONObject(data)) {
347
+ throw new TypeError(
348
+ `Unmarshalling the type 'PrivateNetworkStaticConfig' failed as data isn't a dictionary.`
349
+ );
350
+ }
351
+ return {
352
+ ipAddress: data.ip_address ? data.ip_address : void 0
353
+ };
354
+ };
355
+ const unmarshalPrivateNetwork = (data) => {
356
+ if (!sdkClient.isJSONObject(data)) {
357
+ throw new TypeError(
358
+ `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`
359
+ );
360
+ }
361
+ return {
362
+ createdAt: sdkClient.unmarshalDate(data.created_at),
363
+ dhcpConfig: data.dhcp_config ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) : void 0,
364
+ ipamConfig: data.ipam_config ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) : void 0,
365
+ ipamIds: data.ipam_ids,
366
+ lb: data.lb ? unmarshalLb(data.lb) : void 0,
367
+ privateNetworkId: data.private_network_id,
368
+ staticConfig: data.static_config ? unmarshalPrivateNetworkStaticConfig(data.static_config) : void 0,
369
+ status: data.status,
370
+ updatedAt: sdkClient.unmarshalDate(data.updated_at)
371
+ };
372
+ };
373
+ const unmarshalRouteMatch = (data) => {
374
+ if (!sdkClient.isJSONObject(data)) {
375
+ throw new TypeError(
376
+ `Unmarshalling the type 'RouteMatch' failed as data isn't a dictionary.`
377
+ );
378
+ }
379
+ return {
380
+ hostHeader: data.host_header,
381
+ matchSubdomains: data.match_subdomains,
382
+ sni: data.sni
383
+ };
384
+ };
385
+ const unmarshalRoute = (data) => {
386
+ if (!sdkClient.isJSONObject(data)) {
387
+ throw new TypeError(
388
+ `Unmarshalling the type 'Route' failed as data isn't a dictionary.`
389
+ );
390
+ }
391
+ return {
392
+ backendId: data.backend_id,
393
+ createdAt: sdkClient.unmarshalDate(data.created_at),
394
+ frontendId: data.frontend_id,
395
+ id: data.id,
396
+ match: data.match ? unmarshalRouteMatch(data.match) : void 0,
397
+ updatedAt: sdkClient.unmarshalDate(data.updated_at)
398
+ };
399
+ };
400
+ const unmarshalBackendServerStats = (data) => {
401
+ if (!sdkClient.isJSONObject(data)) {
402
+ throw new TypeError(
403
+ `Unmarshalling the type 'BackendServerStats' failed as data isn't a dictionary.`
404
+ );
405
+ }
406
+ return {
407
+ backendId: data.backend_id,
408
+ instanceId: data.instance_id,
409
+ ip: data.ip,
410
+ lastHealthCheckStatus: data.last_health_check_status,
411
+ serverState: data.server_state,
412
+ serverStateChangedAt: sdkClient.unmarshalDate(data.server_state_changed_at)
413
+ };
414
+ };
415
+ const unmarshalLbStats = (data) => {
416
+ if (!sdkClient.isJSONObject(data)) {
417
+ throw new TypeError(
418
+ `Unmarshalling the type 'LbStats' failed as data isn't a dictionary.`
419
+ );
420
+ }
421
+ return {
422
+ backendServersStats: sdkClient.unmarshalArrayOfObject(
423
+ data.backend_servers_stats,
424
+ unmarshalBackendServerStats
425
+ )
426
+ };
427
+ };
428
+ const unmarshalListAclResponse = (data) => {
429
+ if (!sdkClient.isJSONObject(data)) {
430
+ throw new TypeError(
431
+ `Unmarshalling the type 'ListAclResponse' failed as data isn't a dictionary.`
432
+ );
433
+ }
434
+ return {
435
+ acls: sdkClient.unmarshalArrayOfObject(data.acls, unmarshalAcl),
436
+ totalCount: data.total_count
437
+ };
438
+ };
439
+ const unmarshalListBackendStatsResponse = (data) => {
440
+ if (!sdkClient.isJSONObject(data)) {
441
+ throw new TypeError(
442
+ `Unmarshalling the type 'ListBackendStatsResponse' failed as data isn't a dictionary.`
443
+ );
444
+ }
445
+ return {
446
+ backendServersStats: sdkClient.unmarshalArrayOfObject(
447
+ data.backend_servers_stats,
448
+ unmarshalBackendServerStats
449
+ ),
450
+ totalCount: data.total_count
451
+ };
452
+ };
453
+ const unmarshalListBackendsResponse = (data) => {
454
+ if (!sdkClient.isJSONObject(data)) {
455
+ throw new TypeError(
456
+ `Unmarshalling the type 'ListBackendsResponse' failed as data isn't a dictionary.`
457
+ );
458
+ }
459
+ return {
460
+ backends: sdkClient.unmarshalArrayOfObject(data.backends, unmarshalBackend),
461
+ totalCount: data.total_count
462
+ };
463
+ };
464
+ const unmarshalListCertificatesResponse = (data) => {
465
+ if (!sdkClient.isJSONObject(data)) {
466
+ throw new TypeError(
467
+ `Unmarshalling the type 'ListCertificatesResponse' failed as data isn't a dictionary.`
468
+ );
469
+ }
470
+ return {
471
+ certificates: sdkClient.unmarshalArrayOfObject(
472
+ data.certificates,
473
+ unmarshalCertificate
474
+ ),
475
+ totalCount: data.total_count
476
+ };
477
+ };
478
+ const unmarshalListFrontendsResponse = (data) => {
479
+ if (!sdkClient.isJSONObject(data)) {
480
+ throw new TypeError(
481
+ `Unmarshalling the type 'ListFrontendsResponse' failed as data isn't a dictionary.`
482
+ );
483
+ }
484
+ return {
485
+ frontends: sdkClient.unmarshalArrayOfObject(data.frontends, unmarshalFrontend),
486
+ totalCount: data.total_count
487
+ };
488
+ };
489
+ const unmarshalListIpsResponse = (data) => {
490
+ if (!sdkClient.isJSONObject(data)) {
491
+ throw new TypeError(
492
+ `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`
493
+ );
494
+ }
495
+ return {
496
+ ips: sdkClient.unmarshalArrayOfObject(data.ips, unmarshalIp),
497
+ totalCount: data.total_count
498
+ };
499
+ };
500
+ const unmarshalListLbPrivateNetworksResponse = (data) => {
501
+ if (!sdkClient.isJSONObject(data)) {
502
+ throw new TypeError(
503
+ `Unmarshalling the type 'ListLbPrivateNetworksResponse' failed as data isn't a dictionary.`
504
+ );
505
+ }
506
+ return {
507
+ privateNetwork: sdkClient.unmarshalArrayOfObject(
508
+ data.private_network,
509
+ unmarshalPrivateNetwork
510
+ ),
511
+ totalCount: data.total_count
512
+ };
513
+ };
514
+ const unmarshalLbType = (data) => {
515
+ if (!sdkClient.isJSONObject(data)) {
516
+ throw new TypeError(
517
+ `Unmarshalling the type 'LbType' failed as data isn't a dictionary.`
518
+ );
519
+ }
520
+ return {
521
+ description: data.description,
522
+ name: data.name,
523
+ region: data.region,
524
+ stockStatus: data.stock_status,
525
+ zone: data.zone
526
+ };
527
+ };
528
+ const unmarshalListLbTypesResponse = (data) => {
529
+ if (!sdkClient.isJSONObject(data)) {
530
+ throw new TypeError(
531
+ `Unmarshalling the type 'ListLbTypesResponse' failed as data isn't a dictionary.`
532
+ );
533
+ }
534
+ return {
535
+ lbTypes: sdkClient.unmarshalArrayOfObject(data.lb_types, unmarshalLbType),
536
+ totalCount: data.total_count
537
+ };
538
+ };
539
+ const unmarshalListLbsResponse = (data) => {
540
+ if (!sdkClient.isJSONObject(data)) {
541
+ throw new TypeError(
542
+ `Unmarshalling the type 'ListLbsResponse' failed as data isn't a dictionary.`
543
+ );
544
+ }
545
+ return {
546
+ lbs: sdkClient.unmarshalArrayOfObject(data.lbs, unmarshalLb),
547
+ totalCount: data.total_count
548
+ };
549
+ };
550
+ const unmarshalListRoutesResponse = (data) => {
551
+ if (!sdkClient.isJSONObject(data)) {
552
+ throw new TypeError(
553
+ `Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`
554
+ );
555
+ }
556
+ return {
557
+ routes: sdkClient.unmarshalArrayOfObject(data.routes, unmarshalRoute),
558
+ totalCount: data.total_count
559
+ };
560
+ };
561
+ const unmarshalListSubscriberResponse = (data) => {
562
+ if (!sdkClient.isJSONObject(data)) {
563
+ throw new TypeError(
564
+ `Unmarshalling the type 'ListSubscriberResponse' failed as data isn't a dictionary.`
565
+ );
566
+ }
567
+ return {
568
+ subscribers: sdkClient.unmarshalArrayOfObject(data.subscribers, unmarshalSubscriber),
569
+ totalCount: data.total_count
570
+ };
571
+ };
572
+ const unmarshalSetAclsResponse = (data) => {
573
+ if (!sdkClient.isJSONObject(data)) {
574
+ throw new TypeError(
575
+ `Unmarshalling the type 'SetAclsResponse' failed as data isn't a dictionary.`
576
+ );
577
+ }
578
+ return {
579
+ acls: sdkClient.unmarshalArrayOfObject(data.acls, unmarshalAcl),
580
+ totalCount: data.total_count
581
+ };
582
+ };
583
+ const marshalAddBackendServersRequest = (request, defaults) => ({
584
+ server_ip: request.serverIp
585
+ });
586
+ const marshalPrivateNetworkDHCPConfig = (request, defaults) => ({
587
+ ip_id: request.ipId
588
+ });
589
+ const marshalPrivateNetworkIpamConfig = (request, defaults) => ({});
590
+ const marshalPrivateNetworkStaticConfig = (request, defaults) => ({
591
+ ip_address: request.ipAddress
592
+ });
593
+ const marshalAttachPrivateNetworkRequest = (request, defaults) => ({
594
+ ipam_ids: request.ipamIds,
595
+ ...sdkClient.resolveOneOf([
596
+ {
597
+ param: "static_config",
598
+ value: request.staticConfig !== void 0 ? marshalPrivateNetworkStaticConfig(request.staticConfig) : void 0
599
+ },
600
+ {
601
+ param: "dhcp_config",
602
+ value: request.dhcpConfig !== void 0 ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : void 0
603
+ },
604
+ {
605
+ param: "ipam_config",
606
+ value: request.ipamConfig !== void 0 ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : void 0
607
+ }
608
+ ])
609
+ });
610
+ const marshalAclActionRedirect = (request, defaults) => ({
611
+ code: request.code,
612
+ target: request.target,
613
+ type: request.type
614
+ });
615
+ const marshalAclAction = (request, defaults) => ({
616
+ redirect: request.redirect !== void 0 ? marshalAclActionRedirect(request.redirect) : void 0,
617
+ type: request.type
618
+ });
619
+ const marshalAclMatch = (request, defaults) => ({
620
+ http_filter: request.httpFilter,
621
+ http_filter_option: request.httpFilterOption,
622
+ http_filter_value: request.httpFilterValue,
623
+ invert: request.invert,
624
+ ip_subnet: request.ipSubnet,
625
+ ips_edge_services: request.ipsEdgeServices
626
+ });
627
+ const marshalCreateAclRequest = (request, defaults) => ({
628
+ action: marshalAclAction(request.action),
629
+ description: request.description,
630
+ index: request.index,
631
+ match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,
632
+ name: request.name || randomName("acl")
633
+ });
634
+ const marshalHealthCheckHttpConfig = (request, defaults) => ({
635
+ code: request.code,
636
+ host_header: request.hostHeader,
637
+ method: request.method,
638
+ uri: request.uri
639
+ });
640
+ const marshalHealthCheckHttpsConfig = (request, defaults) => ({
641
+ code: request.code,
642
+ host_header: request.hostHeader,
643
+ method: request.method,
644
+ sni: request.sni,
645
+ uri: request.uri
646
+ });
647
+ const marshalHealthCheckLdapConfig = (request, defaults) => ({});
648
+ const marshalHealthCheckMysqlConfig = (request, defaults) => ({
649
+ user: request.user
650
+ });
651
+ const marshalHealthCheckPgsqlConfig = (request, defaults) => ({
652
+ user: request.user
653
+ });
654
+ const marshalHealthCheckRedisConfig = (request, defaults) => ({});
655
+ const marshalHealthCheckTcpConfig = (request, defaults) => ({});
656
+ const marshalHealthCheck = (request, defaults) => ({
657
+ check_delay: request.checkDelay,
658
+ check_max_retries: request.checkMaxRetries,
659
+ check_send_proxy: request.checkSendProxy,
660
+ check_timeout: request.checkTimeout,
661
+ port: request.port,
662
+ transient_check_delay: request.transientCheckDelay,
663
+ ...sdkClient.resolveOneOf([
664
+ {
665
+ param: "tcp_config",
666
+ value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0
667
+ },
668
+ {
669
+ param: "mysql_config",
670
+ value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0
671
+ },
672
+ {
673
+ param: "pgsql_config",
674
+ value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0
675
+ },
676
+ {
677
+ param: "ldap_config",
678
+ value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0
679
+ },
680
+ {
681
+ param: "redis_config",
682
+ value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0
683
+ },
684
+ {
685
+ param: "http_config",
686
+ value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0
687
+ },
688
+ {
689
+ param: "https_config",
690
+ value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0
691
+ }
692
+ ])
693
+ });
694
+ const marshalCreateBackendRequest = (request, defaults) => ({
695
+ failover_host: request.failoverHost,
696
+ forward_port: request.forwardPort,
697
+ forward_port_algorithm: request.forwardPortAlgorithm,
698
+ forward_protocol: request.forwardProtocol,
699
+ health_check: marshalHealthCheck(request.healthCheck),
700
+ ignore_ssl_server_verify: request.ignoreSslServerVerify,
701
+ max_connections: request.maxConnections,
702
+ max_retries: request.maxRetries,
703
+ name: request.name || randomName("lbb"),
704
+ on_marked_down_action: request.onMarkedDownAction,
705
+ proxy_protocol: request.proxyProtocol,
706
+ redispatch_attempt_count: request.redispatchAttemptCount,
707
+ send_proxy_v2: request.sendProxyV2,
708
+ server_ip: request.serverIp,
709
+ ssl_bridging: request.sslBridging,
710
+ sticky_sessions: request.stickySessions,
711
+ sticky_sessions_cookie_name: request.stickySessionsCookieName,
712
+ timeout_connect: request.timeoutConnect,
713
+ timeout_queue: request.timeoutQueue,
714
+ timeout_server: request.timeoutServer,
715
+ timeout_tunnel: request.timeoutTunnel
716
+ });
717
+ const marshalCreateCertificateRequestCustomCertificate = (request, defaults) => ({
718
+ certificate_chain: request.certificateChain
719
+ });
720
+ const marshalCreateCertificateRequestLetsencryptConfig = (request, defaults) => ({
721
+ common_name: request.commonName,
722
+ subject_alternative_name: request.subjectAlternativeName
723
+ });
724
+ const marshalCreateCertificateRequest = (request, defaults) => ({
725
+ name: request.name || randomName("certificate"),
726
+ ...sdkClient.resolveOneOf([
727
+ {
728
+ param: "letsencrypt",
729
+ value: request.letsencrypt !== void 0 ? marshalCreateCertificateRequestLetsencryptConfig(
730
+ request.letsencrypt
731
+ ) : void 0
732
+ },
733
+ {
734
+ param: "custom_certificate",
735
+ value: request.customCertificate !== void 0 ? marshalCreateCertificateRequestCustomCertificate(
736
+ request.customCertificate
737
+ ) : void 0
738
+ }
739
+ ])
740
+ });
741
+ const marshalCreateFrontendRequest = (request, defaults) => ({
742
+ backend_id: request.backendId,
743
+ certificate_id: request.certificateId,
744
+ certificate_ids: request.certificateIds,
745
+ connection_rate_limit: request.connectionRateLimit,
746
+ enable_http3: request.enableHttp3,
747
+ inbound_port: request.inboundPort,
748
+ name: request.name || randomName("lbf"),
749
+ timeout_client: request.timeoutClient
750
+ });
751
+ const marshalCreateIpRequest = (request, defaults) => ({
752
+ is_ipv6: request.isIpv6,
753
+ reverse: request.reverse,
754
+ tags: request.tags,
755
+ ...sdkClient.resolveOneOf([
756
+ {
757
+ default: defaults.defaultProjectId,
758
+ param: "project_id",
759
+ value: request.projectId
760
+ },
761
+ {
762
+ default: defaults.defaultOrganizationId,
763
+ param: "organization_id",
764
+ value: request.organizationId
765
+ }
766
+ ])
767
+ });
768
+ const marshalCreateLbRequest = (request, defaults) => ({
769
+ assign_flexible_ip: request.assignFlexibleIp,
770
+ assign_flexible_ipv6: request.assignFlexibleIpv6,
771
+ description: request.description,
772
+ ip_id: request.ipId,
773
+ ip_ids: request.ipIds,
774
+ name: request.name || randomName("lb"),
775
+ ssl_compatibility_level: request.sslCompatibilityLevel,
776
+ tags: request.tags,
777
+ type: request.type,
778
+ ...sdkClient.resolveOneOf([
779
+ {
780
+ default: defaults.defaultProjectId,
781
+ param: "project_id",
782
+ value: request.projectId
783
+ },
784
+ {
785
+ default: defaults.defaultOrganizationId,
786
+ param: "organization_id",
787
+ value: request.organizationId
788
+ }
789
+ ])
790
+ });
791
+ const marshalRouteMatch = (request, defaults) => ({
792
+ match_subdomains: request.matchSubdomains,
793
+ ...sdkClient.resolveOneOf([
794
+ { param: "sni", value: request.sni },
795
+ { param: "host_header", value: request.hostHeader }
796
+ ])
797
+ });
798
+ const marshalCreateRouteRequest = (request, defaults) => ({
799
+ backend_id: request.backendId,
800
+ frontend_id: request.frontendId,
801
+ match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0
802
+ });
803
+ const marshalSubscriberEmailConfig = (request, defaults) => ({
804
+ email: request.email
805
+ });
806
+ const marshalSubscriberWebhookConfig = (request, defaults) => ({
807
+ uri: request.uri
808
+ });
809
+ const marshalCreateSubscriberRequest = (request, defaults) => ({
810
+ name: request.name,
811
+ ...sdkClient.resolveOneOf([
812
+ {
813
+ default: defaults.defaultProjectId,
814
+ param: "project_id",
815
+ value: request.projectId
816
+ },
817
+ {
818
+ default: defaults.defaultOrganizationId,
819
+ param: "organization_id",
820
+ value: request.organizationId
821
+ }
822
+ ]),
823
+ ...sdkClient.resolveOneOf([
824
+ {
825
+ param: "email_config",
826
+ value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0
827
+ },
828
+ {
829
+ param: "webhook_config",
830
+ value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0
831
+ }
832
+ ])
833
+ });
834
+ const marshalMigrateLbRequest = (request, defaults) => ({
835
+ type: request.type
836
+ });
837
+ const marshalRemoveBackendServersRequest = (request, defaults) => ({
838
+ server_ip: request.serverIp
839
+ });
840
+ const marshalSetBackendServersRequest = (request, defaults) => ({
841
+ server_ip: request.serverIp
842
+ });
843
+ const marshalSubscribeToLbRequest = (request, defaults) => ({
844
+ subscriber_id: request.subscriberId
845
+ });
846
+ const marshalUpdateAclRequest = (request, defaults) => ({
847
+ action: marshalAclAction(request.action),
848
+ description: request.description,
849
+ index: request.index,
850
+ match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,
851
+ name: request.name
852
+ });
853
+ const marshalUpdateBackendRequest = (request, defaults) => ({
854
+ failover_host: request.failoverHost,
855
+ forward_port: request.forwardPort,
856
+ forward_port_algorithm: request.forwardPortAlgorithm,
857
+ forward_protocol: request.forwardProtocol,
858
+ ignore_ssl_server_verify: request.ignoreSslServerVerify,
859
+ max_connections: request.maxConnections,
860
+ max_retries: request.maxRetries,
861
+ name: request.name,
862
+ on_marked_down_action: request.onMarkedDownAction,
863
+ proxy_protocol: request.proxyProtocol,
864
+ redispatch_attempt_count: request.redispatchAttemptCount,
865
+ send_proxy_v2: request.sendProxyV2,
866
+ ssl_bridging: request.sslBridging,
867
+ sticky_sessions: request.stickySessions,
868
+ sticky_sessions_cookie_name: request.stickySessionsCookieName,
869
+ timeout_connect: request.timeoutConnect,
870
+ timeout_queue: request.timeoutQueue,
871
+ timeout_server: request.timeoutServer,
872
+ timeout_tunnel: request.timeoutTunnel
873
+ });
874
+ const marshalUpdateCertificateRequest = (request, defaults) => ({
875
+ name: request.name
876
+ });
877
+ const marshalUpdateFrontendRequest = (request, defaults) => ({
878
+ backend_id: request.backendId,
879
+ certificate_id: request.certificateId,
880
+ certificate_ids: request.certificateIds,
881
+ connection_rate_limit: request.connectionRateLimit,
882
+ enable_http3: request.enableHttp3,
883
+ inbound_port: request.inboundPort,
884
+ name: request.name,
885
+ timeout_client: request.timeoutClient
886
+ });
887
+ const marshalUpdateHealthCheckRequest = (request, defaults) => ({
888
+ check_delay: request.checkDelay,
889
+ check_max_retries: request.checkMaxRetries,
890
+ check_send_proxy: request.checkSendProxy,
891
+ check_timeout: request.checkTimeout,
892
+ port: request.port,
893
+ transient_check_delay: request.transientCheckDelay,
894
+ ...sdkClient.resolveOneOf([
895
+ {
896
+ param: "tcp_config",
897
+ value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0
898
+ },
899
+ {
900
+ param: "mysql_config",
901
+ value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0
902
+ },
903
+ {
904
+ param: "pgsql_config",
905
+ value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0
906
+ },
907
+ {
908
+ param: "ldap_config",
909
+ value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0
910
+ },
911
+ {
912
+ param: "redis_config",
913
+ value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0
914
+ },
915
+ {
916
+ param: "http_config",
917
+ value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0
918
+ },
919
+ {
920
+ param: "https_config",
921
+ value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0
922
+ }
923
+ ])
924
+ });
925
+ const marshalUpdateIpRequest = (request, defaults) => ({
926
+ lb_id: request.lbId,
927
+ reverse: request.reverse,
928
+ tags: request.tags
929
+ });
930
+ const marshalUpdateLbRequest = (request, defaults) => ({
931
+ description: request.description,
932
+ name: request.name,
933
+ ssl_compatibility_level: request.sslCompatibilityLevel,
934
+ tags: request.tags
935
+ });
936
+ const marshalUpdateRouteRequest = (request, defaults) => ({
937
+ backend_id: request.backendId,
938
+ match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0
939
+ });
940
+ const marshalUpdateSubscriberRequest = (request, defaults) => ({
941
+ name: request.name,
942
+ ...sdkClient.resolveOneOf([
943
+ {
944
+ param: "email_config",
945
+ value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0
946
+ },
947
+ {
948
+ param: "webhook_config",
949
+ value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0
950
+ }
951
+ ])
952
+ });
953
+ const marshalZonedApiAddBackendServersRequest = (request, defaults) => ({
954
+ server_ip: request.serverIp
955
+ });
956
+ const marshalZonedApiAttachPrivateNetworkRequest = (request, defaults) => ({
957
+ ipam_ids: request.ipamIds,
958
+ private_network_id: request.privateNetworkId,
959
+ ...sdkClient.resolveOneOf([
960
+ {
961
+ param: "static_config",
962
+ value: request.staticConfig !== void 0 ? marshalPrivateNetworkStaticConfig(request.staticConfig) : void 0
963
+ },
964
+ {
965
+ param: "dhcp_config",
966
+ value: request.dhcpConfig !== void 0 ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : void 0
967
+ },
968
+ {
969
+ param: "ipam_config",
970
+ value: request.ipamConfig !== void 0 ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : void 0
971
+ }
972
+ ])
973
+ });
974
+ const marshalZonedApiCreateAclRequest = (request, defaults) => ({
975
+ action: marshalAclAction(request.action),
976
+ description: request.description,
977
+ index: request.index,
978
+ match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,
979
+ name: request.name || randomName("acl")
980
+ });
981
+ const marshalZonedApiCreateBackendRequest = (request, defaults) => ({
982
+ failover_host: request.failoverHost,
983
+ forward_port: request.forwardPort,
984
+ forward_port_algorithm: request.forwardPortAlgorithm,
985
+ forward_protocol: request.forwardProtocol,
986
+ health_check: marshalHealthCheck(request.healthCheck),
987
+ ignore_ssl_server_verify: request.ignoreSslServerVerify,
988
+ max_connections: request.maxConnections,
989
+ max_retries: request.maxRetries,
990
+ name: request.name || randomName("lbb"),
991
+ on_marked_down_action: request.onMarkedDownAction,
992
+ proxy_protocol: request.proxyProtocol,
993
+ redispatch_attempt_count: request.redispatchAttemptCount,
994
+ send_proxy_v2: request.sendProxyV2,
995
+ server_ip: request.serverIp,
996
+ ssl_bridging: request.sslBridging,
997
+ sticky_sessions: request.stickySessions,
998
+ sticky_sessions_cookie_name: request.stickySessionsCookieName,
999
+ timeout_connect: request.timeoutConnect,
1000
+ timeout_queue: request.timeoutQueue,
1001
+ timeout_server: request.timeoutServer,
1002
+ timeout_tunnel: request.timeoutTunnel
1003
+ });
1004
+ const marshalZonedApiCreateCertificateRequest = (request, defaults) => ({
1005
+ name: request.name || randomName("certificate"),
1006
+ ...sdkClient.resolveOneOf([
1007
+ {
1008
+ param: "letsencrypt",
1009
+ value: request.letsencrypt !== void 0 ? marshalCreateCertificateRequestLetsencryptConfig(
1010
+ request.letsencrypt
1011
+ ) : void 0
1012
+ },
1013
+ {
1014
+ param: "custom_certificate",
1015
+ value: request.customCertificate !== void 0 ? marshalCreateCertificateRequestCustomCertificate(
1016
+ request.customCertificate
1017
+ ) : void 0
1018
+ }
1019
+ ])
1020
+ });
1021
+ const marshalZonedApiCreateFrontendRequest = (request, defaults) => ({
1022
+ backend_id: request.backendId,
1023
+ certificate_id: request.certificateId,
1024
+ certificate_ids: request.certificateIds,
1025
+ connection_rate_limit: request.connectionRateLimit,
1026
+ enable_http3: request.enableHttp3,
1027
+ inbound_port: request.inboundPort,
1028
+ name: request.name || randomName("lbf"),
1029
+ timeout_client: request.timeoutClient
1030
+ });
1031
+ const marshalZonedApiCreateIpRequest = (request, defaults) => ({
1032
+ is_ipv6: request.isIpv6,
1033
+ reverse: request.reverse,
1034
+ tags: request.tags,
1035
+ ...sdkClient.resolveOneOf([
1036
+ {
1037
+ default: defaults.defaultProjectId,
1038
+ param: "project_id",
1039
+ value: request.projectId
1040
+ },
1041
+ {
1042
+ default: defaults.defaultOrganizationId,
1043
+ param: "organization_id",
1044
+ value: request.organizationId
1045
+ }
1046
+ ])
1047
+ });
1048
+ const marshalZonedApiCreateLbRequest = (request, defaults) => ({
1049
+ assign_flexible_ip: request.assignFlexibleIp,
1050
+ assign_flexible_ipv6: request.assignFlexibleIpv6,
1051
+ description: request.description,
1052
+ ip_id: request.ipId,
1053
+ ip_ids: request.ipIds,
1054
+ name: request.name || randomName("lb"),
1055
+ ssl_compatibility_level: request.sslCompatibilityLevel,
1056
+ tags: request.tags,
1057
+ type: request.type,
1058
+ ...sdkClient.resolveOneOf([
1059
+ {
1060
+ default: defaults.defaultProjectId,
1061
+ param: "project_id",
1062
+ value: request.projectId
1063
+ },
1064
+ {
1065
+ default: defaults.defaultOrganizationId,
1066
+ param: "organization_id",
1067
+ value: request.organizationId
1068
+ }
1069
+ ])
1070
+ });
1071
+ const marshalZonedApiCreateRouteRequest = (request, defaults) => ({
1072
+ backend_id: request.backendId,
1073
+ frontend_id: request.frontendId,
1074
+ match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0
1075
+ });
1076
+ const marshalZonedApiCreateSubscriberRequest = (request, defaults) => ({
1077
+ name: request.name,
1078
+ ...sdkClient.resolveOneOf([
1079
+ {
1080
+ default: defaults.defaultProjectId,
1081
+ param: "project_id",
1082
+ value: request.projectId
1083
+ },
1084
+ {
1085
+ default: defaults.defaultOrganizationId,
1086
+ param: "organization_id",
1087
+ value: request.organizationId
1088
+ }
1089
+ ]),
1090
+ ...sdkClient.resolveOneOf([
1091
+ {
1092
+ param: "email_config",
1093
+ value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0
1094
+ },
1095
+ {
1096
+ param: "webhook_config",
1097
+ value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0
1098
+ }
1099
+ ])
1100
+ });
1101
+ const marshalZonedApiDetachPrivateNetworkRequest = (request, defaults) => ({
1102
+ private_network_id: request.privateNetworkId
1103
+ });
1104
+ const marshalZonedApiMigrateLbRequest = (request, defaults) => ({
1105
+ type: request.type
1106
+ });
1107
+ const marshalZonedApiRemoveBackendServersRequest = (request, defaults) => ({
1108
+ server_ip: request.serverIp
1109
+ });
1110
+ const marshalAclSpec = (request, defaults) => ({
1111
+ action: marshalAclAction(request.action),
1112
+ description: request.description,
1113
+ index: request.index,
1114
+ match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,
1115
+ name: request.name
1116
+ });
1117
+ const marshalZonedApiSetAclsRequest = (request, defaults) => ({
1118
+ acls: request.acls.map((elt) => marshalAclSpec(elt))
1119
+ });
1120
+ const marshalZonedApiSetBackendServersRequest = (request, defaults) => ({
1121
+ server_ip: request.serverIp
1122
+ });
1123
+ const marshalZonedApiSubscribeToLbRequest = (request, defaults) => ({
1124
+ subscriber_id: request.subscriberId
1125
+ });
1126
+ const marshalZonedApiUpdateAclRequest = (request, defaults) => ({
1127
+ action: marshalAclAction(request.action),
1128
+ description: request.description,
1129
+ index: request.index,
1130
+ match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,
1131
+ name: request.name
1132
+ });
1133
+ const marshalZonedApiUpdateBackendRequest = (request, defaults) => ({
1134
+ failover_host: request.failoverHost,
1135
+ forward_port: request.forwardPort,
1136
+ forward_port_algorithm: request.forwardPortAlgorithm,
1137
+ forward_protocol: request.forwardProtocol,
1138
+ ignore_ssl_server_verify: request.ignoreSslServerVerify,
1139
+ max_connections: request.maxConnections,
1140
+ max_retries: request.maxRetries,
1141
+ name: request.name,
1142
+ on_marked_down_action: request.onMarkedDownAction,
1143
+ proxy_protocol: request.proxyProtocol,
1144
+ redispatch_attempt_count: request.redispatchAttemptCount,
1145
+ send_proxy_v2: request.sendProxyV2,
1146
+ ssl_bridging: request.sslBridging,
1147
+ sticky_sessions: request.stickySessions,
1148
+ sticky_sessions_cookie_name: request.stickySessionsCookieName,
1149
+ timeout_connect: request.timeoutConnect,
1150
+ timeout_queue: request.timeoutQueue,
1151
+ timeout_server: request.timeoutServer,
1152
+ timeout_tunnel: request.timeoutTunnel
1153
+ });
1154
+ const marshalZonedApiUpdateCertificateRequest = (request, defaults) => ({
1155
+ name: request.name
1156
+ });
1157
+ const marshalZonedApiUpdateFrontendRequest = (request, defaults) => ({
1158
+ backend_id: request.backendId,
1159
+ certificate_id: request.certificateId,
1160
+ certificate_ids: request.certificateIds,
1161
+ connection_rate_limit: request.connectionRateLimit,
1162
+ enable_http3: request.enableHttp3,
1163
+ inbound_port: request.inboundPort,
1164
+ name: request.name,
1165
+ timeout_client: request.timeoutClient
1166
+ });
1167
+ const marshalZonedApiUpdateHealthCheckRequest = (request, defaults) => ({
1168
+ check_delay: request.checkDelay,
1169
+ check_max_retries: request.checkMaxRetries,
1170
+ check_send_proxy: request.checkSendProxy,
1171
+ check_timeout: request.checkTimeout,
1172
+ port: request.port,
1173
+ transient_check_delay: request.transientCheckDelay,
1174
+ ...sdkClient.resolveOneOf([
1175
+ {
1176
+ param: "tcp_config",
1177
+ value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0
1178
+ },
1179
+ {
1180
+ param: "mysql_config",
1181
+ value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0
1182
+ },
1183
+ {
1184
+ param: "pgsql_config",
1185
+ value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0
1186
+ },
1187
+ {
1188
+ param: "ldap_config",
1189
+ value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0
1190
+ },
1191
+ {
1192
+ param: "redis_config",
1193
+ value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0
1194
+ },
1195
+ {
1196
+ param: "http_config",
1197
+ value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0
1198
+ },
1199
+ {
1200
+ param: "https_config",
1201
+ value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0
1202
+ }
1203
+ ])
1204
+ });
1205
+ const marshalZonedApiUpdateIpRequest = (request, defaults) => ({
1206
+ lb_id: request.lbId,
1207
+ reverse: request.reverse,
1208
+ tags: request.tags
1209
+ });
1210
+ const marshalZonedApiUpdateLbRequest = (request, defaults) => ({
1211
+ description: request.description,
1212
+ name: request.name,
1213
+ ssl_compatibility_level: request.sslCompatibilityLevel,
1214
+ tags: request.tags
1215
+ });
1216
+ const marshalZonedApiUpdateRouteRequest = (request, defaults) => ({
1217
+ backend_id: request.backendId,
1218
+ match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0
1219
+ });
1220
+ const marshalZonedApiUpdateSubscriberRequest = (request, defaults) => ({
1221
+ name: request.name,
1222
+ ...sdkClient.resolveOneOf([
1223
+ {
1224
+ param: "email_config",
1225
+ value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0
1226
+ },
1227
+ {
1228
+ param: "webhook_config",
1229
+ value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0
1230
+ }
1231
+ ])
1232
+ });
1233
+ exports.marshalAddBackendServersRequest = marshalAddBackendServersRequest;
1234
+ exports.marshalAttachPrivateNetworkRequest = marshalAttachPrivateNetworkRequest;
1235
+ exports.marshalCreateAclRequest = marshalCreateAclRequest;
1236
+ exports.marshalCreateBackendRequest = marshalCreateBackendRequest;
1237
+ exports.marshalCreateCertificateRequest = marshalCreateCertificateRequest;
1238
+ exports.marshalCreateFrontendRequest = marshalCreateFrontendRequest;
1239
+ exports.marshalCreateIpRequest = marshalCreateIpRequest;
1240
+ exports.marshalCreateLbRequest = marshalCreateLbRequest;
1241
+ exports.marshalCreateRouteRequest = marshalCreateRouteRequest;
1242
+ exports.marshalCreateSubscriberRequest = marshalCreateSubscriberRequest;
1243
+ exports.marshalMigrateLbRequest = marshalMigrateLbRequest;
1244
+ exports.marshalRemoveBackendServersRequest = marshalRemoveBackendServersRequest;
1245
+ exports.marshalSetBackendServersRequest = marshalSetBackendServersRequest;
1246
+ exports.marshalSubscribeToLbRequest = marshalSubscribeToLbRequest;
1247
+ exports.marshalUpdateAclRequest = marshalUpdateAclRequest;
1248
+ exports.marshalUpdateBackendRequest = marshalUpdateBackendRequest;
1249
+ exports.marshalUpdateCertificateRequest = marshalUpdateCertificateRequest;
1250
+ exports.marshalUpdateFrontendRequest = marshalUpdateFrontendRequest;
1251
+ exports.marshalUpdateHealthCheckRequest = marshalUpdateHealthCheckRequest;
1252
+ exports.marshalUpdateIpRequest = marshalUpdateIpRequest;
1253
+ exports.marshalUpdateLbRequest = marshalUpdateLbRequest;
1254
+ exports.marshalUpdateRouteRequest = marshalUpdateRouteRequest;
1255
+ exports.marshalUpdateSubscriberRequest = marshalUpdateSubscriberRequest;
1256
+ exports.marshalZonedApiAddBackendServersRequest = marshalZonedApiAddBackendServersRequest;
1257
+ exports.marshalZonedApiAttachPrivateNetworkRequest = marshalZonedApiAttachPrivateNetworkRequest;
1258
+ exports.marshalZonedApiCreateAclRequest = marshalZonedApiCreateAclRequest;
1259
+ exports.marshalZonedApiCreateBackendRequest = marshalZonedApiCreateBackendRequest;
1260
+ exports.marshalZonedApiCreateCertificateRequest = marshalZonedApiCreateCertificateRequest;
1261
+ exports.marshalZonedApiCreateFrontendRequest = marshalZonedApiCreateFrontendRequest;
1262
+ exports.marshalZonedApiCreateIpRequest = marshalZonedApiCreateIpRequest;
1263
+ exports.marshalZonedApiCreateLbRequest = marshalZonedApiCreateLbRequest;
1264
+ exports.marshalZonedApiCreateRouteRequest = marshalZonedApiCreateRouteRequest;
1265
+ exports.marshalZonedApiCreateSubscriberRequest = marshalZonedApiCreateSubscriberRequest;
1266
+ exports.marshalZonedApiDetachPrivateNetworkRequest = marshalZonedApiDetachPrivateNetworkRequest;
1267
+ exports.marshalZonedApiMigrateLbRequest = marshalZonedApiMigrateLbRequest;
1268
+ exports.marshalZonedApiRemoveBackendServersRequest = marshalZonedApiRemoveBackendServersRequest;
1269
+ exports.marshalZonedApiSetAclsRequest = marshalZonedApiSetAclsRequest;
1270
+ exports.marshalZonedApiSetBackendServersRequest = marshalZonedApiSetBackendServersRequest;
1271
+ exports.marshalZonedApiSubscribeToLbRequest = marshalZonedApiSubscribeToLbRequest;
1272
+ exports.marshalZonedApiUpdateAclRequest = marshalZonedApiUpdateAclRequest;
1273
+ exports.marshalZonedApiUpdateBackendRequest = marshalZonedApiUpdateBackendRequest;
1274
+ exports.marshalZonedApiUpdateCertificateRequest = marshalZonedApiUpdateCertificateRequest;
1275
+ exports.marshalZonedApiUpdateFrontendRequest = marshalZonedApiUpdateFrontendRequest;
1276
+ exports.marshalZonedApiUpdateHealthCheckRequest = marshalZonedApiUpdateHealthCheckRequest;
1277
+ exports.marshalZonedApiUpdateIpRequest = marshalZonedApiUpdateIpRequest;
1278
+ exports.marshalZonedApiUpdateLbRequest = marshalZonedApiUpdateLbRequest;
1279
+ exports.marshalZonedApiUpdateRouteRequest = marshalZonedApiUpdateRouteRequest;
1280
+ exports.marshalZonedApiUpdateSubscriberRequest = marshalZonedApiUpdateSubscriberRequest;
1281
+ exports.unmarshalAcl = unmarshalAcl;
1282
+ exports.unmarshalBackend = unmarshalBackend;
1283
+ exports.unmarshalBackendServerStats = unmarshalBackendServerStats;
1284
+ exports.unmarshalCertificate = unmarshalCertificate;
1285
+ exports.unmarshalFrontend = unmarshalFrontend;
1286
+ exports.unmarshalHealthCheck = unmarshalHealthCheck;
1287
+ exports.unmarshalIp = unmarshalIp;
1288
+ exports.unmarshalLb = unmarshalLb;
1289
+ exports.unmarshalLbStats = unmarshalLbStats;
1290
+ exports.unmarshalListAclResponse = unmarshalListAclResponse;
1291
+ exports.unmarshalListBackendStatsResponse = unmarshalListBackendStatsResponse;
1292
+ exports.unmarshalListBackendsResponse = unmarshalListBackendsResponse;
1293
+ exports.unmarshalListCertificatesResponse = unmarshalListCertificatesResponse;
1294
+ exports.unmarshalListFrontendsResponse = unmarshalListFrontendsResponse;
1295
+ exports.unmarshalListIpsResponse = unmarshalListIpsResponse;
1296
+ exports.unmarshalListLbPrivateNetworksResponse = unmarshalListLbPrivateNetworksResponse;
1297
+ exports.unmarshalListLbTypesResponse = unmarshalListLbTypesResponse;
1298
+ exports.unmarshalListLbsResponse = unmarshalListLbsResponse;
1299
+ exports.unmarshalListRoutesResponse = unmarshalListRoutesResponse;
1300
+ exports.unmarshalListSubscriberResponse = unmarshalListSubscriberResponse;
1301
+ exports.unmarshalPrivateNetwork = unmarshalPrivateNetwork;
1302
+ exports.unmarshalRoute = unmarshalRoute;
1303
+ exports.unmarshalSetAclsResponse = unmarshalSetAclsResponse;
1304
+ exports.unmarshalSubscriber = unmarshalSubscriber;