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

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 (215) hide show
  1. package/dist/api/account/index.js +4 -0
  2. package/dist/api/account/v2/api.gen.js +147 -0
  3. package/dist/api/account/v2/index.gen.js +4 -0
  4. package/dist/api/account/v2/marshalling.gen.js +39 -0
  5. package/dist/api/account/v3/api.gen.js +129 -0
  6. package/dist/api/account/v3/index.gen.js +6 -0
  7. package/dist/api/account/v3/marshalling.gen.js +39 -0
  8. package/dist/api/account/v3/validation-rules.gen.js +39 -0
  9. package/dist/api/applesilicon/index.js +2 -0
  10. package/dist/api/applesilicon/v1alpha1/api.gen.js +220 -0
  11. package/dist/api/applesilicon/v1alpha1/content.gen.js +7 -0
  12. package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -0
  13. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +113 -0
  14. package/dist/api/baremetal/index.js +2 -0
  15. package/dist/api/baremetal/v1/api.gen.js +523 -0
  16. package/dist/api/baremetal/v1/api.utils.js +27 -0
  17. package/dist/api/baremetal/v1/content.gen.js +13 -0
  18. package/dist/api/baremetal/v1/index.js +5 -0
  19. package/dist/api/baremetal/v1/marshalling.gen.js +406 -0
  20. package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
  21. package/dist/api/billing/index.js +2 -0
  22. package/dist/api/billing/v2alpha1/api.gen.js +80 -0
  23. package/dist/api/billing/v2alpha1/index.gen.js +4 -0
  24. package/dist/api/billing/v2alpha1/marshalling.gen.js +53 -0
  25. package/dist/api/block/index.js +2 -0
  26. package/dist/api/block/v1alpha1/api.gen.js +249 -0
  27. package/dist/api/block/v1alpha1/content.gen.js +13 -0
  28. package/dist/api/block/v1alpha1/index.gen.js +7 -0
  29. package/dist/api/block/v1alpha1/marshalling.gen.js +182 -0
  30. package/dist/api/block/v1alpha1/validation-rules.gen.js +52 -0
  31. package/dist/api/cockpit/index.js +2 -0
  32. package/dist/api/cockpit/v1beta1/api.gen.js +543 -0
  33. package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
  34. package/dist/api/cockpit/v1beta1/index.gen.js +5 -0
  35. package/dist/api/cockpit/v1beta1/marshalling.gen.js +271 -0
  36. package/dist/api/container/index.js +2 -0
  37. package/dist/api/container/v1beta1/api.gen.js +549 -0
  38. package/dist/api/container/v1beta1/content.gen.js +22 -0
  39. package/dist/api/container/v1beta1/index.gen.js +7 -0
  40. package/dist/api/container/v1beta1/marshalling.gen.js +358 -0
  41. package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
  42. package/dist/api/document_db/index.js +2 -0
  43. package/dist/api/document_db/v1beta1/api.gen.js +830 -0
  44. package/dist/api/document_db/v1beta1/content.gen.js +19 -0
  45. package/dist/api/document_db/v1beta1/index.gen.js +7 -0
  46. package/dist/api/document_db/v1beta1/marshalling.gen.js +636 -0
  47. package/dist/api/document_db/v1beta1/validation-rules.gen.js +10 -0
  48. package/dist/api/domain/index.js +2 -0
  49. package/dist/api/domain/v2beta1/api.gen.js +867 -0
  50. package/dist/api/domain/v2beta1/content.gen.js +28 -0
  51. package/dist/api/domain/v2beta1/index.gen.js +5 -0
  52. package/dist/api/domain/v2beta1/marshalling.gen.js +1172 -0
  53. package/dist/api/flexibleip/index.js +2 -0
  54. package/dist/api/flexibleip/v1alpha1/api.gen.js +195 -0
  55. package/dist/api/flexibleip/v1alpha1/content.gen.js +10 -0
  56. package/dist/api/flexibleip/v1alpha1/index.gen.js +7 -0
  57. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +97 -0
  58. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
  59. package/dist/api/function/index.js +2 -0
  60. package/dist/api/function/v1beta1/api.gen.js +560 -0
  61. package/dist/api/function/v1beta1/content.gen.js +22 -0
  62. package/dist/api/function/v1beta1/index.gen.js +7 -0
  63. package/dist/api/function/v1beta1/marshalling.gen.js +396 -0
  64. package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
  65. package/dist/api/iam/index.js +2 -0
  66. package/dist/api/iam/v1alpha1/api.gen.js +783 -0
  67. package/dist/api/iam/v1alpha1/index.gen.js +6 -0
  68. package/dist/api/iam/v1alpha1/marshalling.gen.js +384 -0
  69. package/dist/api/iam/v1alpha1/validation-rules.gen.js +207 -0
  70. package/dist/api/instance/index.js +2 -0
  71. package/dist/api/instance/v1/api.gen.js +1003 -0
  72. package/dist/api/instance/v1/api.utils.js +369 -0
  73. package/dist/api/instance/v1/content.gen.js +31 -0
  74. package/dist/api/instance/v1/index.js +2 -0
  75. package/dist/api/instance/v1/marshalling.gen.js +1415 -0
  76. package/dist/api/instance/v1/marshalling.utils.js +63 -0
  77. package/dist/api/iot/index.js +2 -0
  78. package/dist/api/iot/v1/api.gen.js +573 -0
  79. package/dist/api/iot/v1/content.gen.js +7 -0
  80. package/dist/api/iot/v1/index.gen.js +5 -0
  81. package/dist/api/iot/v1/marshalling.gen.js +439 -0
  82. package/dist/api/ipam/index.js +2 -0
  83. package/dist/api/ipam/v1/api.gen.js +113 -0
  84. package/dist/api/ipam/v1/index.gen.js +6 -0
  85. package/dist/api/ipam/v1/marshalling.gen.js +77 -0
  86. package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
  87. package/dist/api/ipfs/index.js +2 -0
  88. package/dist/api/ipfs/v1alpha1/api.gen.js +314 -0
  89. package/dist/api/ipfs/v1alpha1/content.gen.js +10 -0
  90. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  91. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +180 -0
  92. package/dist/api/k8s/index.js +2 -0
  93. package/dist/api/k8s/v1/api.gen.js +454 -0
  94. package/dist/api/k8s/v1/api.utils.js +13 -0
  95. package/dist/api/k8s/v1/content.gen.js +13 -0
  96. package/dist/api/k8s/v1/index.js +4 -0
  97. package/dist/api/k8s/v1/marshalling.gen.js +421 -0
  98. package/dist/api/k8s/v1/validation-rules.gen.js +101 -0
  99. package/dist/api/lb/index.js +2 -0
  100. package/dist/api/lb/v1/api.gen.js +1669 -0
  101. package/dist/api/lb/v1/api.utils.js +81 -0
  102. package/dist/api/lb/v1/content.gen.js +16 -0
  103. package/dist/api/lb/v1/index.js +2 -0
  104. package/dist/api/lb/v1/marshalling.gen.js +1039 -0
  105. package/dist/api/marketplace/index.js +4 -0
  106. package/dist/api/marketplace/v1/api.gen.js +60 -0
  107. package/dist/api/marketplace/v1/index.gen.js +4 -0
  108. package/dist/api/marketplace/v1/marshalling.gen.js +92 -0
  109. package/dist/api/marketplace/v2/api.gen.js +162 -0
  110. package/dist/api/marketplace/v2/index.gen.js +4 -0
  111. package/dist/api/marketplace/v2/marshalling.gen.js +94 -0
  112. package/dist/api/mnq/index.js +4 -0
  113. package/dist/api/mnq/v1alpha1/api.gen.js +197 -0
  114. package/dist/api/mnq/v1alpha1/index.gen.js +4 -0
  115. package/dist/api/mnq/v1alpha1/marshalling.gen.js +126 -0
  116. package/dist/api/mnq/v1beta1/api.gen.js +529 -0
  117. package/dist/api/mnq/v1beta1/index.gen.js +6 -0
  118. package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
  119. package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
  120. package/dist/api/rdb/index.js +2 -0
  121. package/dist/api/rdb/v1/api.gen.js +972 -0
  122. package/dist/api/rdb/v1/content.gen.js +22 -0
  123. package/dist/api/rdb/v1/index.gen.js +7 -0
  124. package/dist/api/rdb/v1/marshalling.gen.js +694 -0
  125. package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
  126. package/dist/api/redis/index.js +2 -0
  127. package/dist/api/redis/v1/api.gen.js +389 -0
  128. package/dist/api/redis/v1/content.gen.js +7 -0
  129. package/dist/api/redis/v1/index.gen.js +5 -0
  130. package/dist/api/redis/v1/marshalling.gen.js +283 -0
  131. package/dist/api/registry/index.js +2 -0
  132. package/dist/api/registry/v1/api.gen.js +252 -0
  133. package/dist/api/registry/v1/content.gen.js +13 -0
  134. package/dist/api/registry/v1/index.gen.js +5 -0
  135. package/dist/api/registry/v1/marshalling.gen.js +108 -0
  136. package/dist/api/secret/index.js +2 -0
  137. package/dist/api/secret/v1alpha1/api.gen.js +415 -0
  138. package/dist/api/secret/v1alpha1/index.gen.js +4 -0
  139. package/dist/api/secret/v1alpha1/marshalling.gen.js +150 -0
  140. package/dist/api/tem/index.js +2 -0
  141. package/dist/api/tem/v1alpha1/api.gen.js +229 -0
  142. package/dist/api/tem/v1alpha1/content.gen.js +10 -0
  143. package/dist/api/tem/v1alpha1/index.gen.js +5 -0
  144. package/dist/api/tem/v1alpha1/marshalling.gen.js +168 -0
  145. package/dist/api/test/index.js +2 -0
  146. package/dist/api/test/v1/api.gen.js +152 -0
  147. package/dist/api/test/v1/content.gen.js +7 -0
  148. package/dist/api/test/v1/index.gen.js +5 -0
  149. package/dist/api/test/v1/marshalling.gen.js +81 -0
  150. package/dist/api/vpc/index.js +4 -0
  151. package/dist/api/vpc/v1/api.gen.js +110 -0
  152. package/dist/api/vpc/v1/index.gen.js +4 -0
  153. package/dist/api/vpc/v1/marshalling.gen.js +44 -0
  154. package/dist/api/vpc/v2/api.gen.js +276 -0
  155. package/dist/api/vpc/v2/index.gen.js +4 -0
  156. package/dist/api/vpc/v2/marshalling.gen.js +137 -0
  157. package/dist/api/vpcgw/index.js +2 -0
  158. package/dist/api/vpcgw/v1/api.gen.js +669 -0
  159. package/dist/api/vpcgw/v1/content.gen.js +10 -0
  160. package/dist/api/vpcgw/v1/index.gen.js +5 -0
  161. package/dist/api/vpcgw/v1/marshalling.gen.js +359 -0
  162. package/dist/api/webhosting/index.js +2 -0
  163. package/dist/api/webhosting/v1alpha1/api.gen.js +158 -0
  164. package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
  165. package/dist/api/webhosting/v1alpha1/index.gen.js +7 -0
  166. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +146 -0
  167. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
  168. package/dist/helpers/is-browser.js +5 -0
  169. package/dist/helpers/is-response.js +10 -0
  170. package/dist/helpers/json.js +11 -0
  171. package/dist/helpers/marshalling.js +130 -0
  172. package/dist/index.cjs +26484 -0
  173. package/dist/index.d.ts +31184 -0
  174. package/dist/index.js +71 -0
  175. package/dist/internal/async/interval-retrier.js +105 -0
  176. package/dist/internal/async/sleep.js +13 -0
  177. package/dist/internal/interceptors/composer.js +46 -0
  178. package/dist/internal/interceptors/helpers.js +32 -0
  179. package/dist/internal/logger/console-logger.js +38 -0
  180. package/dist/internal/logger/index.js +41 -0
  181. package/dist/internal/logger/level-resolver.js +13 -0
  182. package/dist/internal/validations/string-validation.js +38 -0
  183. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +13 -0
  184. package/dist/scw/api.js +12 -0
  185. package/dist/scw/auth.js +68 -0
  186. package/dist/scw/client-ini-factory.js +174 -0
  187. package/dist/scw/client-ini-profile.js +54 -0
  188. package/dist/scw/client-settings.js +78 -0
  189. package/dist/scw/client.js +98 -0
  190. package/dist/scw/constants.js +4 -0
  191. package/dist/scw/custom-marshalling.js +131 -0
  192. package/dist/scw/errors/error-parser.js +107 -0
  193. package/dist/scw/errors/non-standard/invalid-request-mapper.js +36 -0
  194. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +27 -0
  195. package/dist/scw/errors/scw-error.js +66 -0
  196. package/dist/scw/errors/standard/already-exists-error.js +26 -0
  197. package/dist/scw/errors/standard/denied-authentication-error.js +52 -0
  198. package/dist/scw/errors/standard/index.js +13 -0
  199. package/dist/scw/errors/standard/invalid-arguments-error.js +67 -0
  200. package/dist/scw/errors/standard/out-of-stock-error.js +22 -0
  201. package/dist/scw/errors/standard/permissions-denied-error.js +48 -0
  202. package/dist/scw/errors/standard/precondition-failed-error.js +42 -0
  203. package/dist/scw/errors/standard/quotas-exceeded-error.js +68 -0
  204. package/dist/scw/errors/standard/resource-expired-error.js +26 -0
  205. package/dist/scw/errors/standard/resource-locked-error.js +25 -0
  206. package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
  207. package/dist/scw/errors/standard/too-many-requests-error.js +70 -0
  208. package/dist/scw/errors/standard/transient-state-error.js +26 -0
  209. package/dist/scw/errors/types.js +23 -0
  210. package/dist/scw/fetch/build-fetcher.js +72 -0
  211. package/dist/scw/fetch/http-dumper.js +54 -0
  212. package/dist/scw/fetch/http-interceptors.js +99 -0
  213. package/dist/scw/fetch/resource-paginator.js +84 -0
  214. package/dist/scw/fetch/response-parser.js +72 -0
  215. package/package.json +2 -2
@@ -0,0 +1,1039 @@
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 unmarshalIp = data => {
8
+ if (!isJSONObject(data)) {
9
+ throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`);
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
+ zone: data.zone
20
+ };
21
+ };
22
+ const unmarshalSubscriberEmailConfig = data => {
23
+ if (!isJSONObject(data)) {
24
+ throw new TypeError(`Unmarshalling the type 'SubscriberEmailConfig' failed as data isn't a dictionary.`);
25
+ }
26
+ return {
27
+ email: data.email
28
+ };
29
+ };
30
+ const unmarshalSubscriberWebhookConfig = data => {
31
+ if (!isJSONObject(data)) {
32
+ throw new TypeError(`Unmarshalling the type 'SubscriberWebhookConfig' failed as data isn't a dictionary.`);
33
+ }
34
+ return {
35
+ uri: data.uri
36
+ };
37
+ };
38
+ const unmarshalSubscriber = data => {
39
+ if (!isJSONObject(data)) {
40
+ throw new TypeError(`Unmarshalling the type 'Subscriber' failed as data isn't a dictionary.`);
41
+ }
42
+ return {
43
+ emailConfig: data.email_config ? unmarshalSubscriberEmailConfig(data.email_config) : undefined,
44
+ id: data.id,
45
+ name: data.name,
46
+ webhookConfig: data.webhook_config ? unmarshalSubscriberWebhookConfig(data.webhook_config) : undefined
47
+ };
48
+ };
49
+ const unmarshalHealthCheckHttpConfig = data => {
50
+ if (!isJSONObject(data)) {
51
+ throw new TypeError(`Unmarshalling the type 'HealthCheckHttpConfig' failed as data isn't a dictionary.`);
52
+ }
53
+ return {
54
+ code: data.code,
55
+ hostHeader: data.host_header,
56
+ method: data.method,
57
+ uri: data.uri
58
+ };
59
+ };
60
+ const unmarshalHealthCheckHttpsConfig = data => {
61
+ if (!isJSONObject(data)) {
62
+ throw new TypeError(`Unmarshalling the type 'HealthCheckHttpsConfig' failed as data isn't a dictionary.`);
63
+ }
64
+ return {
65
+ code: data.code,
66
+ hostHeader: data.host_header,
67
+ method: data.method,
68
+ sni: data.sni,
69
+ uri: data.uri
70
+ };
71
+ };
72
+ const unmarshalHealthCheckLdapConfig = data => {
73
+ if (!isJSONObject(data)) {
74
+ throw new TypeError(`Unmarshalling the type 'HealthCheckLdapConfig' failed as data isn't a dictionary.`);
75
+ }
76
+ return {};
77
+ };
78
+ const unmarshalHealthCheckMysqlConfig = data => {
79
+ if (!isJSONObject(data)) {
80
+ throw new TypeError(`Unmarshalling the type 'HealthCheckMysqlConfig' failed as data isn't a dictionary.`);
81
+ }
82
+ return {
83
+ user: data.user
84
+ };
85
+ };
86
+ const unmarshalHealthCheckPgsqlConfig = data => {
87
+ if (!isJSONObject(data)) {
88
+ throw new TypeError(`Unmarshalling the type 'HealthCheckPgsqlConfig' failed as data isn't a dictionary.`);
89
+ }
90
+ return {
91
+ user: data.user
92
+ };
93
+ };
94
+ const unmarshalHealthCheckRedisConfig = data => {
95
+ if (!isJSONObject(data)) {
96
+ throw new TypeError(`Unmarshalling the type 'HealthCheckRedisConfig' failed as data isn't a dictionary.`);
97
+ }
98
+ return {};
99
+ };
100
+ const unmarshalHealthCheckTcpConfig = data => {
101
+ if (!isJSONObject(data)) {
102
+ throw new TypeError(`Unmarshalling the type 'HealthCheckTcpConfig' failed as data isn't a dictionary.`);
103
+ }
104
+ return {};
105
+ };
106
+ const unmarshalHealthCheck = data => {
107
+ if (!isJSONObject(data)) {
108
+ throw new TypeError(`Unmarshalling the type 'HealthCheck' failed as data isn't a dictionary.`);
109
+ }
110
+ return {
111
+ checkDelay: data.check_delay,
112
+ checkMaxRetries: data.check_max_retries,
113
+ checkSendProxy: data.check_send_proxy,
114
+ checkTimeout: data.check_timeout,
115
+ httpConfig: data.http_config ? unmarshalHealthCheckHttpConfig(data.http_config) : undefined,
116
+ httpsConfig: data.https_config ? unmarshalHealthCheckHttpsConfig(data.https_config) : undefined,
117
+ ldapConfig: data.ldap_config ? unmarshalHealthCheckLdapConfig(data.ldap_config) : undefined,
118
+ mysqlConfig: data.mysql_config ? unmarshalHealthCheckMysqlConfig(data.mysql_config) : undefined,
119
+ pgsqlConfig: data.pgsql_config ? unmarshalHealthCheckPgsqlConfig(data.pgsql_config) : undefined,
120
+ port: data.port,
121
+ redisConfig: data.redis_config ? unmarshalHealthCheckRedisConfig(data.redis_config) : undefined,
122
+ tcpConfig: data.tcp_config ? unmarshalHealthCheckTcpConfig(data.tcp_config) : undefined,
123
+ transientCheckDelay: data.transient_check_delay
124
+ };
125
+ };
126
+ const unmarshalInstance = data => {
127
+ if (!isJSONObject(data)) {
128
+ throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);
129
+ }
130
+ return {
131
+ createdAt: unmarshalDate(data.created_at),
132
+ id: data.id,
133
+ ipAddress: data.ip_address,
134
+ region: data.region,
135
+ status: data.status,
136
+ updatedAt: unmarshalDate(data.updated_at),
137
+ zone: data.zone
138
+ };
139
+ };
140
+ const unmarshalLb = data => {
141
+ if (!isJSONObject(data)) {
142
+ throw new TypeError(`Unmarshalling the type 'Lb' failed as data isn't a dictionary.`);
143
+ }
144
+ return {
145
+ backendCount: data.backend_count,
146
+ createdAt: unmarshalDate(data.created_at),
147
+ description: data.description,
148
+ frontendCount: data.frontend_count,
149
+ id: data.id,
150
+ instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
151
+ ip: unmarshalArrayOfObject(data.ip, unmarshalIp),
152
+ name: data.name,
153
+ organizationId: data.organization_id,
154
+ privateNetworkCount: data.private_network_count,
155
+ projectId: data.project_id,
156
+ region: data.region,
157
+ routeCount: data.route_count,
158
+ sslCompatibilityLevel: data.ssl_compatibility_level,
159
+ status: data.status,
160
+ subscriber: data.subscriber ? unmarshalSubscriber(data.subscriber) : undefined,
161
+ tags: data.tags,
162
+ type: data.type,
163
+ updatedAt: unmarshalDate(data.updated_at),
164
+ zone: data.zone
165
+ };
166
+ };
167
+ const unmarshalBackend = data => {
168
+ if (!isJSONObject(data)) {
169
+ throw new TypeError(`Unmarshalling the type 'Backend' failed as data isn't a dictionary.`);
170
+ }
171
+ return {
172
+ createdAt: unmarshalDate(data.created_at),
173
+ failoverHost: data.failover_host,
174
+ forwardPort: data.forward_port,
175
+ forwardPortAlgorithm: data.forward_port_algorithm,
176
+ forwardProtocol: data.forward_protocol,
177
+ healthCheck: data.health_check ? unmarshalHealthCheck(data.health_check) : undefined,
178
+ id: data.id,
179
+ ignoreSslServerVerify: data.ignore_ssl_server_verify,
180
+ lb: data.lb ? unmarshalLb(data.lb) : undefined,
181
+ maxConnections: data.max_connections,
182
+ maxRetries: data.max_retries,
183
+ name: data.name,
184
+ onMarkedDownAction: data.on_marked_down_action,
185
+ pool: data.pool,
186
+ proxyProtocol: data.proxy_protocol,
187
+ redispatchAttemptCount: data.redispatch_attempt_count,
188
+ sendProxyV2: data.send_proxy_v2,
189
+ sslBridging: data.ssl_bridging,
190
+ stickySessions: data.sticky_sessions,
191
+ stickySessionsCookieName: data.sticky_sessions_cookie_name,
192
+ timeoutConnect: data.timeout_connect,
193
+ timeoutQueue: data.timeout_queue,
194
+ timeoutServer: data.timeout_server,
195
+ timeoutTunnel: data.timeout_tunnel,
196
+ updatedAt: unmarshalDate(data.updated_at)
197
+ };
198
+ };
199
+ const unmarshalCertificate = data => {
200
+ if (!isJSONObject(data)) {
201
+ throw new TypeError(`Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`);
202
+ }
203
+ return {
204
+ commonName: data.common_name,
205
+ createdAt: unmarshalDate(data.created_at),
206
+ fingerprint: data.fingerprint,
207
+ id: data.id,
208
+ lb: data.lb ? unmarshalLb(data.lb) : undefined,
209
+ name: data.name,
210
+ notValidAfter: unmarshalDate(data.not_valid_after),
211
+ notValidBefore: unmarshalDate(data.not_valid_before),
212
+ status: data.status,
213
+ statusDetails: data.status_details,
214
+ subjectAlternativeName: data.subject_alternative_name,
215
+ type: data.type,
216
+ updatedAt: unmarshalDate(data.updated_at)
217
+ };
218
+ };
219
+ const unmarshalFrontend = data => {
220
+ if (!isJSONObject(data)) {
221
+ throw new TypeError(`Unmarshalling the type 'Frontend' failed as data isn't a dictionary.`);
222
+ }
223
+ return {
224
+ backend: data.backend ? unmarshalBackend(data.backend) : undefined,
225
+ certificate: data.certificate ? unmarshalCertificate(data.certificate) : undefined,
226
+ certificateIds: data.certificate_ids,
227
+ createdAt: unmarshalDate(data.created_at),
228
+ enableHttp3: data.enable_http3,
229
+ id: data.id,
230
+ inboundPort: data.inbound_port,
231
+ lb: data.lb ? unmarshalLb(data.lb) : undefined,
232
+ name: data.name,
233
+ timeoutClient: data.timeout_client,
234
+ updatedAt: unmarshalDate(data.updated_at)
235
+ };
236
+ };
237
+ const unmarshalAclActionRedirect = data => {
238
+ if (!isJSONObject(data)) {
239
+ throw new TypeError(`Unmarshalling the type 'AclActionRedirect' failed as data isn't a dictionary.`);
240
+ }
241
+ return {
242
+ code: data.code,
243
+ target: data.target,
244
+ type: data.type
245
+ };
246
+ };
247
+ const unmarshalAclAction = data => {
248
+ if (!isJSONObject(data)) {
249
+ throw new TypeError(`Unmarshalling the type 'AclAction' failed as data isn't a dictionary.`);
250
+ }
251
+ return {
252
+ redirect: data.redirect ? unmarshalAclActionRedirect(data.redirect) : undefined,
253
+ type: data.type
254
+ };
255
+ };
256
+ const unmarshalAclMatch = data => {
257
+ if (!isJSONObject(data)) {
258
+ throw new TypeError(`Unmarshalling the type 'AclMatch' failed as data isn't a dictionary.`);
259
+ }
260
+ return {
261
+ httpFilter: data.http_filter,
262
+ httpFilterOption: data.http_filter_option,
263
+ httpFilterValue: data.http_filter_value,
264
+ invert: data.invert,
265
+ ipSubnet: data.ip_subnet
266
+ };
267
+ };
268
+ const unmarshalAcl = data => {
269
+ if (!isJSONObject(data)) {
270
+ throw new TypeError(`Unmarshalling the type 'Acl' failed as data isn't a dictionary.`);
271
+ }
272
+ return {
273
+ action: data.action ? unmarshalAclAction(data.action) : undefined,
274
+ createdAt: unmarshalDate(data.created_at),
275
+ description: data.description,
276
+ frontend: data.frontend ? unmarshalFrontend(data.frontend) : undefined,
277
+ id: data.id,
278
+ index: data.index,
279
+ match: data.match ? unmarshalAclMatch(data.match) : undefined,
280
+ name: data.name,
281
+ updatedAt: unmarshalDate(data.updated_at)
282
+ };
283
+ };
284
+ const unmarshalPrivateNetworkDHCPConfig = data => {
285
+ if (!isJSONObject(data)) {
286
+ throw new TypeError(`Unmarshalling the type 'PrivateNetworkDHCPConfig' failed as data isn't a dictionary.`);
287
+ }
288
+ return {
289
+ ipId: data.ip_id
290
+ };
291
+ };
292
+ const unmarshalPrivateNetworkIpamConfig = data => {
293
+ if (!isJSONObject(data)) {
294
+ throw new TypeError(`Unmarshalling the type 'PrivateNetworkIpamConfig' failed as data isn't a dictionary.`);
295
+ }
296
+ return {};
297
+ };
298
+ const unmarshalPrivateNetworkStaticConfig = data => {
299
+ if (!isJSONObject(data)) {
300
+ throw new TypeError(`Unmarshalling the type 'PrivateNetworkStaticConfig' failed as data isn't a dictionary.`);
301
+ }
302
+ return {
303
+ ipAddress: data.ip_address ? data.ip_address : undefined
304
+ };
305
+ };
306
+ const unmarshalPrivateNetwork = data => {
307
+ if (!isJSONObject(data)) {
308
+ throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
309
+ }
310
+ return {
311
+ createdAt: unmarshalDate(data.created_at),
312
+ dhcpConfig: data.dhcp_config ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) : undefined,
313
+ ipamConfig: data.ipam_config ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) : undefined,
314
+ ipamIds: data.ipam_ids,
315
+ lb: data.lb ? unmarshalLb(data.lb) : undefined,
316
+ privateNetworkId: data.private_network_id,
317
+ staticConfig: data.static_config ? unmarshalPrivateNetworkStaticConfig(data.static_config) : undefined,
318
+ status: data.status,
319
+ updatedAt: unmarshalDate(data.updated_at)
320
+ };
321
+ };
322
+ const unmarshalRouteMatch = data => {
323
+ if (!isJSONObject(data)) {
324
+ throw new TypeError(`Unmarshalling the type 'RouteMatch' failed as data isn't a dictionary.`);
325
+ }
326
+ return {
327
+ hostHeader: data.host_header,
328
+ sni: data.sni
329
+ };
330
+ };
331
+ const unmarshalRoute = data => {
332
+ if (!isJSONObject(data)) {
333
+ throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`);
334
+ }
335
+ return {
336
+ backendId: data.backend_id,
337
+ createdAt: unmarshalDate(data.created_at),
338
+ frontendId: data.frontend_id,
339
+ id: data.id,
340
+ match: data.match ? unmarshalRouteMatch(data.match) : undefined,
341
+ updatedAt: unmarshalDate(data.updated_at)
342
+ };
343
+ };
344
+ const unmarshalBackendServerStats = data => {
345
+ if (!isJSONObject(data)) {
346
+ throw new TypeError(`Unmarshalling the type 'BackendServerStats' failed as data isn't a dictionary.`);
347
+ }
348
+ return {
349
+ backendId: data.backend_id,
350
+ instanceId: data.instance_id,
351
+ ip: data.ip,
352
+ lastHealthCheckStatus: data.last_health_check_status,
353
+ serverState: data.server_state,
354
+ serverStateChangedAt: unmarshalDate(data.server_state_changed_at)
355
+ };
356
+ };
357
+ const unmarshalLbStats = data => {
358
+ if (!isJSONObject(data)) {
359
+ throw new TypeError(`Unmarshalling the type 'LbStats' failed as data isn't a dictionary.`);
360
+ }
361
+ return {
362
+ backendServersStats: unmarshalArrayOfObject(data.backend_servers_stats, unmarshalBackendServerStats)
363
+ };
364
+ };
365
+ const unmarshalListAclResponse = data => {
366
+ if (!isJSONObject(data)) {
367
+ throw new TypeError(`Unmarshalling the type 'ListAclResponse' failed as data isn't a dictionary.`);
368
+ }
369
+ return {
370
+ acls: unmarshalArrayOfObject(data.acls, unmarshalAcl),
371
+ totalCount: data.total_count
372
+ };
373
+ };
374
+ const unmarshalListBackendStatsResponse = data => {
375
+ if (!isJSONObject(data)) {
376
+ throw new TypeError(`Unmarshalling the type 'ListBackendStatsResponse' failed as data isn't a dictionary.`);
377
+ }
378
+ return {
379
+ backendServersStats: unmarshalArrayOfObject(data.backend_servers_stats, unmarshalBackendServerStats),
380
+ totalCount: data.total_count
381
+ };
382
+ };
383
+ const unmarshalListBackendsResponse = data => {
384
+ if (!isJSONObject(data)) {
385
+ throw new TypeError(`Unmarshalling the type 'ListBackendsResponse' failed as data isn't a dictionary.`);
386
+ }
387
+ return {
388
+ backends: unmarshalArrayOfObject(data.backends, unmarshalBackend),
389
+ totalCount: data.total_count
390
+ };
391
+ };
392
+ const unmarshalListCertificatesResponse = data => {
393
+ if (!isJSONObject(data)) {
394
+ throw new TypeError(`Unmarshalling the type 'ListCertificatesResponse' failed as data isn't a dictionary.`);
395
+ }
396
+ return {
397
+ certificates: unmarshalArrayOfObject(data.certificates, unmarshalCertificate),
398
+ totalCount: data.total_count
399
+ };
400
+ };
401
+ const unmarshalListFrontendsResponse = data => {
402
+ if (!isJSONObject(data)) {
403
+ throw new TypeError(`Unmarshalling the type 'ListFrontendsResponse' failed as data isn't a dictionary.`);
404
+ }
405
+ return {
406
+ frontends: unmarshalArrayOfObject(data.frontends, unmarshalFrontend),
407
+ totalCount: data.total_count
408
+ };
409
+ };
410
+ const unmarshalListIpsResponse = data => {
411
+ if (!isJSONObject(data)) {
412
+ throw new TypeError(`Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`);
413
+ }
414
+ return {
415
+ ips: unmarshalArrayOfObject(data.ips, unmarshalIp),
416
+ totalCount: data.total_count
417
+ };
418
+ };
419
+ const unmarshalListLbPrivateNetworksResponse = data => {
420
+ if (!isJSONObject(data)) {
421
+ throw new TypeError(`Unmarshalling the type 'ListLbPrivateNetworksResponse' failed as data isn't a dictionary.`);
422
+ }
423
+ return {
424
+ privateNetwork: unmarshalArrayOfObject(data.private_network, unmarshalPrivateNetwork),
425
+ totalCount: data.total_count
426
+ };
427
+ };
428
+ const unmarshalLbType = data => {
429
+ if (!isJSONObject(data)) {
430
+ throw new TypeError(`Unmarshalling the type 'LbType' failed as data isn't a dictionary.`);
431
+ }
432
+ return {
433
+ description: data.description,
434
+ name: data.name,
435
+ region: data.region,
436
+ stockStatus: data.stock_status,
437
+ zone: data.zone
438
+ };
439
+ };
440
+ const unmarshalListLbTypesResponse = data => {
441
+ if (!isJSONObject(data)) {
442
+ throw new TypeError(`Unmarshalling the type 'ListLbTypesResponse' failed as data isn't a dictionary.`);
443
+ }
444
+ return {
445
+ lbTypes: unmarshalArrayOfObject(data.lb_types, unmarshalLbType),
446
+ totalCount: data.total_count
447
+ };
448
+ };
449
+ const unmarshalListLbsResponse = data => {
450
+ if (!isJSONObject(data)) {
451
+ throw new TypeError(`Unmarshalling the type 'ListLbsResponse' failed as data isn't a dictionary.`);
452
+ }
453
+ return {
454
+ lbs: unmarshalArrayOfObject(data.lbs, unmarshalLb),
455
+ totalCount: data.total_count
456
+ };
457
+ };
458
+ const unmarshalListRoutesResponse = data => {
459
+ if (!isJSONObject(data)) {
460
+ throw new TypeError(`Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`);
461
+ }
462
+ return {
463
+ routes: unmarshalArrayOfObject(data.routes, unmarshalRoute),
464
+ totalCount: data.total_count
465
+ };
466
+ };
467
+ const unmarshalListSubscriberResponse = data => {
468
+ if (!isJSONObject(data)) {
469
+ throw new TypeError(`Unmarshalling the type 'ListSubscriberResponse' failed as data isn't a dictionary.`);
470
+ }
471
+ return {
472
+ subscribers: unmarshalArrayOfObject(data.subscribers, unmarshalSubscriber),
473
+ totalCount: data.total_count
474
+ };
475
+ };
476
+ const unmarshalSetAclsResponse = data => {
477
+ if (!isJSONObject(data)) {
478
+ throw new TypeError(`Unmarshalling the type 'SetAclsResponse' failed as data isn't a dictionary.`);
479
+ }
480
+ return {
481
+ acls: unmarshalArrayOfObject(data.acls, unmarshalAcl),
482
+ totalCount: data.total_count
483
+ };
484
+ };
485
+ const marshalAddBackendServersRequest = (request, defaults) => ({
486
+ server_ip: request.serverIp
487
+ });
488
+ const marshalPrivateNetworkDHCPConfig = (request, defaults) => ({
489
+ ip_id: request.ipId
490
+ });
491
+ const marshalPrivateNetworkIpamConfig = (request, defaults) => ({});
492
+ const marshalPrivateNetworkStaticConfig = (request, defaults) => ({
493
+ ip_address: request.ipAddress
494
+ });
495
+ const marshalAttachPrivateNetworkRequest = (request, defaults) => ({
496
+ ...resolveOneOf([{
497
+ param: 'static_config',
498
+ value: request.staticConfig !== undefined ? marshalPrivateNetworkStaticConfig(request.staticConfig) : undefined
499
+ }, {
500
+ param: 'dhcp_config',
501
+ value: request.dhcpConfig !== undefined ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : undefined
502
+ }, {
503
+ param: 'ipam_config',
504
+ value: request.ipamConfig !== undefined ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : undefined
505
+ }])
506
+ });
507
+ const marshalAclActionRedirect = (request, defaults) => ({
508
+ code: request.code,
509
+ target: request.target,
510
+ type: request.type
511
+ });
512
+ const marshalAclAction = (request, defaults) => ({
513
+ redirect: request.redirect !== undefined ? marshalAclActionRedirect(request.redirect) : undefined,
514
+ type: request.type
515
+ });
516
+ const marshalAclMatch = (request, defaults) => ({
517
+ http_filter: request.httpFilter,
518
+ http_filter_option: request.httpFilterOption,
519
+ http_filter_value: request.httpFilterValue,
520
+ invert: request.invert,
521
+ ip_subnet: request.ipSubnet
522
+ });
523
+ const marshalCreateAclRequest = (request, defaults) => ({
524
+ action: marshalAclAction(request.action),
525
+ description: request.description,
526
+ index: request.index,
527
+ match: request.match !== undefined ? marshalAclMatch(request.match) : undefined,
528
+ name: request.name || randomName('acl')
529
+ });
530
+ const marshalHealthCheckHttpConfig = (request, defaults) => ({
531
+ code: request.code,
532
+ host_header: request.hostHeader,
533
+ method: request.method,
534
+ uri: request.uri
535
+ });
536
+ const marshalHealthCheckHttpsConfig = (request, defaults) => ({
537
+ code: request.code,
538
+ host_header: request.hostHeader,
539
+ method: request.method,
540
+ sni: request.sni,
541
+ uri: request.uri
542
+ });
543
+ const marshalHealthCheckLdapConfig = (request, defaults) => ({});
544
+ const marshalHealthCheckMysqlConfig = (request, defaults) => ({
545
+ user: request.user
546
+ });
547
+ const marshalHealthCheckPgsqlConfig = (request, defaults) => ({
548
+ user: request.user
549
+ });
550
+ const marshalHealthCheckRedisConfig = (request, defaults) => ({});
551
+ const marshalHealthCheckTcpConfig = (request, defaults) => ({});
552
+ const marshalHealthCheck = (request, defaults) => ({
553
+ check_delay: request.checkDelay,
554
+ check_max_retries: request.checkMaxRetries,
555
+ check_send_proxy: request.checkSendProxy,
556
+ check_timeout: request.checkTimeout,
557
+ port: request.port,
558
+ transient_check_delay: request.transientCheckDelay,
559
+ ...resolveOneOf([{
560
+ param: 'tcp_config',
561
+ value: request.tcpConfig !== undefined ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined
562
+ }, {
563
+ param: 'mysql_config',
564
+ value: request.mysqlConfig !== undefined ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined
565
+ }, {
566
+ param: 'pgsql_config',
567
+ value: request.pgsqlConfig !== undefined ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined
568
+ }, {
569
+ param: 'ldap_config',
570
+ value: request.ldapConfig !== undefined ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined
571
+ }, {
572
+ param: 'redis_config',
573
+ value: request.redisConfig !== undefined ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined
574
+ }, {
575
+ param: 'http_config',
576
+ value: request.httpConfig !== undefined ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined
577
+ }, {
578
+ param: 'https_config',
579
+ value: request.httpsConfig !== undefined ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined
580
+ }])
581
+ });
582
+ const marshalCreateBackendRequest = (request, defaults) => ({
583
+ failover_host: request.failoverHost,
584
+ forward_port: request.forwardPort,
585
+ forward_port_algorithm: request.forwardPortAlgorithm,
586
+ forward_protocol: request.forwardProtocol,
587
+ health_check: marshalHealthCheck(request.healthCheck),
588
+ ignore_ssl_server_verify: request.ignoreSslServerVerify,
589
+ max_connections: request.maxConnections,
590
+ max_retries: request.maxRetries,
591
+ name: request.name || randomName('lbb'),
592
+ on_marked_down_action: request.onMarkedDownAction,
593
+ proxy_protocol: request.proxyProtocol,
594
+ redispatch_attempt_count: request.redispatchAttemptCount,
595
+ send_proxy_v2: request.sendProxyV2,
596
+ server_ip: request.serverIp,
597
+ ssl_bridging: request.sslBridging,
598
+ sticky_sessions: request.stickySessions,
599
+ sticky_sessions_cookie_name: request.stickySessionsCookieName,
600
+ timeout_connect: request.timeoutConnect,
601
+ timeout_queue: request.timeoutQueue,
602
+ timeout_server: request.timeoutServer,
603
+ timeout_tunnel: request.timeoutTunnel
604
+ });
605
+ const marshalCreateCertificateRequestCustomCertificate = (request, defaults) => ({
606
+ certificate_chain: request.certificateChain
607
+ });
608
+ const marshalCreateCertificateRequestLetsencryptConfig = (request, defaults) => ({
609
+ common_name: request.commonName,
610
+ subject_alternative_name: request.subjectAlternativeName
611
+ });
612
+ const marshalCreateCertificateRequest = (request, defaults) => ({
613
+ name: request.name || randomName('certificate'),
614
+ ...resolveOneOf([{
615
+ param: 'letsencrypt',
616
+ value: request.letsencrypt !== undefined ? marshalCreateCertificateRequestLetsencryptConfig(request.letsencrypt) : undefined
617
+ }, {
618
+ param: 'custom_certificate',
619
+ value: request.customCertificate !== undefined ? marshalCreateCertificateRequestCustomCertificate(request.customCertificate) : undefined
620
+ }])
621
+ });
622
+ const marshalCreateFrontendRequest = (request, defaults) => ({
623
+ backend_id: request.backendId,
624
+ certificate_id: request.certificateId,
625
+ certificate_ids: request.certificateIds,
626
+ enable_http3: request.enableHttp3,
627
+ inbound_port: request.inboundPort,
628
+ name: request.name || randomName('lbf'),
629
+ timeout_client: request.timeoutClient
630
+ });
631
+ const marshalCreateIpRequest = (request, defaults) => ({
632
+ reverse: request.reverse,
633
+ ...resolveOneOf([{
634
+ default: defaults.defaultOrganizationId,
635
+ param: 'organization_id',
636
+ value: request.organizationId
637
+ }, {
638
+ default: defaults.defaultProjectId,
639
+ param: 'project_id',
640
+ value: request.projectId
641
+ }])
642
+ });
643
+ const marshalCreateLbRequest = (request, defaults) => ({
644
+ assign_flexible_ip: request.assignFlexibleIp,
645
+ description: request.description,
646
+ ip_id: request.ipId,
647
+ name: request.name || randomName('lb'),
648
+ ssl_compatibility_level: request.sslCompatibilityLevel,
649
+ tags: request.tags,
650
+ type: request.type,
651
+ ...resolveOneOf([{
652
+ default: defaults.defaultOrganizationId,
653
+ param: 'organization_id',
654
+ value: request.organizationId
655
+ }, {
656
+ default: defaults.defaultProjectId,
657
+ param: 'project_id',
658
+ value: request.projectId
659
+ }])
660
+ });
661
+ const marshalRouteMatch = (request, defaults) => ({
662
+ ...resolveOneOf([{
663
+ param: 'sni',
664
+ value: request.sni
665
+ }, {
666
+ param: 'host_header',
667
+ value: request.hostHeader
668
+ }])
669
+ });
670
+ const marshalCreateRouteRequest = (request, defaults) => ({
671
+ backend_id: request.backendId,
672
+ frontend_id: request.frontendId,
673
+ match: request.match !== undefined ? marshalRouteMatch(request.match) : undefined
674
+ });
675
+ const marshalSubscriberEmailConfig = (request, defaults) => ({
676
+ email: request.email
677
+ });
678
+ const marshalSubscriberWebhookConfig = (request, defaults) => ({
679
+ uri: request.uri
680
+ });
681
+ const marshalCreateSubscriberRequest = (request, defaults) => ({
682
+ name: request.name,
683
+ ...resolveOneOf([{
684
+ default: defaults.defaultOrganizationId,
685
+ param: 'organization_id',
686
+ value: request.organizationId
687
+ }, {
688
+ default: defaults.defaultProjectId,
689
+ param: 'project_id',
690
+ value: request.projectId
691
+ }]),
692
+ ...resolveOneOf([{
693
+ param: 'email_config',
694
+ value: request.emailConfig !== undefined ? marshalSubscriberEmailConfig(request.emailConfig) : undefined
695
+ }, {
696
+ param: 'webhook_config',
697
+ value: request.webhookConfig !== undefined ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined
698
+ }])
699
+ });
700
+ const marshalMigrateLbRequest = (request, defaults) => ({
701
+ type: request.type
702
+ });
703
+ const marshalRemoveBackendServersRequest = (request, defaults) => ({
704
+ server_ip: request.serverIp
705
+ });
706
+ const marshalSetBackendServersRequest = (request, defaults) => ({
707
+ server_ip: request.serverIp
708
+ });
709
+ const marshalSubscribeToLbRequest = (request, defaults) => ({
710
+ subscriber_id: request.subscriberId
711
+ });
712
+ const marshalUpdateAclRequest = (request, defaults) => ({
713
+ action: marshalAclAction(request.action),
714
+ description: request.description,
715
+ index: request.index,
716
+ match: request.match !== undefined ? marshalAclMatch(request.match) : undefined,
717
+ name: request.name
718
+ });
719
+ const marshalUpdateBackendRequest = (request, defaults) => ({
720
+ failover_host: request.failoverHost,
721
+ forward_port: request.forwardPort,
722
+ forward_port_algorithm: request.forwardPortAlgorithm,
723
+ forward_protocol: request.forwardProtocol,
724
+ ignore_ssl_server_verify: request.ignoreSslServerVerify,
725
+ max_connections: request.maxConnections,
726
+ max_retries: request.maxRetries,
727
+ name: request.name,
728
+ on_marked_down_action: request.onMarkedDownAction,
729
+ proxy_protocol: request.proxyProtocol,
730
+ redispatch_attempt_count: request.redispatchAttemptCount,
731
+ send_proxy_v2: request.sendProxyV2,
732
+ ssl_bridging: request.sslBridging,
733
+ sticky_sessions: request.stickySessions,
734
+ sticky_sessions_cookie_name: request.stickySessionsCookieName,
735
+ timeout_connect: request.timeoutConnect,
736
+ timeout_queue: request.timeoutQueue,
737
+ timeout_server: request.timeoutServer,
738
+ timeout_tunnel: request.timeoutTunnel
739
+ });
740
+ const marshalUpdateCertificateRequest = (request, defaults) => ({
741
+ name: request.name
742
+ });
743
+ const marshalUpdateFrontendRequest = (request, defaults) => ({
744
+ backend_id: request.backendId,
745
+ certificate_id: request.certificateId,
746
+ certificate_ids: request.certificateIds,
747
+ enable_http3: request.enableHttp3,
748
+ inbound_port: request.inboundPort,
749
+ name: request.name,
750
+ timeout_client: request.timeoutClient
751
+ });
752
+ const marshalUpdateHealthCheckRequest = (request, defaults) => ({
753
+ check_delay: request.checkDelay,
754
+ check_max_retries: request.checkMaxRetries,
755
+ check_send_proxy: request.checkSendProxy,
756
+ check_timeout: request.checkTimeout,
757
+ port: request.port,
758
+ transient_check_delay: request.transientCheckDelay,
759
+ ...resolveOneOf([{
760
+ param: 'tcp_config',
761
+ value: request.tcpConfig !== undefined ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined
762
+ }, {
763
+ param: 'mysql_config',
764
+ value: request.mysqlConfig !== undefined ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined
765
+ }, {
766
+ param: 'pgsql_config',
767
+ value: request.pgsqlConfig !== undefined ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined
768
+ }, {
769
+ param: 'ldap_config',
770
+ value: request.ldapConfig !== undefined ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined
771
+ }, {
772
+ param: 'redis_config',
773
+ value: request.redisConfig !== undefined ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined
774
+ }, {
775
+ param: 'http_config',
776
+ value: request.httpConfig !== undefined ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined
777
+ }, {
778
+ param: 'https_config',
779
+ value: request.httpsConfig !== undefined ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined
780
+ }])
781
+ });
782
+ const marshalUpdateIpRequest = (request, defaults) => ({
783
+ reverse: request.reverse
784
+ });
785
+ const marshalUpdateLbRequest = (request, defaults) => ({
786
+ description: request.description,
787
+ name: request.name,
788
+ ssl_compatibility_level: request.sslCompatibilityLevel,
789
+ tags: request.tags
790
+ });
791
+ const marshalUpdateRouteRequest = (request, defaults) => ({
792
+ backend_id: request.backendId,
793
+ match: request.match !== undefined ? marshalRouteMatch(request.match) : undefined
794
+ });
795
+ const marshalUpdateSubscriberRequest = (request, defaults) => ({
796
+ name: request.name,
797
+ ...resolveOneOf([{
798
+ param: 'email_config',
799
+ value: request.emailConfig !== undefined ? marshalSubscriberEmailConfig(request.emailConfig) : undefined
800
+ }, {
801
+ param: 'webhook_config',
802
+ value: request.webhookConfig !== undefined ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined
803
+ }])
804
+ });
805
+ const marshalZonedApiAddBackendServersRequest = (request, defaults) => ({
806
+ server_ip: request.serverIp
807
+ });
808
+ const marshalZonedApiAttachPrivateNetworkRequest = (request, defaults) => ({
809
+ ...resolveOneOf([{
810
+ param: 'static_config',
811
+ value: request.staticConfig !== undefined ? marshalPrivateNetworkStaticConfig(request.staticConfig) : undefined
812
+ }, {
813
+ param: 'dhcp_config',
814
+ value: request.dhcpConfig !== undefined ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : undefined
815
+ }, {
816
+ param: 'ipam_config',
817
+ value: request.ipamConfig !== undefined ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : undefined
818
+ }])
819
+ });
820
+ const marshalZonedApiCreateAclRequest = (request, defaults) => ({
821
+ action: marshalAclAction(request.action),
822
+ description: request.description,
823
+ index: request.index,
824
+ match: request.match !== undefined ? marshalAclMatch(request.match) : undefined,
825
+ name: request.name || randomName('acl')
826
+ });
827
+ const marshalZonedApiCreateBackendRequest = (request, defaults) => ({
828
+ failover_host: request.failoverHost,
829
+ forward_port: request.forwardPort,
830
+ forward_port_algorithm: request.forwardPortAlgorithm,
831
+ forward_protocol: request.forwardProtocol,
832
+ health_check: marshalHealthCheck(request.healthCheck),
833
+ ignore_ssl_server_verify: request.ignoreSslServerVerify,
834
+ max_connections: request.maxConnections,
835
+ max_retries: request.maxRetries,
836
+ name: request.name || randomName('lbb'),
837
+ on_marked_down_action: request.onMarkedDownAction,
838
+ proxy_protocol: request.proxyProtocol,
839
+ redispatch_attempt_count: request.redispatchAttemptCount,
840
+ send_proxy_v2: request.sendProxyV2,
841
+ server_ip: request.serverIp,
842
+ ssl_bridging: request.sslBridging,
843
+ sticky_sessions: request.stickySessions,
844
+ sticky_sessions_cookie_name: request.stickySessionsCookieName,
845
+ timeout_connect: request.timeoutConnect,
846
+ timeout_queue: request.timeoutQueue,
847
+ timeout_server: request.timeoutServer,
848
+ timeout_tunnel: request.timeoutTunnel
849
+ });
850
+ const marshalZonedApiCreateCertificateRequest = (request, defaults) => ({
851
+ name: request.name || randomName('certificate'),
852
+ ...resolveOneOf([{
853
+ param: 'letsencrypt',
854
+ value: request.letsencrypt !== undefined ? marshalCreateCertificateRequestLetsencryptConfig(request.letsencrypt) : undefined
855
+ }, {
856
+ param: 'custom_certificate',
857
+ value: request.customCertificate !== undefined ? marshalCreateCertificateRequestCustomCertificate(request.customCertificate) : undefined
858
+ }])
859
+ });
860
+ const marshalZonedApiCreateFrontendRequest = (request, defaults) => ({
861
+ backend_id: request.backendId,
862
+ certificate_id: request.certificateId,
863
+ certificate_ids: request.certificateIds,
864
+ enable_http3: request.enableHttp3,
865
+ inbound_port: request.inboundPort,
866
+ name: request.name || randomName('lbf'),
867
+ timeout_client: request.timeoutClient
868
+ });
869
+ const marshalZonedApiCreateIpRequest = (request, defaults) => ({
870
+ reverse: request.reverse,
871
+ ...resolveOneOf([{
872
+ default: defaults.defaultOrganizationId,
873
+ param: 'organization_id',
874
+ value: request.organizationId
875
+ }, {
876
+ default: defaults.defaultProjectId,
877
+ param: 'project_id',
878
+ value: request.projectId
879
+ }])
880
+ });
881
+ const marshalZonedApiCreateLbRequest = (request, defaults) => ({
882
+ assign_flexible_ip: request.assignFlexibleIp,
883
+ description: request.description,
884
+ ip_id: request.ipId,
885
+ name: request.name || randomName('lb'),
886
+ ssl_compatibility_level: request.sslCompatibilityLevel,
887
+ tags: request.tags,
888
+ type: request.type,
889
+ ...resolveOneOf([{
890
+ default: defaults.defaultOrganizationId,
891
+ param: 'organization_id',
892
+ value: request.organizationId
893
+ }, {
894
+ default: defaults.defaultProjectId,
895
+ param: 'project_id',
896
+ value: request.projectId
897
+ }])
898
+ });
899
+ const marshalZonedApiCreateRouteRequest = (request, defaults) => ({
900
+ backend_id: request.backendId,
901
+ frontend_id: request.frontendId,
902
+ match: request.match !== undefined ? marshalRouteMatch(request.match) : undefined
903
+ });
904
+ const marshalZonedApiCreateSubscriberRequest = (request, defaults) => ({
905
+ name: request.name,
906
+ ...resolveOneOf([{
907
+ default: defaults.defaultOrganizationId,
908
+ param: 'organization_id',
909
+ value: request.organizationId
910
+ }, {
911
+ default: defaults.defaultProjectId,
912
+ param: 'project_id',
913
+ value: request.projectId
914
+ }]),
915
+ ...resolveOneOf([{
916
+ param: 'email_config',
917
+ value: request.emailConfig !== undefined ? marshalSubscriberEmailConfig(request.emailConfig) : undefined
918
+ }, {
919
+ param: 'webhook_config',
920
+ value: request.webhookConfig !== undefined ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined
921
+ }])
922
+ });
923
+ const marshalZonedApiMigrateLbRequest = (request, defaults) => ({
924
+ type: request.type
925
+ });
926
+ const marshalZonedApiRemoveBackendServersRequest = (request, defaults) => ({
927
+ server_ip: request.serverIp
928
+ });
929
+ const marshalAclSpec = (request, defaults) => ({
930
+ action: marshalAclAction(request.action),
931
+ description: request.description,
932
+ index: request.index,
933
+ match: request.match !== undefined ? marshalAclMatch(request.match) : undefined,
934
+ name: request.name
935
+ });
936
+ const marshalZonedApiSetAclsRequest = (request, defaults) => ({
937
+ acls: request.acls.map(elt => marshalAclSpec(elt))
938
+ });
939
+ const marshalZonedApiSetBackendServersRequest = (request, defaults) => ({
940
+ server_ip: request.serverIp
941
+ });
942
+ const marshalZonedApiSubscribeToLbRequest = (request, defaults) => ({
943
+ subscriber_id: request.subscriberId
944
+ });
945
+ const marshalZonedApiUpdateAclRequest = (request, defaults) => ({
946
+ action: marshalAclAction(request.action),
947
+ description: request.description,
948
+ index: request.index,
949
+ match: request.match !== undefined ? marshalAclMatch(request.match) : undefined,
950
+ name: request.name
951
+ });
952
+ const marshalZonedApiUpdateBackendRequest = (request, defaults) => ({
953
+ failover_host: request.failoverHost,
954
+ forward_port: request.forwardPort,
955
+ forward_port_algorithm: request.forwardPortAlgorithm,
956
+ forward_protocol: request.forwardProtocol,
957
+ ignore_ssl_server_verify: request.ignoreSslServerVerify,
958
+ max_connections: request.maxConnections,
959
+ max_retries: request.maxRetries,
960
+ name: request.name,
961
+ on_marked_down_action: request.onMarkedDownAction,
962
+ proxy_protocol: request.proxyProtocol,
963
+ redispatch_attempt_count: request.redispatchAttemptCount,
964
+ send_proxy_v2: request.sendProxyV2,
965
+ ssl_bridging: request.sslBridging,
966
+ sticky_sessions: request.stickySessions,
967
+ sticky_sessions_cookie_name: request.stickySessionsCookieName,
968
+ timeout_connect: request.timeoutConnect,
969
+ timeout_queue: request.timeoutQueue,
970
+ timeout_server: request.timeoutServer,
971
+ timeout_tunnel: request.timeoutTunnel
972
+ });
973
+ const marshalZonedApiUpdateCertificateRequest = (request, defaults) => ({
974
+ name: request.name
975
+ });
976
+ const marshalZonedApiUpdateFrontendRequest = (request, defaults) => ({
977
+ backend_id: request.backendId,
978
+ certificate_id: request.certificateId,
979
+ certificate_ids: request.certificateIds,
980
+ enable_http3: request.enableHttp3,
981
+ inbound_port: request.inboundPort,
982
+ name: request.name,
983
+ timeout_client: request.timeoutClient
984
+ });
985
+ const marshalZonedApiUpdateHealthCheckRequest = (request, defaults) => ({
986
+ check_delay: request.checkDelay,
987
+ check_max_retries: request.checkMaxRetries,
988
+ check_send_proxy: request.checkSendProxy,
989
+ check_timeout: request.checkTimeout,
990
+ port: request.port,
991
+ transient_check_delay: request.transientCheckDelay,
992
+ ...resolveOneOf([{
993
+ param: 'tcp_config',
994
+ value: request.tcpConfig !== undefined ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined
995
+ }, {
996
+ param: 'mysql_config',
997
+ value: request.mysqlConfig !== undefined ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined
998
+ }, {
999
+ param: 'pgsql_config',
1000
+ value: request.pgsqlConfig !== undefined ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined
1001
+ }, {
1002
+ param: 'ldap_config',
1003
+ value: request.ldapConfig !== undefined ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined
1004
+ }, {
1005
+ param: 'redis_config',
1006
+ value: request.redisConfig !== undefined ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined
1007
+ }, {
1008
+ param: 'http_config',
1009
+ value: request.httpConfig !== undefined ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined
1010
+ }, {
1011
+ param: 'https_config',
1012
+ value: request.httpsConfig !== undefined ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined
1013
+ }])
1014
+ });
1015
+ const marshalZonedApiUpdateIpRequest = (request, defaults) => ({
1016
+ reverse: request.reverse
1017
+ });
1018
+ const marshalZonedApiUpdateLbRequest = (request, defaults) => ({
1019
+ description: request.description,
1020
+ name: request.name,
1021
+ ssl_compatibility_level: request.sslCompatibilityLevel,
1022
+ tags: request.tags
1023
+ });
1024
+ const marshalZonedApiUpdateRouteRequest = (request, defaults) => ({
1025
+ backend_id: request.backendId,
1026
+ match: request.match !== undefined ? marshalRouteMatch(request.match) : undefined
1027
+ });
1028
+ const marshalZonedApiUpdateSubscriberRequest = (request, defaults) => ({
1029
+ name: request.name,
1030
+ ...resolveOneOf([{
1031
+ param: 'email_config',
1032
+ value: request.emailConfig !== undefined ? marshalSubscriberEmailConfig(request.emailConfig) : undefined
1033
+ }, {
1034
+ param: 'webhook_config',
1035
+ value: request.webhookConfig !== undefined ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined
1036
+ }])
1037
+ });
1038
+
1039
+ export { marshalAddBackendServersRequest, marshalAttachPrivateNetworkRequest, marshalCreateAclRequest, marshalCreateBackendRequest, marshalCreateCertificateRequest, marshalCreateFrontendRequest, marshalCreateIpRequest, marshalCreateLbRequest, marshalCreateRouteRequest, marshalCreateSubscriberRequest, marshalMigrateLbRequest, marshalRemoveBackendServersRequest, marshalSetBackendServersRequest, marshalSubscribeToLbRequest, marshalUpdateAclRequest, marshalUpdateBackendRequest, marshalUpdateCertificateRequest, marshalUpdateFrontendRequest, marshalUpdateHealthCheckRequest, marshalUpdateIpRequest, marshalUpdateLbRequest, marshalUpdateRouteRequest, marshalUpdateSubscriberRequest, marshalZonedApiAddBackendServersRequest, marshalZonedApiAttachPrivateNetworkRequest, marshalZonedApiCreateAclRequest, marshalZonedApiCreateBackendRequest, marshalZonedApiCreateCertificateRequest, marshalZonedApiCreateFrontendRequest, marshalZonedApiCreateIpRequest, marshalZonedApiCreateLbRequest, marshalZonedApiCreateRouteRequest, marshalZonedApiCreateSubscriberRequest, marshalZonedApiMigrateLbRequest, marshalZonedApiRemoveBackendServersRequest, marshalZonedApiSetAclsRequest, marshalZonedApiSetBackendServersRequest, marshalZonedApiSubscribeToLbRequest, marshalZonedApiUpdateAclRequest, marshalZonedApiUpdateBackendRequest, marshalZonedApiUpdateCertificateRequest, marshalZonedApiUpdateFrontendRequest, marshalZonedApiUpdateHealthCheckRequest, marshalZonedApiUpdateIpRequest, marshalZonedApiUpdateLbRequest, marshalZonedApiUpdateRouteRequest, marshalZonedApiUpdateSubscriberRequest, unmarshalAcl, unmarshalBackend, unmarshalBackendServerStats, unmarshalCertificate, unmarshalFrontend, unmarshalHealthCheck, unmarshalIp, unmarshalLb, unmarshalLbStats, unmarshalListAclResponse, unmarshalListBackendStatsResponse, unmarshalListBackendsResponse, unmarshalListCertificatesResponse, unmarshalListFrontendsResponse, unmarshalListIpsResponse, unmarshalListLbPrivateNetworksResponse, unmarshalListLbTypesResponse, unmarshalListLbsResponse, unmarshalListRoutesResponse, unmarshalListSubscriberResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclsResponse, unmarshalSubscriber };