@scaleway/sdk-audit-trail 1.3.0 → 1.5.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.
@@ -1,6 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const sdkClient = require("@scaleway/sdk-client");
4
+ const unmarshalExportJobS3 = (data) => {
5
+ if (!sdkClient.isJSONObject(data)) {
6
+ throw new TypeError(
7
+ `Unmarshalling the type 'ExportJobS3' failed as data isn't a dictionary.`
8
+ );
9
+ }
10
+ return {
11
+ bucket: data.bucket,
12
+ prefix: data.prefix,
13
+ projectId: data.project_id,
14
+ region: data.region
15
+ };
16
+ };
17
+ const unmarshalExportJobStatus = (data) => {
18
+ if (!sdkClient.isJSONObject(data)) {
19
+ throw new TypeError(
20
+ `Unmarshalling the type 'ExportJobStatus' failed as data isn't a dictionary.`
21
+ );
22
+ }
23
+ return {
24
+ code: data.code,
25
+ message: data.message
26
+ };
27
+ };
28
+ const unmarshalExportJob = (data) => {
29
+ if (!sdkClient.isJSONObject(data)) {
30
+ throw new TypeError(
31
+ `Unmarshalling the type 'ExportJob' failed as data isn't a dictionary.`
32
+ );
33
+ }
34
+ return {
35
+ createdAt: sdkClient.unmarshalDate(data.created_at),
36
+ id: data.id,
37
+ lastRunAt: sdkClient.unmarshalDate(data.last_run_at),
38
+ lastStatus: data.last_status ? unmarshalExportJobStatus(data.last_status) : void 0,
39
+ name: data.name,
40
+ organizationId: data.organization_id,
41
+ s3: data.s3 ? unmarshalExportJobS3(data.s3) : void 0,
42
+ tags: data.tags
43
+ };
44
+ };
4
45
  const unmarshalAccountOrganizationInfo = (data) => {
5
46
  if (!sdkClient.isJSONObject(data)) {
6
47
  throw new TypeError(
@@ -9,6 +50,16 @@ const unmarshalAccountOrganizationInfo = (data) => {
9
50
  }
10
51
  return {};
11
52
  };
53
+ const unmarshalAccountProjectInfo = (data) => {
54
+ if (!sdkClient.isJSONObject(data)) {
55
+ throw new TypeError(
56
+ `Unmarshalling the type 'AccountProjectInfo' failed as data isn't a dictionary.`
57
+ );
58
+ }
59
+ return {
60
+ description: data.description
61
+ };
62
+ };
12
63
  const unmarshalAccountUserInfo = (data) => {
13
64
  if (!sdkClient.isJSONObject(data)) {
14
65
  throw new TypeError(
@@ -20,6 +71,38 @@ const unmarshalAccountUserInfo = (data) => {
20
71
  phoneNumber: data.phone_number
21
72
  };
22
73
  };
74
+ const unmarshalAppleSiliconServerInfo = (data) => {
75
+ if (!sdkClient.isJSONObject(data)) {
76
+ throw new TypeError(
77
+ `Unmarshalling the type 'AppleSiliconServerInfo' failed as data isn't a dictionary.`
78
+ );
79
+ }
80
+ return {
81
+ id: data.id,
82
+ name: data.name
83
+ };
84
+ };
85
+ const unmarshalBaremetalServerInfo = (data) => {
86
+ if (!sdkClient.isJSONObject(data)) {
87
+ throw new TypeError(
88
+ `Unmarshalling the type 'BaremetalServerInfo' failed as data isn't a dictionary.`
89
+ );
90
+ }
91
+ return {
92
+ description: data.description,
93
+ tags: data.tags
94
+ };
95
+ };
96
+ const unmarshalBaremetalSettingInfo = (data) => {
97
+ if (!sdkClient.isJSONObject(data)) {
98
+ throw new TypeError(
99
+ `Unmarshalling the type 'BaremetalSettingInfo' failed as data isn't a dictionary.`
100
+ );
101
+ }
102
+ return {
103
+ type: data.type
104
+ };
105
+ };
23
106
  const unmarshalInstanceServerInfo = (data) => {
24
107
  if (!sdkClient.isJSONObject(data)) {
25
108
  throw new TypeError(
@@ -30,6 +113,16 @@ const unmarshalInstanceServerInfo = (data) => {
30
113
  name: data.name
31
114
  };
32
115
  };
116
+ const unmarshalIpamIpInfo = (data) => {
117
+ if (!sdkClient.isJSONObject(data)) {
118
+ throw new TypeError(
119
+ `Unmarshalling the type 'IpamIpInfo' failed as data isn't a dictionary.`
120
+ );
121
+ }
122
+ return {
123
+ address: data.address
124
+ };
125
+ };
33
126
  const unmarshalKeyManagerKeyInfo = (data) => {
34
127
  if (!sdkClient.isJSONObject(data)) {
35
128
  throw new TypeError(
@@ -76,35 +169,100 @@ const unmarshalKubernetesPoolInfo = (data) => {
76
169
  name: data.name
77
170
  };
78
171
  };
79
- const unmarshalSecretManagerSecretInfo = (data) => {
172
+ const unmarshalLoadBalancerAclInfo = (data) => {
80
173
  if (!sdkClient.isJSONObject(data)) {
81
174
  throw new TypeError(
82
- `Unmarshalling the type 'SecretManagerSecretInfo' failed as data isn't a dictionary.`
175
+ `Unmarshalling the type 'LoadBalancerAclInfo' failed as data isn't a dictionary.`
83
176
  );
84
177
  }
85
178
  return {
86
- keyId: data.key_id,
87
- path: data.path
179
+ frontendId: data.frontend_id
88
180
  };
89
181
  };
90
- const unmarshalSecretManagerSecretVersionInfo = (data) => {
182
+ const unmarshalLoadBalancerBackendInfo = (data) => {
91
183
  if (!sdkClient.isJSONObject(data)) {
92
184
  throw new TypeError(
93
- `Unmarshalling the type 'SecretManagerSecretVersionInfo' failed as data isn't a dictionary.`
185
+ `Unmarshalling the type 'LoadBalancerBackendInfo' failed as data isn't a dictionary.`
94
186
  );
95
187
  }
96
188
  return {
97
- revision: data.revision
189
+ lbId: data.lb_id,
190
+ name: data.name
98
191
  };
99
192
  };
100
- const unmarshalEventPrincipal = (data) => {
193
+ const unmarshalLoadBalancerCertificateInfo = (data) => {
101
194
  if (!sdkClient.isJSONObject(data)) {
102
195
  throw new TypeError(
103
- `Unmarshalling the type 'EventPrincipal' failed as data isn't a dictionary.`
196
+ `Unmarshalling the type 'LoadBalancerCertificateInfo' failed as data isn't a dictionary.`
104
197
  );
105
198
  }
106
199
  return {
107
- id: data.id
200
+ lbId: data.lb_id,
201
+ name: data.name
202
+ };
203
+ };
204
+ const unmarshalLoadBalancerFrontendInfo = (data) => {
205
+ if (!sdkClient.isJSONObject(data)) {
206
+ throw new TypeError(
207
+ `Unmarshalling the type 'LoadBalancerFrontendInfo' failed as data isn't a dictionary.`
208
+ );
209
+ }
210
+ return {
211
+ lbId: data.lb_id,
212
+ name: data.name
213
+ };
214
+ };
215
+ const unmarshalLoadBalancerIpInfo = (data) => {
216
+ if (!sdkClient.isJSONObject(data)) {
217
+ throw new TypeError(
218
+ `Unmarshalling the type 'LoadBalancerIpInfo' failed as data isn't a dictionary.`
219
+ );
220
+ }
221
+ return {
222
+ ipAddress: data.ip_address,
223
+ lbId: data.lb_id
224
+ };
225
+ };
226
+ const unmarshalLoadBalancerLbInfo = (data) => {
227
+ if (!sdkClient.isJSONObject(data)) {
228
+ throw new TypeError(
229
+ `Unmarshalling the type 'LoadBalancerLbInfo' failed as data isn't a dictionary.`
230
+ );
231
+ }
232
+ return {
233
+ name: data.name
234
+ };
235
+ };
236
+ const unmarshalLoadBalancerRouteInfo = (data) => {
237
+ if (!sdkClient.isJSONObject(data)) {
238
+ throw new TypeError(
239
+ `Unmarshalling the type 'LoadBalancerRouteInfo' failed as data isn't a dictionary.`
240
+ );
241
+ }
242
+ return {
243
+ backendId: data.backend_id,
244
+ frontendId: data.frontend_id
245
+ };
246
+ };
247
+ const unmarshalSecretManagerSecretInfo = (data) => {
248
+ if (!sdkClient.isJSONObject(data)) {
249
+ throw new TypeError(
250
+ `Unmarshalling the type 'SecretManagerSecretInfo' failed as data isn't a dictionary.`
251
+ );
252
+ }
253
+ return {
254
+ keyId: data.key_id,
255
+ path: data.path
256
+ };
257
+ };
258
+ const unmarshalSecretManagerSecretVersionInfo = (data) => {
259
+ if (!sdkClient.isJSONObject(data)) {
260
+ throw new TypeError(
261
+ `Unmarshalling the type 'SecretManagerSecretVersionInfo' failed as data isn't a dictionary.`
262
+ );
263
+ }
264
+ return {
265
+ revision: data.revision
108
266
  };
109
267
  };
110
268
  const unmarshalResource = (data) => {
@@ -115,17 +273,31 @@ const unmarshalResource = (data) => {
115
273
  }
116
274
  return {
117
275
  accountOrganizationInfo: data.account_organization_info ? unmarshalAccountOrganizationInfo(data.account_organization_info) : void 0,
276
+ accountProjectInfo: data.account_project_info ? unmarshalAccountProjectInfo(data.account_project_info) : void 0,
118
277
  accountUserInfo: data.account_user_info ? unmarshalAccountUserInfo(data.account_user_info) : void 0,
278
+ appleSiliconServerInfo: data.apple_silicon_server_info ? unmarshalAppleSiliconServerInfo(data.apple_silicon_server_info) : void 0,
279
+ baremetalServerInfo: data.baremetal_server_info ? unmarshalBaremetalServerInfo(data.baremetal_server_info) : void 0,
280
+ baremetalSettingInfo: data.baremetal_setting_info ? unmarshalBaremetalSettingInfo(data.baremetal_setting_info) : void 0,
119
281
  createdAt: sdkClient.unmarshalDate(data.created_at),
120
282
  deletedAt: sdkClient.unmarshalDate(data.deleted_at),
121
283
  id: data.id,
122
284
  instanceServerInfo: data.instance_server_info ? unmarshalInstanceServerInfo(data.instance_server_info) : void 0,
285
+ ipamIpInfo: data.ipam_ip_info ? unmarshalIpamIpInfo(data.ipam_ip_info) : void 0,
123
286
  keyManagerKeyInfo: data.key_manager_key_info ? unmarshalKeyManagerKeyInfo(data.key_manager_key_info) : void 0,
124
287
  keymKeyInfo: data.keym_key_info ? unmarshalKeyManagerKeyInfo(data.keym_key_info) : void 0,
125
288
  kubeAclInfo: data.kube_acl_info ? unmarshalKubernetesACLInfo(data.kube_acl_info) : void 0,
126
289
  kubeClusterInfo: data.kube_cluster_info ? unmarshalKubernetesClusterInfo(data.kube_cluster_info) : void 0,
127
290
  kubeNodeInfo: data.kube_node_info ? unmarshalKubernetesNodeInfo(data.kube_node_info) : void 0,
128
291
  kubePoolInfo: data.kube_pool_info ? unmarshalKubernetesPoolInfo(data.kube_pool_info) : void 0,
292
+ loadBalancerAclInfo: data.load_balancer_acl_info ? unmarshalLoadBalancerAclInfo(data.load_balancer_acl_info) : void 0,
293
+ loadBalancerBackendInfo: data.load_balancer_backend_info ? unmarshalLoadBalancerBackendInfo(data.load_balancer_backend_info) : void 0,
294
+ loadBalancerCertificateInfo: data.load_balancer_certificate_info ? unmarshalLoadBalancerCertificateInfo(
295
+ data.load_balancer_certificate_info
296
+ ) : void 0,
297
+ loadBalancerFrontendInfo: data.load_balancer_frontend_info ? unmarshalLoadBalancerFrontendInfo(data.load_balancer_frontend_info) : void 0,
298
+ loadBalancerIpInfo: data.load_balancer_ip_info ? unmarshalLoadBalancerIpInfo(data.load_balancer_ip_info) : void 0,
299
+ loadBalancerLbInfo: data.load_balancer_lb_info ? unmarshalLoadBalancerLbInfo(data.load_balancer_lb_info) : void 0,
300
+ loadBalancerRouteInfo: data.load_balancer_route_info ? unmarshalLoadBalancerRouteInfo(data.load_balancer_route_info) : void 0,
129
301
  name: data.name,
130
302
  secmSecretInfo: data.secm_secret_info ? unmarshalSecretManagerSecretInfo(data.secm_secret_info) : void 0,
131
303
  secmSecretVersionInfo: data.secm_secret_version_info ? unmarshalSecretManagerSecretVersionInfo(data.secm_secret_version_info) : void 0,
@@ -137,6 +309,48 @@ const unmarshalResource = (data) => {
137
309
  updatedAt: sdkClient.unmarshalDate(data.updated_at)
138
310
  };
139
311
  };
312
+ const unmarshalAuthenticationEvent = (data) => {
313
+ if (!sdkClient.isJSONObject(data)) {
314
+ throw new TypeError(
315
+ `Unmarshalling the type 'AuthenticationEvent' failed as data isn't a dictionary.`
316
+ );
317
+ }
318
+ return {
319
+ countryCode: data.country_code ? data.country_code : void 0,
320
+ failureReason: data.failure_reason ? data.failure_reason : void 0,
321
+ id: data.id,
322
+ method: data.method,
323
+ mfaType: data.mfa_type ? data.mfa_type : void 0,
324
+ organizationId: data.organization_id,
325
+ origin: data.origin,
326
+ recordedAt: sdkClient.unmarshalDate(data.recorded_at),
327
+ resources: sdkClient.unmarshalArrayOfObject(data.resources, unmarshalResource),
328
+ result: data.result,
329
+ sourceIp: data.source_ip,
330
+ userAgent: data.user_agent
331
+ };
332
+ };
333
+ const unmarshalListAuthenticationEventsResponse = (data) => {
334
+ if (!sdkClient.isJSONObject(data)) {
335
+ throw new TypeError(
336
+ `Unmarshalling the type 'ListAuthenticationEventsResponse' failed as data isn't a dictionary.`
337
+ );
338
+ }
339
+ return {
340
+ events: sdkClient.unmarshalArrayOfObject(data.events, unmarshalAuthenticationEvent),
341
+ nextPageToken: data.next_page_token
342
+ };
343
+ };
344
+ const unmarshalEventPrincipal = (data) => {
345
+ if (!sdkClient.isJSONObject(data)) {
346
+ throw new TypeError(
347
+ `Unmarshalling the type 'EventPrincipal' failed as data isn't a dictionary.`
348
+ );
349
+ }
350
+ return {
351
+ id: data.id
352
+ };
353
+ };
140
354
  const unmarshalEvent = (data) => {
141
355
  if (!sdkClient.isJSONObject(data)) {
142
356
  throw new TypeError(
@@ -154,7 +368,6 @@ const unmarshalEvent = (data) => {
154
368
  recordedAt: sdkClient.unmarshalDate(data.recorded_at),
155
369
  requestBody: data.request_body,
156
370
  requestId: data.request_id,
157
- resource: data.resource ? unmarshalResource(data.resource) : void 0,
158
371
  resources: sdkClient.unmarshalArrayOfObject(data.resources, unmarshalResource),
159
372
  serviceName: data.service_name,
160
373
  sourceIp: data.source_ip,
@@ -162,6 +375,51 @@ const unmarshalEvent = (data) => {
162
375
  userAgent: data.user_agent
163
376
  };
164
377
  };
378
+ const unmarshalSystemEvent = (data) => {
379
+ if (!sdkClient.isJSONObject(data)) {
380
+ throw new TypeError(
381
+ `Unmarshalling the type 'SystemEvent' failed as data isn't a dictionary.`
382
+ );
383
+ }
384
+ return {
385
+ id: data.id,
386
+ kind: data.kind,
387
+ locality: data.locality,
388
+ organizationId: data.organization_id,
389
+ productName: data.product_name,
390
+ projectId: data.project_id,
391
+ recordedAt: sdkClient.unmarshalDate(data.recorded_at),
392
+ resources: sdkClient.unmarshalArrayOfObject(data.resources, unmarshalResource),
393
+ source: data.source,
394
+ systemName: data.system_name
395
+ };
396
+ };
397
+ const unmarshalListCombinedEventsResponseCombinedEvent = (data) => {
398
+ if (!sdkClient.isJSONObject(data)) {
399
+ throw new TypeError(
400
+ `Unmarshalling the type 'ListCombinedEventsResponseCombinedEvent' failed as data isn't a dictionary.`
401
+ );
402
+ }
403
+ return {
404
+ api: data.api ? unmarshalEvent(data.api) : void 0,
405
+ auth: data.auth ? unmarshalAuthenticationEvent(data.auth) : void 0,
406
+ system: data.system ? unmarshalSystemEvent(data.system) : void 0
407
+ };
408
+ };
409
+ const unmarshalListCombinedEventsResponse = (data) => {
410
+ if (!sdkClient.isJSONObject(data)) {
411
+ throw new TypeError(
412
+ `Unmarshalling the type 'ListCombinedEventsResponse' failed as data isn't a dictionary.`
413
+ );
414
+ }
415
+ return {
416
+ events: sdkClient.unmarshalArrayOfObject(
417
+ data.events,
418
+ unmarshalListCombinedEventsResponseCombinedEvent
419
+ ),
420
+ nextPageToken: data.next_page_token
421
+ };
422
+ };
165
423
  const unmarshalListEventsResponse = (data) => {
166
424
  if (!sdkClient.isJSONObject(data)) {
167
425
  throw new TypeError(
@@ -173,6 +431,17 @@ const unmarshalListEventsResponse = (data) => {
173
431
  nextPageToken: data.next_page_token
174
432
  };
175
433
  };
434
+ const unmarshalListExportJobsResponse = (data) => {
435
+ if (!sdkClient.isJSONObject(data)) {
436
+ throw new TypeError(
437
+ `Unmarshalling the type 'ListExportJobsResponse' failed as data isn't a dictionary.`
438
+ );
439
+ }
440
+ return {
441
+ exportJobs: sdkClient.unmarshalArrayOfObject(data.export_jobs, unmarshalExportJob),
442
+ totalCount: data.total_count
443
+ };
444
+ };
176
445
  const unmarshalProductService = (data) => {
177
446
  if (!sdkClient.isJSONObject(data)) {
178
447
  throw new TypeError(
@@ -207,7 +476,29 @@ const unmarshalListProductsResponse = (data) => {
207
476
  totalCount: data.total_count
208
477
  };
209
478
  };
479
+ const marshalExportJobS3 = (request, defaults) => ({
480
+ bucket: request.bucket,
481
+ prefix: request.prefix,
482
+ project_id: request.projectId,
483
+ region: request.region
484
+ });
485
+ const marshalCreateExportJobRequest = (request, defaults) => ({
486
+ name: request.name,
487
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId,
488
+ tags: request.tags,
489
+ ...sdkClient.resolveOneOf([
490
+ {
491
+ param: "s3",
492
+ value: request.s3 !== void 0 ? marshalExportJobS3(request.s3) : void 0
493
+ }
494
+ ])
495
+ });
496
+ exports.marshalCreateExportJobRequest = marshalCreateExportJobRequest;
210
497
  exports.unmarshalEvent = unmarshalEvent;
498
+ exports.unmarshalExportJob = unmarshalExportJob;
499
+ exports.unmarshalListAuthenticationEventsResponse = unmarshalListAuthenticationEventsResponse;
500
+ exports.unmarshalListCombinedEventsResponse = unmarshalListCombinedEventsResponse;
211
501
  exports.unmarshalListEventsResponse = unmarshalListEventsResponse;
502
+ exports.unmarshalListExportJobsResponse = unmarshalListExportJobsResponse;
212
503
  exports.unmarshalListProductsResponse = unmarshalListProductsResponse;
213
504
  exports.unmarshalResource = unmarshalResource;
@@ -1,5 +1,11 @@
1
- import type { Event, ListEventsResponse, ListProductsResponse, Resource } from './types.gen';
1
+ import type { DefaultValues } from '@scaleway/sdk-client';
2
+ import type { CreateExportJobRequest, Event, ExportJob, ListAuthenticationEventsResponse, ListCombinedEventsResponse, ListEventsResponse, ListExportJobsResponse, ListProductsResponse, Resource } from './types.gen.js';
3
+ export declare const unmarshalExportJob: (data: unknown) => ExportJob;
2
4
  export declare const unmarshalResource: (data: unknown) => Resource;
5
+ export declare const unmarshalListAuthenticationEventsResponse: (data: unknown) => ListAuthenticationEventsResponse;
3
6
  export declare const unmarshalEvent: (data: unknown) => Event;
7
+ export declare const unmarshalListCombinedEventsResponse: (data: unknown) => ListCombinedEventsResponse;
4
8
  export declare const unmarshalListEventsResponse: (data: unknown) => ListEventsResponse;
9
+ export declare const unmarshalListExportJobsResponse: (data: unknown) => ListExportJobsResponse;
5
10
  export declare const unmarshalListProductsResponse: (data: unknown) => ListProductsResponse;
11
+ export declare const marshalCreateExportJobRequest: (request: CreateExportJobRequest, defaults: DefaultValues) => Record<string, unknown>;