@scaleway/sdk-k8s 2.17.0 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import { CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalAddClusterACLRulesRequest, marshalCreateClusterRequest, marshalCreatePoolRequest, marshalSetClusterACLRulesRequest, marshalSetClusterTypeRequest, marshalSetPoolLabelsRequest, marshalSetPoolStartupTaintsRequest, marshalSetPoolTaintsRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalAddClusterACLRulesResponse, unmarshalCluster, unmarshalExternalNodeAuth, unmarshalListClusterACLRulesResponse, unmarshalListClusterAvailableTypesResponse, unmarshalListClusterAvailableVersionsResponse, unmarshalListClusterTypesResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalNodeMetadata, unmarshalPool, unmarshalSetClusterACLRulesResponse, unmarshalVersion } from "./marshalling.gen.js";
3
+ import { API } from "./api.gen.js";
4
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
5
+ export { API, CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, marshalAddClusterACLRulesRequest, marshalCreateClusterRequest, marshalCreatePoolRequest, marshalSetClusterACLRulesRequest, marshalSetClusterTypeRequest, marshalSetPoolLabelsRequest, marshalSetPoolStartupTaintsRequest, marshalSetPoolTaintsRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalAddClusterACLRulesResponse, unmarshalCluster, unmarshalExternalNodeAuth, unmarshalListClusterACLRulesResponse, unmarshalListClusterAvailableTypesResponse, unmarshalListClusterAvailableVersionsResponse, unmarshalListClusterTypesResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalNodeMetadata, unmarshalPool, unmarshalSetClusterACLRulesResponse, unmarshalVersion };
@@ -0,0 +1,14 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import { CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ import { K8SUtilsAPI } from "./api.utils.js";
4
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
5
+ //#region src/v1/index.ts
6
+ var v1_exports = /* @__PURE__ */ __exportAll({
7
+ API: () => K8SUtilsAPI,
8
+ CLUSTER_TRANSIENT_STATUSES: () => CLUSTER_TRANSIENT_STATUSES,
9
+ NODE_TRANSIENT_STATUSES: () => NODE_TRANSIENT_STATUSES,
10
+ POOL_TRANSIENT_STATUSES: () => POOL_TRANSIENT_STATUSES,
11
+ ValidationRules: () => validation_rules_gen_exports
12
+ });
13
+ //#endregion
14
+ export { K8SUtilsAPI as API, CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, v1_exports };
@@ -0,0 +1,30 @@
1
+ import type { DefaultValues } from '@scaleway/sdk-client';
2
+ import type { Version, Cluster, Node, Pool, AddClusterACLRulesResponse, ExternalNodeAuth, ListClusterACLRulesResponse, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsResponse, ListClusterTypesResponse, ListClustersResponse, ListNodesResponse, ListPoolsResponse, ListVersionsResponse, NodeMetadata, SetClusterACLRulesResponse, AddClusterACLRulesRequest, CreateClusterRequest, CreatePoolRequest, SetClusterACLRulesRequest, SetClusterTypeRequest, SetPoolLabelsRequest, SetPoolStartupTaintsRequest, SetPoolTaintsRequest, UpdateClusterRequest, UpdatePoolRequest, UpgradeClusterRequest, UpgradePoolRequest } from './types.gen.js';
3
+ export declare const unmarshalVersion: (data: unknown) => Version;
4
+ export declare const unmarshalCluster: (data: unknown) => Cluster;
5
+ export declare const unmarshalNode: (data: unknown) => Node;
6
+ export declare const unmarshalPool: (data: unknown) => Pool;
7
+ export declare const unmarshalAddClusterACLRulesResponse: (data: unknown) => AddClusterACLRulesResponse;
8
+ export declare const unmarshalExternalNodeAuth: (data: unknown) => ExternalNodeAuth;
9
+ export declare const unmarshalListClusterACLRulesResponse: (data: unknown) => ListClusterACLRulesResponse;
10
+ export declare const unmarshalListClusterAvailableTypesResponse: (data: unknown) => ListClusterAvailableTypesResponse;
11
+ export declare const unmarshalListClusterAvailableVersionsResponse: (data: unknown) => ListClusterAvailableVersionsResponse;
12
+ export declare const unmarshalListClusterTypesResponse: (data: unknown) => ListClusterTypesResponse;
13
+ export declare const unmarshalListClustersResponse: (data: unknown) => ListClustersResponse;
14
+ export declare const unmarshalListNodesResponse: (data: unknown) => ListNodesResponse;
15
+ export declare const unmarshalListPoolsResponse: (data: unknown) => ListPoolsResponse;
16
+ export declare const unmarshalListVersionsResponse: (data: unknown) => ListVersionsResponse;
17
+ export declare const unmarshalNodeMetadata: (data: unknown) => NodeMetadata;
18
+ export declare const unmarshalSetClusterACLRulesResponse: (data: unknown) => SetClusterACLRulesResponse;
19
+ export declare const marshalAddClusterACLRulesRequest: (request: AddClusterACLRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
20
+ export declare const marshalCreateClusterRequest: (request: CreateClusterRequest, defaults: DefaultValues) => Record<string, unknown>;
21
+ export declare const marshalCreatePoolRequest: (request: CreatePoolRequest, defaults: DefaultValues) => Record<string, unknown>;
22
+ export declare const marshalSetClusterACLRulesRequest: (request: SetClusterACLRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
23
+ export declare const marshalSetClusterTypeRequest: (request: SetClusterTypeRequest, defaults: DefaultValues) => Record<string, unknown>;
24
+ export declare const marshalSetPoolLabelsRequest: (request: SetPoolLabelsRequest, defaults: DefaultValues) => Record<string, unknown>;
25
+ export declare const marshalSetPoolStartupTaintsRequest: (request: SetPoolStartupTaintsRequest, defaults: DefaultValues) => Record<string, unknown>;
26
+ export declare const marshalSetPoolTaintsRequest: (request: SetPoolTaintsRequest, defaults: DefaultValues) => Record<string, unknown>;
27
+ export declare const marshalUpdateClusterRequest: (request: UpdateClusterRequest, defaults: DefaultValues) => Record<string, unknown>;
28
+ export declare const marshalUpdatePoolRequest: (request: UpdatePoolRequest, defaults: DefaultValues) => Record<string, unknown>;
29
+ export declare const marshalUpgradeClusterRequest: (request: UpgradeClusterRequest, defaults: DefaultValues) => Record<string, unknown>;
30
+ export declare const marshalUpgradePoolRequest: (request: UpgradePoolRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -0,0 +1,481 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ import randomName from "@scaleway/random-name";
3
+ //#region src/v1/marshalling.gen.ts
4
+ const unmarshalVersion = (data) => {
5
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
6
+ return {
7
+ availableAdmissionPlugins: data.available_admission_plugins,
8
+ availableCnis: data.available_cnis,
9
+ availableContainerRuntimes: data.available_container_runtimes,
10
+ availableFeatureGates: data.available_feature_gates,
11
+ availableKubeletArgs: data.available_kubelet_args,
12
+ deprecatedAt: unmarshalDate(data.deprecated_at),
13
+ endOfLifeAt: unmarshalDate(data.end_of_life_at),
14
+ label: data.label,
15
+ name: data.name,
16
+ region: data.region,
17
+ releasedAt: unmarshalDate(data.released_at)
18
+ };
19
+ };
20
+ const unmarshalMaintenanceWindow = (data) => {
21
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary.`);
22
+ return {
23
+ day: data.day,
24
+ startHour: data.start_hour
25
+ };
26
+ };
27
+ const unmarshalClusterAutoUpgrade = (data) => {
28
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary.`);
29
+ return {
30
+ enabled: data.enabled,
31
+ maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : void 0
32
+ };
33
+ };
34
+ const unmarshalClusterAutoscalerConfig = (data) => {
35
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary.`);
36
+ return {
37
+ balanceSimilarNodeGroups: data.balance_similar_node_groups,
38
+ estimator: data.estimator,
39
+ expander: data.expander,
40
+ expendablePodsPriorityCutoff: data.expendable_pods_priority_cutoff,
41
+ ignoreDaemonsetsUtilization: data.ignore_daemonsets_utilization,
42
+ logLevel: data.log_level,
43
+ maxGracefulTerminationSec: data.max_graceful_termination_sec,
44
+ scaleDownDelayAfterAdd: data.scale_down_delay_after_add,
45
+ scaleDownDisabled: data.scale_down_disabled,
46
+ scaleDownUnneededTime: data.scale_down_unneeded_time,
47
+ scaleDownUtilizationThreshold: data.scale_down_utilization_threshold,
48
+ skipNodesWithLocalStorage: data.skip_nodes_with_local_storage
49
+ };
50
+ };
51
+ const unmarshalClusterOpenIDConnectConfig = (data) => {
52
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`);
53
+ return {
54
+ clientId: data.client_id,
55
+ groupsClaim: data.groups_claim,
56
+ groupsPrefix: data.groups_prefix,
57
+ issuerUrl: data.issuer_url,
58
+ requiredClaim: data.required_claim,
59
+ usernameClaim: data.username_claim,
60
+ usernamePrefix: data.username_prefix
61
+ };
62
+ };
63
+ const unmarshalCluster = (data) => {
64
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
65
+ return {
66
+ aclAvailable: data.acl_available,
67
+ admissionPlugins: data.admission_plugins,
68
+ apiserverCertSans: data.apiserver_cert_sans,
69
+ autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : void 0,
70
+ autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : void 0,
71
+ clusterUrl: data.cluster_url,
72
+ cni: data.cni,
73
+ commitmentEndsAt: unmarshalDate(data.commitment_ends_at),
74
+ createdAt: unmarshalDate(data.created_at),
75
+ description: data.description,
76
+ dnsWildcard: data.dns_wildcard,
77
+ featureGates: data.feature_gates,
78
+ iamNodesGroupId: data.iam_nodes_group_id,
79
+ id: data.id,
80
+ name: data.name,
81
+ openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : void 0,
82
+ organizationId: data.organization_id,
83
+ podCidr: data.pod_cidr,
84
+ privateNetworkId: data.private_network_id,
85
+ projectId: data.project_id,
86
+ region: data.region,
87
+ serviceCidr: data.service_cidr,
88
+ serviceDnsIp: data.service_dns_ip,
89
+ status: data.status,
90
+ tags: data.tags,
91
+ type: data.type,
92
+ updatedAt: unmarshalDate(data.updated_at),
93
+ upgradeAvailable: data.upgrade_available,
94
+ version: data.version
95
+ };
96
+ };
97
+ const unmarshalNode = (data) => {
98
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Node' failed as data isn't a dictionary.`);
99
+ return {
100
+ clusterId: data.cluster_id,
101
+ conditions: data.conditions,
102
+ createdAt: unmarshalDate(data.created_at),
103
+ errorMessage: data.error_message,
104
+ id: data.id,
105
+ name: data.name,
106
+ poolId: data.pool_id,
107
+ providerId: data.provider_id,
108
+ publicIpV4: data.public_ip_v4,
109
+ publicIpV6: data.public_ip_v6,
110
+ region: data.region,
111
+ status: data.status,
112
+ updatedAt: unmarshalDate(data.updated_at)
113
+ };
114
+ };
115
+ const unmarshalCoreV1Taint = (data) => {
116
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CoreV1Taint' failed as data isn't a dictionary.`);
117
+ return {
118
+ effect: data.effect,
119
+ key: data.key,
120
+ value: data.value
121
+ };
122
+ };
123
+ const unmarshalPoolUpgradePolicy = (data) => {
124
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`);
125
+ return {
126
+ maxSurge: data.max_surge,
127
+ maxUnavailable: data.max_unavailable
128
+ };
129
+ };
130
+ const unmarshalPool = (data) => {
131
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Pool' failed as data isn't a dictionary.`);
132
+ return {
133
+ autohealing: data.autohealing,
134
+ autoscaling: data.autoscaling,
135
+ clusterId: data.cluster_id,
136
+ containerRuntime: data.container_runtime,
137
+ createdAt: unmarshalDate(data.created_at),
138
+ errorMessage: data.error_message,
139
+ id: data.id,
140
+ kubeletArgs: data.kubelet_args,
141
+ labels: data.labels,
142
+ maxSize: data.max_size,
143
+ minSize: data.min_size,
144
+ name: data.name,
145
+ nodeType: data.node_type,
146
+ placementGroupId: data.placement_group_id,
147
+ privateNetworkId: data.private_network_id,
148
+ publicIpDisabled: data.public_ip_disabled,
149
+ region: data.region,
150
+ rootVolumeSize: data.root_volume_size,
151
+ rootVolumeType: data.root_volume_type,
152
+ securityGroupId: data.security_group_id,
153
+ size: data.size,
154
+ startupTaints: unmarshalArrayOfObject(data.startup_taints, unmarshalCoreV1Taint),
155
+ status: data.status,
156
+ tags: data.tags,
157
+ taints: unmarshalArrayOfObject(data.taints, unmarshalCoreV1Taint),
158
+ updatedAt: unmarshalDate(data.updated_at),
159
+ upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : void 0,
160
+ version: data.version,
161
+ zone: data.zone
162
+ };
163
+ };
164
+ const unmarshalACLRule = (data) => {
165
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
166
+ return {
167
+ description: data.description,
168
+ id: data.id,
169
+ ip: data.ip,
170
+ region: data.region,
171
+ scalewayRanges: data.scaleway_ranges
172
+ };
173
+ };
174
+ const unmarshalAddClusterACLRulesResponse = (data) => {
175
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AddClusterACLRulesResponse' failed as data isn't a dictionary.`);
176
+ return { rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule) };
177
+ };
178
+ const unmarshalExternalNodeAuth = (data) => {
179
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ExternalNodeAuth' failed as data isn't a dictionary.`);
180
+ return {
181
+ metadataUrl: data.metadata_url,
182
+ nodeSecretKey: data.node_secret_key
183
+ };
184
+ };
185
+ const unmarshalListClusterACLRulesResponse = (data) => {
186
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListClusterACLRulesResponse' failed as data isn't a dictionary.`);
187
+ return {
188
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
189
+ totalCount: data.total_count
190
+ };
191
+ };
192
+ const unmarshalClusterType = (data) => {
193
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ClusterType' failed as data isn't a dictionary.`);
194
+ return {
195
+ auditLogsSupported: data.audit_logs_supported,
196
+ availability: data.availability,
197
+ commitmentDelay: data.commitment_delay,
198
+ dedicated: data.dedicated,
199
+ maxEtcdSize: data.max_etcd_size,
200
+ maxNodes: data.max_nodes,
201
+ memory: data.memory,
202
+ name: data.name,
203
+ region: data.region,
204
+ resiliency: data.resiliency,
205
+ sla: data.sla
206
+ };
207
+ };
208
+ const unmarshalListClusterAvailableTypesResponse = (data) => {
209
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary.`);
210
+ return {
211
+ clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType),
212
+ totalCount: data.total_count
213
+ };
214
+ };
215
+ const unmarshalListClusterAvailableVersionsResponse = (data) => {
216
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary.`);
217
+ return { versions: unmarshalArrayOfObject(data.versions, unmarshalVersion) };
218
+ };
219
+ const unmarshalListClusterTypesResponse = (data) => {
220
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary.`);
221
+ return {
222
+ clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType),
223
+ totalCount: data.total_count
224
+ };
225
+ };
226
+ const unmarshalListClustersResponse = (data) => {
227
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`);
228
+ return {
229
+ clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
230
+ totalCount: data.total_count
231
+ };
232
+ };
233
+ const unmarshalListNodesResponse = (data) => {
234
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary.`);
235
+ return {
236
+ nodes: unmarshalArrayOfObject(data.nodes, unmarshalNode),
237
+ totalCount: data.total_count
238
+ };
239
+ };
240
+ const unmarshalListPoolsResponse = (data) => {
241
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`);
242
+ return {
243
+ pools: unmarshalArrayOfObject(data.pools, unmarshalPool),
244
+ totalCount: data.total_count
245
+ };
246
+ };
247
+ const unmarshalListVersionsResponse = (data) => {
248
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
249
+ return { versions: unmarshalArrayOfObject(data.versions, unmarshalVersion) };
250
+ };
251
+ const unmarshalNodeMetadataCoreV1Taint = (data) => {
252
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeMetadataCoreV1Taint' failed as data isn't a dictionary.`);
253
+ return {
254
+ effect: data.effect,
255
+ key: data.key,
256
+ value: data.value
257
+ };
258
+ };
259
+ const unmarshalNodeMetadata = (data) => {
260
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeMetadata' failed as data isn't a dictionary.`);
261
+ return {
262
+ clusterCa: data.cluster_ca,
263
+ clusterUrl: data.cluster_url,
264
+ credentialProviderConfig: data.credential_provider_config,
265
+ externalIp: data.external_ip,
266
+ hasGpu: data.has_gpu,
267
+ id: data.id,
268
+ installerTags: data.installer_tags,
269
+ kubeletConfig: data.kubelet_config,
270
+ name: data.name,
271
+ nodeLabels: data.node_labels,
272
+ nodeTaints: unmarshalArrayOfObject(data.node_taints, unmarshalNodeMetadataCoreV1Taint),
273
+ poolVersion: data.pool_version,
274
+ providerId: data.provider_id,
275
+ repoUri: data.repo_uri,
276
+ resolvconfPath: data.resolvconf_path,
277
+ templateArgs: data.template_args,
278
+ updaterBinPath: data.updater_bin_path,
279
+ updaterBinUrl: data.updater_bin_url,
280
+ updaterBinVersion: data.updater_bin_version
281
+ };
282
+ };
283
+ const unmarshalSetClusterACLRulesResponse = (data) => {
284
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetClusterACLRulesResponse' failed as data isn't a dictionary.`);
285
+ return { rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule) };
286
+ };
287
+ const marshalACLRuleRequest = (request, defaults) => ({
288
+ description: request.description,
289
+ ...resolveOneOf([{
290
+ param: "ip",
291
+ value: request.ip
292
+ }, {
293
+ param: "scaleway_ranges",
294
+ value: request.scalewayRanges
295
+ }])
296
+ });
297
+ const marshalAddClusterACLRulesRequest = (request, defaults) => ({ acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt, defaults)) : void 0 });
298
+ const marshalMaintenanceWindow = (request, defaults) => ({
299
+ day: request.day,
300
+ start_hour: request.startHour
301
+ });
302
+ const marshalCoreV1Taint = (request, defaults) => ({
303
+ effect: request.effect,
304
+ key: request.key,
305
+ value: request.value
306
+ });
307
+ const marshalCreateClusterRequestPoolConfigUpgradePolicy = (request, defaults) => ({
308
+ max_surge: request.maxSurge,
309
+ max_unavailable: request.maxUnavailable
310
+ });
311
+ const marshalCreateClusterRequestAutoUpgrade = (request, defaults) => ({
312
+ enable: request.enable,
313
+ maintenance_window: request.maintenanceWindow !== void 0 ? marshalMaintenanceWindow(request.maintenanceWindow, defaults) : void 0
314
+ });
315
+ const marshalCreateClusterRequestAutoscalerConfig = (request, defaults) => ({
316
+ balance_similar_node_groups: request.balanceSimilarNodeGroups,
317
+ estimator: request.estimator,
318
+ expander: request.expander,
319
+ expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,
320
+ ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,
321
+ log_level: request.logLevel,
322
+ max_graceful_termination_sec: request.maxGracefulTerminationSec,
323
+ scale_down_delay_after_add: request.scaleDownDelayAfterAdd,
324
+ scale_down_disabled: request.scaleDownDisabled,
325
+ scale_down_unneeded_time: request.scaleDownUnneededTime,
326
+ scale_down_utilization_threshold: request.scaleDownUtilizationThreshold,
327
+ skip_nodes_with_local_storage: request.skipNodesWithLocalStorage
328
+ });
329
+ const marshalCreateClusterRequestOpenIDConnectConfig = (request, defaults) => ({
330
+ client_id: request.clientId,
331
+ groups_claim: request.groupsClaim,
332
+ groups_prefix: request.groupsPrefix,
333
+ issuer_url: request.issuerUrl,
334
+ required_claim: request.requiredClaim,
335
+ username_claim: request.usernameClaim,
336
+ username_prefix: request.usernamePrefix
337
+ });
338
+ const marshalCreateClusterRequestPoolConfig = (request, defaults) => ({
339
+ autohealing: request.autohealing,
340
+ autoscaling: request.autoscaling,
341
+ container_runtime: request.containerRuntime,
342
+ kubelet_args: request.kubeletArgs,
343
+ labels: request.labels,
344
+ max_size: request.maxSize,
345
+ min_size: request.minSize,
346
+ name: request.name,
347
+ node_type: request.nodeType,
348
+ placement_group_id: request.placementGroupId,
349
+ private_network_id: request.privateNetworkId,
350
+ public_ip_disabled: request.publicIpDisabled,
351
+ root_volume_size: request.rootVolumeSize,
352
+ root_volume_type: request.rootVolumeType,
353
+ security_group_id: request.securityGroupId,
354
+ size: request.size,
355
+ startup_taints: request.startupTaints.map((elt) => marshalCoreV1Taint(elt, defaults)),
356
+ tags: request.tags,
357
+ taints: request.taints.map((elt) => marshalCoreV1Taint(elt, defaults)),
358
+ upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreateClusterRequestPoolConfigUpgradePolicy(request.upgradePolicy, defaults) : void 0,
359
+ zone: request.zone
360
+ });
361
+ const marshalCreateClusterRequest = (request, defaults) => ({
362
+ admission_plugins: request.admissionPlugins,
363
+ apiserver_cert_sans: request.apiserverCertSans,
364
+ auto_upgrade: request.autoUpgrade !== void 0 ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade, defaults) : void 0,
365
+ autoscaler_config: request.autoscalerConfig !== void 0 ? marshalCreateClusterRequestAutoscalerConfig(request.autoscalerConfig, defaults) : void 0,
366
+ cni: request.cni,
367
+ description: request.description,
368
+ feature_gates: request.featureGates,
369
+ name: request.name || randomName("k8s"),
370
+ open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalCreateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig, defaults) : void 0,
371
+ pod_cidr: request.podCidr,
372
+ pools: request.pools !== void 0 ? request.pools.map((elt) => marshalCreateClusterRequestPoolConfig(elt, defaults)) : void 0,
373
+ private_network_id: request.privateNetworkId,
374
+ service_cidr: request.serviceCidr,
375
+ service_dns_ip: request.serviceDnsIp,
376
+ tags: request.tags,
377
+ type: request.type,
378
+ version: request.version,
379
+ ...resolveOneOf([{
380
+ default: defaults.defaultProjectId,
381
+ param: "project_id",
382
+ value: request.projectId
383
+ }, {
384
+ default: defaults.defaultOrganizationId,
385
+ param: "organization_id",
386
+ value: request.organizationId
387
+ }])
388
+ });
389
+ const marshalCreatePoolRequestUpgradePolicy = (request, defaults) => ({
390
+ max_surge: request.maxSurge,
391
+ max_unavailable: request.maxUnavailable
392
+ });
393
+ const marshalCreatePoolRequest = (request, defaults) => ({
394
+ autohealing: request.autohealing,
395
+ autoscaling: request.autoscaling,
396
+ container_runtime: request.containerRuntime,
397
+ kubelet_args: request.kubeletArgs !== void 0 ? request.kubeletArgs : void 0,
398
+ labels: request.labels !== void 0 ? request.labels : void 0,
399
+ max_size: request.maxSize,
400
+ min_size: request.minSize,
401
+ name: request.name || randomName("pool"),
402
+ node_type: request.nodeType,
403
+ placement_group_id: request.placementGroupId,
404
+ private_network_id: request.privateNetworkId,
405
+ public_ip_disabled: request.publicIpDisabled,
406
+ root_volume_size: request.rootVolumeSize,
407
+ root_volume_type: request.rootVolumeType,
408
+ security_group_id: request.securityGroupId,
409
+ size: request.size,
410
+ startup_taints: request.startupTaints !== void 0 ? request.startupTaints.map((elt) => marshalCoreV1Taint(elt, defaults)) : void 0,
411
+ tags: request.tags,
412
+ taints: request.taints !== void 0 ? request.taints.map((elt) => marshalCoreV1Taint(elt, defaults)) : void 0,
413
+ upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy, defaults) : void 0,
414
+ user_data: request.userData !== void 0 ? request.userData : void 0,
415
+ zone: request.zone ?? defaults.defaultZone
416
+ });
417
+ const marshalSetClusterACLRulesRequest = (request, defaults) => ({ acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt, defaults)) : void 0 });
418
+ const marshalSetClusterTypeRequest = (request, defaults) => ({ type: request.type });
419
+ const marshalSetPoolLabelsRequest = (request, defaults) => ({ labels: request.labels !== void 0 ? request.labels : void 0 });
420
+ const marshalSetPoolStartupTaintsRequest = (request, defaults) => ({ startup_taints: request.startupTaints !== void 0 ? request.startupTaints.map((elt) => marshalCoreV1Taint(elt, defaults)) : void 0 });
421
+ const marshalSetPoolTaintsRequest = (request, defaults) => ({ taints: request.taints !== void 0 ? request.taints.map((elt) => marshalCoreV1Taint(elt, defaults)) : void 0 });
422
+ const marshalUpdateClusterRequestAutoUpgrade = (request, defaults) => ({
423
+ enable: request.enable,
424
+ maintenance_window: request.maintenanceWindow !== void 0 ? marshalMaintenanceWindow(request.maintenanceWindow, defaults) : void 0
425
+ });
426
+ const marshalUpdateClusterRequestAutoscalerConfig = (request, defaults) => ({
427
+ balance_similar_node_groups: request.balanceSimilarNodeGroups,
428
+ estimator: request.estimator,
429
+ expander: request.expander,
430
+ expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,
431
+ ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,
432
+ log_level: request.logLevel,
433
+ max_graceful_termination_sec: request.maxGracefulTerminationSec,
434
+ scale_down_delay_after_add: request.scaleDownDelayAfterAdd,
435
+ scale_down_disabled: request.scaleDownDisabled,
436
+ scale_down_unneeded_time: request.scaleDownUnneededTime,
437
+ scale_down_utilization_threshold: request.scaleDownUtilizationThreshold,
438
+ skip_nodes_with_local_storage: request.skipNodesWithLocalStorage
439
+ });
440
+ const marshalUpdateClusterRequestOpenIDConnectConfig = (request, defaults) => ({
441
+ client_id: request.clientId,
442
+ groups_claim: request.groupsClaim,
443
+ groups_prefix: request.groupsPrefix,
444
+ issuer_url: request.issuerUrl,
445
+ required_claim: request.requiredClaim,
446
+ username_claim: request.usernameClaim,
447
+ username_prefix: request.usernamePrefix
448
+ });
449
+ const marshalUpdateClusterRequest = (request, defaults) => ({
450
+ admission_plugins: request.admissionPlugins,
451
+ apiserver_cert_sans: request.apiserverCertSans,
452
+ auto_upgrade: request.autoUpgrade !== void 0 ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade, defaults) : void 0,
453
+ autoscaler_config: request.autoscalerConfig !== void 0 ? marshalUpdateClusterRequestAutoscalerConfig(request.autoscalerConfig, defaults) : void 0,
454
+ description: request.description,
455
+ feature_gates: request.featureGates,
456
+ name: request.name,
457
+ open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalUpdateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig, defaults) : void 0,
458
+ tags: request.tags
459
+ });
460
+ const marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({
461
+ max_surge: request.maxSurge,
462
+ max_unavailable: request.maxUnavailable
463
+ });
464
+ const marshalUpdatePoolRequest = (request, defaults) => ({
465
+ autohealing: request.autohealing,
466
+ autoscaling: request.autoscaling,
467
+ kubelet_args: request.kubeletArgs,
468
+ max_size: request.maxSize,
469
+ min_size: request.minSize,
470
+ security_group_id: request.securityGroupId,
471
+ size: request.size,
472
+ tags: request.tags,
473
+ upgrade_policy: request.upgradePolicy !== void 0 ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy, defaults) : void 0
474
+ });
475
+ const marshalUpgradeClusterRequest = (request, defaults) => ({
476
+ upgrade_pools: request.upgradePools,
477
+ version: request.version
478
+ });
479
+ const marshalUpgradePoolRequest = (request, defaults) => ({ version: request.version });
480
+ //#endregion
481
+ export { marshalAddClusterACLRulesRequest, marshalCreateClusterRequest, marshalCreatePoolRequest, marshalSetClusterACLRulesRequest, marshalSetClusterTypeRequest, marshalSetPoolLabelsRequest, marshalSetPoolStartupTaintsRequest, marshalSetPoolTaintsRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalAddClusterACLRulesResponse, unmarshalCluster, unmarshalExternalNodeAuth, unmarshalListClusterACLRulesResponse, unmarshalListClusterAvailableTypesResponse, unmarshalListClusterAvailableVersionsResponse, unmarshalListClusterTypesResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalNodeMetadata, unmarshalPool, unmarshalSetClusterACLRulesResponse, unmarshalVersion };