-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix variants in metadata query results (box/box-openapi#456) (#349)
- Loading branch information
1 parent
a7d36d7
commit 2131e98
Showing
5 changed files
with
64 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "engineHash": "5b7aecf", "specHash": "915b38a", "version": "1.5.1" } | ||
{ "engineHash": "5b7aecf", "specHash": "b21666d", "version": "1.5.1" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { serializeFileFull } from './fileFull.generated.js'; | ||
import { deserializeFileFull } from './fileFull.generated.js'; | ||
import { serializeFolderFull } from './folderFull.generated.js'; | ||
import { deserializeFolderFull } from './folderFull.generated.js'; | ||
import { FileFull } from './fileFull.generated.js'; | ||
import { FolderFull } from './folderFull.generated.js'; | ||
import { BoxSdkError } from '../box/errors.js'; | ||
import { SerializedData } from '../serialization/json.js'; | ||
import { sdIsEmpty } from '../serialization/json.js'; | ||
import { sdIsBoolean } from '../serialization/json.js'; | ||
import { sdIsNumber } from '../serialization/json.js'; | ||
import { sdIsString } from '../serialization/json.js'; | ||
import { sdIsList } from '../serialization/json.js'; | ||
import { sdIsMap } from '../serialization/json.js'; | ||
export type FileFullOrFolderFull = FileFull | FolderFull; | ||
export function serializeFileFullOrFolderFull(val: any): SerializedData { | ||
if (val.type == 'file') { | ||
return serializeFileFull(val); | ||
} | ||
if (val.type == 'folder') { | ||
return serializeFolderFull(val); | ||
} | ||
throw new BoxSdkError({ message: 'unknown type' }); | ||
} | ||
export function deserializeFileFullOrFolderFull( | ||
val: SerializedData | ||
): FileFullOrFolderFull { | ||
if (!sdIsMap(val)) { | ||
throw new BoxSdkError({ | ||
message: 'Expecting a map for "FileFullOrFolderFull"', | ||
}); | ||
} | ||
if (val.type == 'file') { | ||
return deserializeFileFull(val); | ||
} | ||
if (val.type == 'folder') { | ||
return deserializeFolderFull(val); | ||
} | ||
throw new BoxSdkError({ message: "Can't deserialize FileFullOrFolderFull" }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters