• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-typescript-sdk-gen / 6039618894

31 Aug 2023 03:52PM UTC coverage: 27.478% (+1.2%) from 26.328%
6039618894

Pull #27

github

web-flow
Merge fe65f3b52 into 28ba84b0e
Pull Request #27: codegen output 82cbf8ea99d04165934487aec28218dc

1084 of 8702 branches covered (0.0%)

Branch coverage included in aggregate %.

14 of 44 new or added lines in 7 files covered. (31.82%)

1 existing line in 1 file now uncovered.

4399 of 11252 relevant lines covered (39.1%)

20.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.95
/src/managers/files.generated.ts
1
import { serializeFileFull } from "../schemas.generated.js";
2
import { deserializeFileFull } from "../schemas.generated.js";
48✔
3
import { serializeClientError } from "../schemas.generated.js";
4
import { deserializeClientError } from "../schemas.generated.js";
5
import { FileFull } from "../schemas.generated.js";
6
import { ClientError } from "../schemas.generated.js";
7
import { Authentication } from "../auth.js";
8
import { NetworkSession } from "../network.js";
9
import { prepareParams } from "../utils.js";
48✔
10
import { toString } from "../utils.js";
48✔
11
import { ByteStream } from "../utils.js";
12
import { fetch } from "../fetch.js";
48✔
13
import { FetchOptions } from "../fetch.js";
14
import { FetchResponse } from "../fetch.js";
15
import { deserializeJson } from "../json.js";
48✔
16
import { Json } from "../json.js";
17
import { serializeJson } from "../json.js";
48✔
18
import { isJson } from "../json.js";
48✔
19
export interface GetFileByIdQueryParamsArg {
20
    readonly fields?: string;
21
}
22
export class GetFileByIdHeadersArg {
48✔
23
    readonly ifNoneMatch?: string;
24
    readonly boxapi?: string;
25
    readonly xRepHints?: string;
26
    readonly extraHeaders?: {
10✔
27
        readonly [key: string]: undefined | string;
28
    } = {};
29
    constructor(fields: GetFileByIdHeadersArg) {
30
        Object.assign(this, fields);
10✔
31
    }
32
}
33
export interface UpdateFileByIdRequestBodyArgParentField {
34
    readonly id?: string;
35
}
36
export type UpdateFileByIdRequestBodyArgSharedLinkFieldAccessField = "open" | "company" | "collaborators";
37
export interface UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField {
38
    readonly canDownload?: boolean;
39
}
40
export interface UpdateFileByIdRequestBodyArgSharedLinkField {
41
    readonly access?: UpdateFileByIdRequestBodyArgSharedLinkFieldAccessField;
42
    readonly password?: string;
43
    readonly vanityName?: string;
44
    readonly unsharedAt?: string;
45
    readonly permissions?: UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField;
46
}
47
export type UpdateFileByIdRequestBodyArgLockFieldAccessField = "lock";
48
export interface UpdateFileByIdRequestBodyArgLockField {
49
    readonly access?: UpdateFileByIdRequestBodyArgLockFieldAccessField;
50
    readonly expiresAt?: string;
51
    readonly isDownloadPrevented?: boolean;
52
}
53
export type UpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField = "open" | "company";
54
export interface UpdateFileByIdRequestBodyArgPermissionsField {
55
    readonly canDownload?: UpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField;
56
}
57
export interface UpdateFileByIdRequestBodyArgCollectionsField {
58
    readonly id?: string;
59
    readonly type?: string;
60
}
61
export interface UpdateFileByIdRequestBodyArg {
62
    readonly name?: string;
63
    readonly description?: string;
64
    readonly parent?: UpdateFileByIdRequestBodyArgParentField;
65
    readonly sharedLink?: UpdateFileByIdRequestBodyArgSharedLinkField;
66
    readonly lock?: UpdateFileByIdRequestBodyArgLockField;
67
    readonly dispositionAt?: string;
68
    readonly permissions?: UpdateFileByIdRequestBodyArgPermissionsField;
69
    readonly collections?: readonly UpdateFileByIdRequestBodyArgCollectionsField[];
70
    readonly tags?: readonly string[];
71
}
72
export interface UpdateFileByIdQueryParamsArg {
73
    readonly fields?: string;
74
}
75
export class UpdateFileByIdHeadersArg {
48✔
76
    readonly ifMatch?: string;
77
    readonly extraHeaders?: {
2✔
78
        readonly [key: string]: undefined | string;
79
    } = {};
80
    constructor(fields: UpdateFileByIdHeadersArg) {
81
        Object.assign(this, fields);
2✔
82
    }
83
}
84
export class DeleteFileByIdHeadersArg {
48✔
85
    readonly ifMatch?: string;
86
    readonly extraHeaders?: {
28✔
87
        readonly [key: string]: undefined | string;
88
    } = {};
89
    constructor(fields: DeleteFileByIdHeadersArg) {
90
        Object.assign(this, fields);
28✔
91
    }
92
}
93
export interface CopyFileRequestBodyArgParentField {
94
    readonly id: string;
95
}
96
export interface CopyFileRequestBodyArg {
97
    readonly name?: string;
98
    readonly version?: string;
99
    readonly parent: CopyFileRequestBodyArgParentField;
100
}
101
export interface CopyFileQueryParamsArg {
102
    readonly fields?: string;
103
}
104
export class CopyFileHeadersArg {
48✔
105
    readonly extraHeaders?: {
2✔
106
        readonly [key: string]: undefined | string;
107
    } = {};
108
    constructor(fields: CopyFileHeadersArg) {
109
        Object.assign(this, fields);
2✔
110
    }
111
}
112
export type GetFileThumbnailByIdExtensionArg = "png" | "jpg";
113
export interface GetFileThumbnailByIdQueryParamsArg {
114
    readonly minHeight?: number;
115
    readonly minWidth?: number;
116
    readonly maxHeight?: number;
117
    readonly maxWidth?: number;
118
}
119
export class GetFileThumbnailByIdHeadersArg {
48✔
120
    readonly extraHeaders?: {
2✔
121
        readonly [key: string]: undefined | string;
122
    } = {};
123
    constructor(fields: GetFileThumbnailByIdHeadersArg) {
124
        Object.assign(this, fields);
2✔
125
    }
126
}
127
export class FilesManager {
48✔
128
    readonly auth?: Authentication;
129
    readonly networkSession?: NetworkSession;
130
    constructor(fields: Omit<FilesManager, "getFileById" | "updateFileById" | "deleteFileById" | "copyFile" | "getFileThumbnailById">) {
131
        Object.assign(this, fields);
56✔
132
    }
133
    async getFileById(fileId: string, queryParams: GetFileByIdQueryParamsArg = {} satisfies GetFileByIdQueryParamsArg, headers: GetFileByIdHeadersArg = new GetFileByIdHeadersArg({})): Promise<FileFull> {
14✔
134
        const queryParamsMap: {
135
            readonly [key: string]: string;
136
        } = prepareParams({ ["fields"]: toString(queryParams.fields) });
10✔
137
        const headersMap: {
138
            readonly [key: string]: string;
139
        } = prepareParams({ ...{ ["if-none-match"]: toString(headers.ifNoneMatch), ["boxapi"]: toString(headers.boxapi), ["x-rep-hints"]: toString(headers.xRepHints) }, ...headers.extraHeaders });
10✔
140
        const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse;
10✔
141
        return deserializeFileFull(deserializeJson(response.text));
8✔
142
    }
143
    async updateFileById(fileId: string, requestBody: UpdateFileByIdRequestBodyArg = {} satisfies UpdateFileByIdRequestBodyArg, queryParams: UpdateFileByIdQueryParamsArg = {} satisfies UpdateFileByIdQueryParamsArg, headers: UpdateFileByIdHeadersArg = new UpdateFileByIdHeadersArg({})): Promise<FileFull> {
4!
144
        const queryParamsMap: {
145
            readonly [key: string]: string;
146
        } = prepareParams({ ["fields"]: toString(queryParams.fields) });
2✔
147
        const headersMap: {
148
            readonly [key: string]: string;
149
        } = prepareParams({ ...{ ["if-match"]: toString(headers.ifMatch) }, ...headers.extraHeaders });
2✔
150
        const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId) as string, { method: "PUT", params: queryParamsMap, headers: headersMap, body: serializeJson(serializeUpdateFileByIdRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse;
2✔
151
        return deserializeFileFull(deserializeJson(response.text));
2✔
152
    }
153
    async deleteFileById(fileId: string, headers: DeleteFileByIdHeadersArg = new DeleteFileByIdHeadersArg({})): Promise<undefined> {
28✔
154
        const headersMap: {
155
            readonly [key: string]: string;
156
        } = prepareParams({ ...{ ["if-match"]: toString(headers.ifMatch) }, ...headers.extraHeaders });
28✔
157
        const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId) as string, { method: "DELETE", headers: headersMap, responseFormat: void 0, auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse;
28✔
158
        return void 0;
28✔
159
    }
160
    async copyFile(fileId: string, requestBody: CopyFileRequestBodyArg, queryParams: CopyFileQueryParamsArg = {} satisfies CopyFileQueryParamsArg, headers: CopyFileHeadersArg = new CopyFileHeadersArg({})): Promise<FileFull> {
4✔
161
        const queryParamsMap: {
162
            readonly [key: string]: string;
163
        } = prepareParams({ ["fields"]: toString(queryParams.fields) });
2✔
164
        const headersMap: {
165
            readonly [key: string]: string;
166
        } = prepareParams({ ...{}, ...headers.extraHeaders });
2✔
167
        const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/copy") as string, { method: "POST", params: queryParamsMap, headers: headersMap, body: serializeJson(serializeCopyFileRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse;
2✔
168
        return deserializeFileFull(deserializeJson(response.text));
2✔
169
    }
170
    async getFileThumbnailById(fileId: string, extension: GetFileThumbnailByIdExtensionArg, queryParams: GetFileThumbnailByIdQueryParamsArg = {} satisfies GetFileThumbnailByIdQueryParamsArg, headers: GetFileThumbnailByIdHeadersArg = new GetFileThumbnailByIdHeadersArg({})): Promise<ByteStream> {
4✔
171
        const queryParamsMap: {
172
            readonly [key: string]: string;
173
        } = prepareParams({ ["min_height"]: toString(queryParams.minHeight), ["min_width"]: toString(queryParams.minWidth), ["max_height"]: toString(queryParams.maxHeight), ["max_width"]: toString(queryParams.maxWidth) });
2✔
174
        const headersMap: {
175
            readonly [key: string]: string;
176
        } = prepareParams({ ...{}, ...headers.extraHeaders });
2✔
177
        const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/thumbnail.", extension) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "binary", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse;
2✔
178
        return response.content;
2✔
179
    }
180
}
181
export function serializeUpdateFileByIdRequestBodyArgParentField(val: UpdateFileByIdRequestBodyArgParentField): Json {
48✔
182
    return { ["id"]: val.id == void 0 ? void 0 : val.id };
×
183
}
184
export function deserializeUpdateFileByIdRequestBodyArgParentField(val: any): UpdateFileByIdRequestBodyArgParentField {
48✔
185
    const id: undefined | string = val.id == void 0 ? void 0 : val.id;
×
186
    return { id: id } satisfies UpdateFileByIdRequestBodyArgParentField;
×
187
}
188
export function serializeUpdateFileByIdRequestBodyArgSharedLinkFieldAccessField(val: UpdateFileByIdRequestBodyArgSharedLinkFieldAccessField): Json {
48✔
189
    return val;
×
190
}
191
export function deserializeUpdateFileByIdRequestBodyArgSharedLinkFieldAccessField(val: any): UpdateFileByIdRequestBodyArgSharedLinkFieldAccessField {
48✔
192
    if (!isJson(val, "string")) {
×
193
        throw "Expecting a string for \"UpdateFileByIdRequestBodyArgSharedLinkFieldAccessField\"";
×
194
    }
195
    if (val == "open") {
×
196
        return "open";
×
197
    }
198
    if (val == "company") {
×
199
        return "company";
×
200
    }
201
    if (val == "collaborators") {
×
202
        return "collaborators";
×
203
    }
204
    throw "".concat("Invalid value: ", val) as string;
×
205
}
206
export function serializeUpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField): Json {
48✔
207
    return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload };
×
208
}
209
export function deserializeUpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField {
48✔
210
    const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download;
×
211
    return { canDownload: canDownload } satisfies UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField;
×
212
}
213
export function serializeUpdateFileByIdRequestBodyArgSharedLinkField(val: UpdateFileByIdRequestBodyArgSharedLinkField): Json {
48✔
214
    return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password == void 0 ? void 0 : val.password, ["vanity_name"]: val.vanityName == void 0 ? void 0 : val.vanityName, ["unshared_at"]: val.unsharedAt == void 0 ? void 0 : val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) };
×
215
}
216
export function deserializeUpdateFileByIdRequestBodyArgSharedLinkField(val: any): UpdateFileByIdRequestBodyArgSharedLinkField {
48✔
217
    const access: undefined | UpdateFileByIdRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgSharedLinkFieldAccessField(val.access);
×
218
    const password: undefined | string = val.password == void 0 ? void 0 : val.password;
×
219
    const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name;
×
220
    const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at;
×
221
    const permissions: undefined | UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField(val.permissions);
×
222
    return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateFileByIdRequestBodyArgSharedLinkField;
×
223
}
224
export function serializeUpdateFileByIdRequestBodyArgLockFieldAccessField(val: UpdateFileByIdRequestBodyArgLockFieldAccessField): Json {
48✔
225
    return val;
×
226
}
227
export function deserializeUpdateFileByIdRequestBodyArgLockFieldAccessField(val: any): UpdateFileByIdRequestBodyArgLockFieldAccessField {
48✔
228
    if (!isJson(val, "string")) {
×
229
        throw "Expecting a string for \"UpdateFileByIdRequestBodyArgLockFieldAccessField\"";
×
230
    }
231
    if (val == "lock") {
×
232
        return "lock";
×
233
    }
234
    throw "".concat("Invalid value: ", val) as string;
×
235
}
236
export function serializeUpdateFileByIdRequestBodyArgLockField(val: UpdateFileByIdRequestBodyArgLockField): Json {
48✔
237
    return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgLockFieldAccessField(val.access), ["expires_at"]: val.expiresAt == void 0 ? void 0 : val.expiresAt, ["is_download_prevented"]: val.isDownloadPrevented == void 0 ? void 0 : val.isDownloadPrevented };
×
238
}
239
export function deserializeUpdateFileByIdRequestBodyArgLockField(val: any): UpdateFileByIdRequestBodyArgLockField {
48✔
240
    const access: undefined | UpdateFileByIdRequestBodyArgLockFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgLockFieldAccessField(val.access);
×
241
    const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at;
×
242
    const isDownloadPrevented: undefined | boolean = val.is_download_prevented == void 0 ? void 0 : val.is_download_prevented;
×
243
    return { access: access, expiresAt: expiresAt, isDownloadPrevented: isDownloadPrevented } satisfies UpdateFileByIdRequestBodyArgLockField;
×
244
}
245
export function serializeUpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField(val: UpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField): Json {
48✔
246
    return val;
×
247
}
248
export function deserializeUpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField(val: any): UpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField {
48✔
249
    if (!isJson(val, "string")) {
×
250
        throw "Expecting a string for \"UpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField\"";
×
251
    }
252
    if (val == "open") {
×
253
        return "open";
×
254
    }
255
    if (val == "company") {
×
256
        return "company";
×
257
    }
258
    throw "".concat("Invalid value: ", val) as string;
×
259
}
260
export function serializeUpdateFileByIdRequestBodyArgPermissionsField(val: UpdateFileByIdRequestBodyArgPermissionsField): Json {
48✔
261
    return { ["can_download"]: val.canDownload == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField(val.canDownload) };
×
262
}
263
export function deserializeUpdateFileByIdRequestBodyArgPermissionsField(val: any): UpdateFileByIdRequestBodyArgPermissionsField {
48✔
264
    const canDownload: undefined | UpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField = val.can_download == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField(val.can_download);
×
265
    return { canDownload: canDownload } satisfies UpdateFileByIdRequestBodyArgPermissionsField;
×
266
}
267
export function serializeUpdateFileByIdRequestBodyArgCollectionsField(val: UpdateFileByIdRequestBodyArgCollectionsField): Json {
48✔
268
    return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : val.type };
×
269
}
270
export function deserializeUpdateFileByIdRequestBodyArgCollectionsField(val: any): UpdateFileByIdRequestBodyArgCollectionsField {
48✔
271
    const id: undefined | string = val.id == void 0 ? void 0 : val.id;
×
272
    const type: undefined | string = val.type == void 0 ? void 0 : val.type;
×
273
    return { id: id, type: type } satisfies UpdateFileByIdRequestBodyArgCollectionsField;
×
274
}
275
export function serializeUpdateFileByIdRequestBodyArg(val: UpdateFileByIdRequestBodyArg): Json {
48✔
276
    return { ["name"]: val.name == void 0 ? void 0 : val.name, ["description"]: val.description == void 0 ? void 0 : val.description, ["parent"]: val.parent == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgParentField(val.parent), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgSharedLinkField(val.sharedLink), ["lock"]: val.lock == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgLockField(val.lock), ["disposition_at"]: val.dispositionAt == void 0 ? void 0 : val.dispositionAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgPermissionsField(val.permissions), ["collections"]: val.collections == void 0 ? void 0 : val.collections.map(function (item: UpdateFileByIdRequestBodyArgCollectionsField): any {
2!
277
            return serializeUpdateFileByIdRequestBodyArgCollectionsField(item);
×
278
        }) as readonly any[], ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): any {
2!
279
            return item;
×
280
        }) as readonly any[] };
281
}
282
export function deserializeUpdateFileByIdRequestBodyArg(val: any): UpdateFileByIdRequestBodyArg {
48✔
283
    const name: undefined | string = val.name == void 0 ? void 0 : val.name;
×
284
    const description: undefined | string = val.description == void 0 ? void 0 : val.description;
×
285
    const parent: undefined | UpdateFileByIdRequestBodyArgParentField = val.parent == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgParentField(val.parent);
×
286
    const sharedLink: undefined | UpdateFileByIdRequestBodyArgSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgSharedLinkField(val.shared_link);
×
287
    const lock: undefined | UpdateFileByIdRequestBodyArgLockField = val.lock == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgLockField(val.lock);
×
288
    const dispositionAt: undefined | string = val.disposition_at == void 0 ? void 0 : val.disposition_at;
×
289
    const permissions: undefined | UpdateFileByIdRequestBodyArgPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgPermissionsField(val.permissions);
×
290
    const collections: undefined | readonly UpdateFileByIdRequestBodyArgCollectionsField[] = val.collections == void 0 ? void 0 : isJson(val.collections, "array") ? val.collections.map(function (itm: Json): any {
×
291
        return deserializeUpdateFileByIdRequestBodyArgCollectionsField(itm);
×
292
    }) as readonly any[] : [];
NEW
293
    const tags: undefined | readonly string[] = val.tags == void 0 ? void 0 : isJson(val.tags, "array") ? val.tags.map(function (itm: Json): any {
×
294
        return itm;
×
295
    }) as readonly any[] : [];
296
    return { name: name, description: description, parent: parent, sharedLink: sharedLink, lock: lock, dispositionAt: dispositionAt, permissions: permissions, collections: collections, tags: tags } satisfies UpdateFileByIdRequestBodyArg;
×
297
}
298
export function serializeCopyFileRequestBodyArgParentField(val: CopyFileRequestBodyArgParentField): Json {
48✔
299
    return { ["id"]: val.id };
2✔
300
}
301
export function deserializeCopyFileRequestBodyArgParentField(val: any): CopyFileRequestBodyArgParentField {
48✔
302
    const id: string = val.id;
×
303
    return { id: id } satisfies CopyFileRequestBodyArgParentField;
×
304
}
305
export function serializeCopyFileRequestBodyArg(val: CopyFileRequestBodyArg): Json {
48✔
306
    return { ["name"]: val.name == void 0 ? void 0 : val.name, ["version"]: val.version == void 0 ? void 0 : val.version, ["parent"]: serializeCopyFileRequestBodyArgParentField(val.parent) };
2!
307
}
308
export function deserializeCopyFileRequestBodyArg(val: any): CopyFileRequestBodyArg {
48✔
309
    const name: undefined | string = val.name == void 0 ? void 0 : val.name;
×
310
    const version: undefined | string = val.version == void 0 ? void 0 : val.version;
×
311
    const parent: CopyFileRequestBodyArgParentField = deserializeCopyFileRequestBodyArgParentField(val.parent);
×
312
    return { name: name, version: version, parent: parent } satisfies CopyFileRequestBodyArg;
×
313
}
314
export function serializeGetFileThumbnailByIdExtensionArg(val: GetFileThumbnailByIdExtensionArg): Json {
48✔
315
    return val;
×
316
}
317
export function deserializeGetFileThumbnailByIdExtensionArg(val: any): GetFileThumbnailByIdExtensionArg {
48✔
318
    if (!isJson(val, "string")) {
×
319
        throw "Expecting a string for \"GetFileThumbnailByIdExtensionArg\"";
×
320
    }
321
    if (val == "png") {
×
322
        return "png";
×
323
    }
324
    if (val == "jpg") {
×
325
        return "jpg";
×
326
    }
327
    throw "".concat("Invalid value: ", val) as string;
×
328
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc