-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathapi-key-with-value.serializer.ts
More file actions
40 lines (37 loc) · 1.14 KB
/
Copy pathapi-key-with-value.serializer.ts
File metadata and controls
40 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// This file is auto-generated by oagen. Do not edit.
import type {
ApiKeyWithValue,
ApiKeyWithValueResponse,
} from '../interfaces/api-key-with-value.interface';
import {
deserializeApiKeyWithValueOwner,
serializeApiKeyWithValueOwner,
} from './api-key-with-value-owner.serializer';
export const deserializeApiKeyWithValue = (
response: ApiKeyWithValueResponse,
): ApiKeyWithValue => ({
object: response.object,
id: response.id,
owner: deserializeApiKeyWithValueOwner(response.owner),
name: response.name,
obfuscatedValue: response.obfuscated_value,
lastUsedAt: response.last_used_at ?? null,
permissions: response.permissions,
createdAt: response.created_at,
updatedAt: response.updated_at,
value: response.value,
});
export const serializeApiKeyWithValue = (
model: ApiKeyWithValue,
): ApiKeyWithValueResponse => ({
object: model.object,
id: model.id,
owner: serializeApiKeyWithValueOwner(model.owner),
name: model.name,
obfuscated_value: model.obfuscatedValue,
last_used_at: model.lastUsedAt,
permissions: model.permissions,
created_at: model.createdAt,
updated_at: model.updatedAt,
value: model.value,
});