From 5c6e6806b3cf11499caaeff9fb02ddbdc0193470 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 14 Aug 2023 01:37:17 -0700 Subject: [PATCH] generated with codegen at box/box-codegen@a319f28 and spec at box/box-openapi@024f1b8 --- .gitignore | 135 +- README.md | 39 +- docs/authentication.md | 36 +- docs/classifications.md | 102 + docs/collections.md | 10 +- docs/emailAliases.md | 15 +- docs/fileClassifications.md | 33 + docs/fileMetadata.md | 64 +- docs/folderClassifications.md | 33 + docs/folderLocks.md | 15 +- docs/folderMetadata.md | 41 + docs/metadataTemplates.md | 68 +- docs/recentItems.md | 5 +- docs/skills.md | 30 + docs/trashedFiles.md | 12 +- docs/trashedFolders.md | 15 +- package.json | 29 +- src/managers/avatars.generated.ts | 2 +- src/managers/chunkedUploads.generated.ts | 10 +- src/managers/classifications.generated.ts | 167 +- src/managers/comments.generated.ts | 10 +- src/managers/fileClassifications.generated.ts | 63 +- src/managers/fileMetadata.generated.ts | 86 +- src/managers/fileVersions.generated.ts | 12 +- src/managers/files.generated.ts | 58 +- .../folderClassifications.generated.ts | 63 +- src/managers/folderMetadata.generated.ts | 86 +- src/managers/folders.generated.ts | 56 +- src/managers/groups.generated.ts | 20 +- src/managers/integrationMappings.generated.ts | 28 +- src/managers/invites.generated.ts | 7 +- src/managers/legalHoldPolicies.generated.ts | 21 +- src/managers/memberships.generated.ts | 38 +- src/managers/metadataTemplates.generated.ts | 146 +- src/managers/retentionPolicies.generated.ts | 36 +- .../retentionPolicyAssignments.generated.ts | 14 +- src/managers/search.generated.ts | 2 +- src/managers/sessionTermination.generated.ts | 33 +- src/managers/sharedLinksFiles.generated.ts | 38 +- src/managers/sharedLinksFolders.generated.ts | 38 +- src/managers/sharedLinksWebLinks.generated.ts | 38 +- ...ieldInformationBarrierReports.generated.ts | 2 +- ...ormationBarrierSegmentMembers.generated.ts | 4 +- ...ionBarrierSegmentRestrictions.generated.ts | 8 +- ...eldInformationBarrierSegments.generated.ts | 13 +- src/managers/skills.generated.ts | 66 +- src/managers/taskAssignments.generated.ts | 12 +- src/managers/tasks.generated.ts | 18 +- src/managers/transfer.generated.ts | 2 +- src/managers/trashedFiles.generated.ts | 13 +- src/managers/trashedFolders.generated.ts | 13 +- src/managers/trashedWebLinks.generated.ts | 13 +- src/managers/uploads.generated.ts | 29 +- src/managers/userCollaborations.generated.ts | 22 +- src/managers/users.generated.ts | 84 +- src/managers/webLinks.generated.ts | 30 +- src/managers/webhooks.generated.ts | 22 +- src/managers/workflows.generated.ts | 28 +- src/managers/zipDownloads.generated.ts | 2 +- src/schemas.generated.ts | 3200 +++++++++-------- src/test/collections.generated.test.ts | 36 + src/test/emailAliases.generated.test.ts | 40 + src/test/fileMetadata.generated.test.ts | 56 + src/test/folderLocks.generated.test.ts | 51 + src/test/metadataTemplates.generated.test.ts | 54 + src/test/recentItems.generated.test.ts | 17 + src/test/trashedFiles.generated.test.ts | 51 + src/test/trashedFolders.generated.test.ts | 39 + 68 files changed, 3576 insertions(+), 2103 deletions(-) create mode 100644 src/test/collections.generated.test.ts create mode 100644 src/test/emailAliases.generated.test.ts create mode 100644 src/test/fileMetadata.generated.test.ts create mode 100644 src/test/folderLocks.generated.test.ts create mode 100644 src/test/metadataTemplates.generated.test.ts create mode 100644 src/test/recentItems.generated.test.ts create mode 100644 src/test/trashedFiles.generated.test.ts create mode 100644 src/test/trashedFolders.generated.test.ts diff --git a/.gitignore b/.gitignore index 12da03f6..0d0aabc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,133 @@ -lib/ -coverage/ \ No newline at end of file +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# box-gen-sdk +lib/ \ No newline at end of file diff --git a/README.md b/README.md index b684e5a6..61c772f8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,23 @@ +

+ “box-dev-logo” +

+ # Box TypeScript SDK GENERATED +We are excited to introduce the latest generation (currently in Beta) of Box TypeScript SDK, designed to elevate the developer experience and streamline your integration with the Box Content Cloud. + +With this SDK, you’ll have access to: + +1. Full API Support: The new generation of Box SDKs empowers developers with complete coverage of the Box API ecosystem. You can now access all the latest features and functionalities offered by Box, allowing you to build even more sophisticated and feature-rich applications. +2. Rapid API Updates: Say goodbye to waiting for new Box APIs to be incorporated into the SDK. With our new auto-generation development approach, we can now add new Box APIs to the SDK at a much faster pace (in a matter of days). This means you can leverage the most up-to-date features in your applications without delay. +3. Embedded Documentation: We understand that easy access to information is crucial for developers. With our new approach, we have included comprehensive documentation for all objects and parameters directly in the source code of the SDK. This means you no longer need to look up this information on the developer portal, saving you time and streamlining your development process. +4. Enhanced Convenience Methods: Our commitment to enhancing your development experience continues with the introduction of convenience methods. These methods cover various aspects such as chunk uploads, classification, and much more. +5. Seamless Start: The new SDKs integrate essential functionalities like authentication, automatic retries with exponential backoff, exception handling, request cancellation, and type checking, enabling you to focus solely on your application's business logic. + +Embrace the new generation of Box SDKs and unlock the full potential of the Box Content Cloud. + +# Table of contents + @@ -13,7 +31,13 @@ # Installing ```console -npm install git+ssh://git@github.com/box/box-ts-sdk-generated.git +npm install box-typescript-sdk-gen +``` + +If you use yarn, please do this instead: + +```console +yarn add box-typescript-sdk-gen ``` This is autogenerated Box SDK Beta version. The engine used for generating this SDK can be found [here](https://github.com/box/box-codegen). @@ -30,8 +54,10 @@ Using `Client` object you can access managers, which allow you to perform some o The example below demonstrates how to authenticate with Developer Token and print names of all items inside a root folder. ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { DeveloperTokenAuth } = require('BoxSDK/lib/developerTokenAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { + DeveloperTokenAuth, +} = require('box-typescript-sdk-gen/lib/developerTokenAuth.js'); async function main(token) { let auth = new DeveloperTokenAuth({ token }); @@ -46,12 +72,11 @@ main('INSERT YOUR DEVELOPER TOKEN HERE'); # Questions, Bugs, and Feature Requests? Need to contact us directly? [Browse the issues -tickets](https://github.com/box/box-ts-sdk-generated/issues)! Or, if that +tickets](https://github.com/box/box-typescript-sdk-gen/issues)! Or, if that doesn't work, [file a new -one](https://github.com/box/box-ts-sdk-generated/issues/new) and we will get +one](https://github.com/box/box-typescript-sdk-gen/issues/new) and we will get back to you. If you have general questions about the Box API, you can -post to the [Box Developer -Forum](https://community.box.com/t5/Developer-Forum/bd-p/DeveloperForum). +post to the [Box Developer Forum](https://forum.box.com/). # Copyright and License diff --git a/docs/authentication.md b/docs/authentication.md index 17c6f317..bdee842d 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -32,8 +32,10 @@ object with the `token` set to the developer token and construct the client with ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { DeveloperTokenAuth } = require('BoxSDK/lib/developerTokenAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { + DeveloperTokenAuth, +} = require('box-typescript-sdk-gen/lib/developerTokenAuth.js'); const auth = new DeveloperTokenAuth({ token: 'DEVELOPER_TOKEN_GOES_HERE' }); const client = new Client({ auth }); @@ -66,8 +68,8 @@ Service Account. Call one of static `JwtAuth` method: or `JwtConfig.fromConfigJsonString(configJsonString)` and pass JSON config file content as string. ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { JwtAuth, JwtConfig } = require('BoxSDK/lib/jwtAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { JwtAuth, JwtConfig } = require('box-typescript-sdk-gen/lib/jwtAuth.js'); const jwtConfig = JwtConfig.fromConfigFile('/path/to/settings.json'); const jwtAuth = new JwtAuth({ config: jwtConfig }); @@ -80,8 +82,8 @@ console.log(`My user ID is ${me.id}`); Otherwise, you'll need to provide the necessary configuration fields directly to the `JwtConfig` constructor: ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { JwtAuth, JwtConfig } = require('BoxSDK/lib/jwtAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { JwtAuth, JwtConfig } = require('box-typescript-sdk-gen/lib/jwtAuth.js'); const jwtConfig = new JwtConfig({ clientId: 'YOUR_CLIENT_ID', @@ -109,8 +111,8 @@ Clients for making calls as an App User can be created with the same JSON JWT co a user ID you want to authenticate. ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { JwtAuth, JwtConfig } = require('BoxSDK/lib/jwtAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { JwtAuth, JwtConfig } = require('box-typescript-sdk-gen/lib/jwtAuth.js'); const jwtConfig = JwtConfig.fromConfigFile('/path/to/settings.json'); const jwtAuth = new JwtAuth({ config: jwtConfig }); @@ -123,8 +125,8 @@ constructor as in the above examples, similarly to creating a Service Account cl `userId` instead of `enterpriseId` when constructing the auth config instance: ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { JwtAuth, JwtConfig } = require('BoxSDK/lib/jwtAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { JwtAuth, JwtConfig } = require('box-typescript-sdk-gen/lib/jwtAuth.js'); const jwtConfig = new JwtConfig({ clientId: 'YOUR_CLIENT_ID', @@ -153,8 +155,8 @@ and secret with enterprise or user ID, which allows you to work using service or You can use `CCGAuth` to initialize a client object the same way as for other authentication types: ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { CcgAuth } = require('BoxSDK/lib/ccgAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { CcgAuth } = require('box-typescript-sdk-gen/lib/ccgAuth.js'); const ccgConfig = { userId: 'YOUR_USER_ID', @@ -179,8 +181,8 @@ are not accessible in any other account by default, and vice versa. To obtain service account you will have to provide enterprise ID with client id and secret: ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { CcgAuth } = require('BoxSDK/lib/ccgAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { CcgAuth } = require('box-typescript-sdk-gen/lib/ccgAuth.js'); const ccgConfig = { enterpriseId: 'YOUR_ENTERPRISE_ID', @@ -200,8 +202,8 @@ select `Generate user access tokens`. Do not forget to re-authorize application To obtain user account you will have to provide user ID with client id and secret. ```js -const { Client } = require('BoxSDK/lib/client.generated.js'); -const { CcgAuth } = require('BoxSDK/lib/ccgAuth.js'); +const { Client } = require('box-typescript-sdk-gen/lib/client.generated.js'); +const { CcgAuth } = require('box-typescript-sdk-gen/lib/ccgAuth.js'); const ccgConfig = { userId: 'YOUR_USER_ID', @@ -246,7 +248,7 @@ browser or web view) in order to obtain an auth code. ```js -const { OAuth, OAuthConfig } = require('BoxSDK/lib/oauth.js'); +const { OAuth, OAuthConfig } = require('box-typescript-sdk-gen/lib/oauth.js'); const config = { clientId: 'OAUTH_CLIENT_ID', diff --git a/docs/classifications.md b/docs/classifications.md index fe2250f0..47402cab 100644 --- a/docs/classifications.md +++ b/docs/classifications.md @@ -3,6 +3,9 @@ - [List all classifications](#list-all-classifications) - [Delete all classifications](#delete-all-classifications) +- [Add classification](#add-classification) +- [Update classification](#update-classification) +- [Delete classification](#delete-classification) - [Add initial classifications](#add-initial-classifications) ## List all classifications @@ -62,6 +65,105 @@ Returns an empty response when the metadata template for classifications is successfully deleted. +## Add classification + +Adds one or more new classifications to the list of classifications +available to the enterprise. + +This API can also be called by including the enterprise ID in the +URL explicitly, for example +`/metadata_templates/enterprise_12345/securityClassification-6VMVochwUWo/schema`. + +This operation is performed by calling function `updateMetadataTemplateEnterpriseSecurityClassificationSchemaAdd`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-metadata-templates-enterprise-security-classification-6-vm-vochw-u-wo-schema-add/). + +*Currently we don't have an example for calling `updateMetadataTemplateEnterpriseSecurityClassificationSchemaAdd` in integration tests* + +### Arguments + +- requestBody `readonly UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg[]` + - Request body of updateMetadataTemplateEnterpriseSecurityClassificationSchemaAdd method +- headers `UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddHeadersArg` + - Headers of updateMetadataTemplateEnterpriseSecurityClassificationSchemaAdd method + + +### Returns + +This function returns a value of type `ClassificationTemplate`. + +Returns the updated `securityClassification` metadata template, which +contains a `Box__Security__Classification__Key` field that lists all +the classifications available to this enterprise. + + +## Update classification + +Updates the labels and descriptions of one or more classifications +available to the enterprise. + +This API can also be called by including the enterprise ID in the +URL explicitly, for example +`/metadata_templates/enterprise_12345/securityClassification-6VMVochwUWo/schema`. + +This operation is performed by calling function `updateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdate`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-metadata-templates-enterprise-security-classification-6-vm-vochw-u-wo-schema-update/). + +*Currently we don't have an example for calling `updateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdate` in integration tests* + +### Arguments + +- requestBody `readonly UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg[]` + - Request body of updateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdate method +- headers `UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateHeadersArg` + - Headers of updateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdate method + + +### Returns + +This function returns a value of type `ClassificationTemplate`. + +Returns the updated `securityClassification` metadata template, which +contains a `Box__Security__Classification__Key` field that lists all +the classifications available to this enterprise. + + +## Delete classification + +Removes a classification from the list of classifications +available to the enterprise. + +This API can also be called by including the enterprise ID in the +URL explicitly, for example +`/metadata_templates/enterprise_12345/securityClassification-6VMVochwUWo/schema`. + +This operation is performed by calling function `updateMetadataTemplateEnterpriseSecurityClassificationSchemaDelete`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-metadata-templates-enterprise-security-classification-6-vm-vochw-u-wo-schema-delete/). + +*Currently we don't have an example for calling `updateMetadataTemplateEnterpriseSecurityClassificationSchemaDelete` in integration tests* + +### Arguments + +- requestBody `readonly UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg[]` + - Request body of updateMetadataTemplateEnterpriseSecurityClassificationSchemaDelete method +- headers `UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteHeadersArg` + - Headers of updateMetadataTemplateEnterpriseSecurityClassificationSchemaDelete method + + +### Returns + +This function returns a value of type `ClassificationTemplate`. + +Returns the updated `securityClassification` metadata template, which +contains a `Box__Security__Classification__Key` field that lists all +the classifications available to this enterprise. + + ## Add initial classifications When an enterprise does not yet have any classifications, this API call diff --git a/docs/collections.md b/docs/collections.md index c2352885..5227e3d5 100644 --- a/docs/collections.md +++ b/docs/collections.md @@ -16,7 +16,10 @@ This operation is performed by calling function `getCollections`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-collections/). -*Currently we don't have an example for calling `getCollections` in integration tests* + +```ts +await client.collections.getCollections() +``` ### Arguments @@ -43,7 +46,10 @@ This operation is performed by calling function `getCollectionItems`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-collections-id-items/). -*Currently we don't have an example for calling `getCollectionItems` in integration tests* + +```ts +await client.collections.getCollectionItems(favouriteCollection.id) +``` ### Arguments diff --git a/docs/emailAliases.md b/docs/emailAliases.md index cc9b37ef..ee74bee5 100644 --- a/docs/emailAliases.md +++ b/docs/emailAliases.md @@ -15,7 +15,10 @@ This operation is performed by calling function `getUserEmailAliases`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-users-id-email-aliases/). -*Currently we don't have an example for calling `getUserEmailAliases` in integration tests* + +```ts +await client.emailAliases.getUserEmailAliases(newUser.id) +``` ### Arguments @@ -41,7 +44,10 @@ This operation is performed by calling function `createUserEmailAlias`. See the endpoint docs at [API Reference](https://developer.box.com/reference/post-users-id-email-aliases/). -*Currently we don't have an example for calling `createUserEmailAlias` in integration tests* + +```ts +await client.emailAliases.createUserEmailAlias(newUser.id, { email: newAliasEmail } satisfies CreateUserEmailAliasRequestBodyArg) +``` ### Arguments @@ -69,7 +75,10 @@ This operation is performed by calling function `deleteUserEmailAliasById`. See the endpoint docs at [API Reference](https://developer.box.com/reference/delete-users-id-email-aliases-id/). -*Currently we don't have an example for calling `deleteUserEmailAliasById` in integration tests* + +```ts +await client.emailAliases.deleteUserEmailAliasById(newUser.id, newAlias.id) +``` ### Arguments diff --git a/docs/fileClassifications.md b/docs/fileClassifications.md index b7a52bf2..5df5786e 100644 --- a/docs/fileClassifications.md +++ b/docs/fileClassifications.md @@ -3,6 +3,7 @@ - [Get classification on file](#get-classification-on-file) - [Add classification to file](#add-classification-to-file) +- [Update classification on file](#update-classification-on-file) - [Remove classification from file](#remove-classification-from-file) ## Get classification on file @@ -73,6 +74,38 @@ Returns the classification template instance that was applied to the file. +## Update classification on file + +Updates a classification on a file. + +The classification can only be updated if a classification has already been +applied to the file before. When editing classifications, only values are +defined for the enterprise will be accepted. + +This operation is performed by calling function `updateFileMetadataEnterpriseSecurityClassification`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-files-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). + +*Currently we don't have an example for calling `updateFileMetadataEnterpriseSecurityClassification` in integration tests* + +### Arguments + +- fileId `string` + - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" +- requestBody `readonly UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg[]` + - Request body of updateFileMetadataEnterpriseSecurityClassification method +- headers `UpdateFileMetadataEnterpriseSecurityClassificationHeadersArg` + - Headers of updateFileMetadataEnterpriseSecurityClassification method + + +### Returns + +This function returns a value of type `Classification`. + +Returns the updated classification metadata template instance. + + ## Remove classification from file Removes any classifications from a file. diff --git a/docs/fileMetadata.md b/docs/fileMetadata.md index f1d7aaf3..f0e56a23 100644 --- a/docs/fileMetadata.md +++ b/docs/fileMetadata.md @@ -4,6 +4,7 @@ - [List metadata instances on file](#list-metadata-instances-on-file) - [Get metadata instance on file](#get-metadata-instance-on-file) - [Create metadata instance on file](#create-metadata-instance-on-file) +- [Update metadata instance on file](#update-metadata-instance-on-file) - [Remove metadata instance from file](#remove-metadata-instance-from-file) ## List metadata instances on file @@ -15,7 +16,10 @@ This operation is performed by calling function `getFileMetadata`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-files-id-metadata/). -*Currently we don't have an example for calling `getFileMetadata` in integration tests* + +```ts +await client.fileMetadata.getFileMetadata(fileId) +``` ### Arguments @@ -45,7 +49,10 @@ This operation is performed by calling function `getFileMetadataById`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-files-id-metadata-id-id/). -*Currently we don't have an example for calling `getFileMetadataById` in integration tests* + +```ts +await client.fileMetadata.getFileMetadataById(fileId, scope, template) +``` ### Arguments @@ -81,7 +88,10 @@ This operation is performed by calling function `createFileMetadataById`. See the endpoint docs at [API Reference](https://developer.box.com/reference/post-files-id-metadata-id-id/). -*Currently we don't have an example for calling `createFileMetadataById` in integration tests* + +```ts +await client.fileMetadata.createFileMetadataById(fileId, scope, template, data) +``` ### Arguments @@ -105,6 +115,49 @@ Returns the instance of the template that was applied to the file, including the data that was applied to the template. +## Update metadata instance on file + +Updates a piece of metadata on a file. + +The metadata instance can only be updated if the template has already been +applied to the file before. When editing metadata, only values that match +the metadata template schema will be accepted. + +The update is applied atomically. If any errors occur during the +application of the operations, the metadata instance will not be changed. + +This operation is performed by calling function `updateFileMetadataById`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-files-id-metadata-id-id/). + + +```ts +await client.fileMetadata.updateFileMetadataById(fileId, scope, template, [{ op: "replace" as UpdateFileMetadataByIdRequestBodyArgOpField, path: "/abc", value: newValue } satisfies UpdateFileMetadataByIdRequestBodyArg]) +``` + +### Arguments + +- fileId `string` + - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" +- scope `UpdateFileMetadataByIdScopeArg` + - The scope of the metadata template Example: "global" +- templateKey `string` + - The name of the metadata template Example: "properties" +- requestBody `readonly UpdateFileMetadataByIdRequestBodyArg[]` + - Request body of updateFileMetadataById method +- headers `UpdateFileMetadataByIdHeadersArg` + - Headers of updateFileMetadataById method + + +### Returns + +This function returns a value of type `Metadata`. + +Returns the updated metadata template instance, with the +custom template data included. + + ## Remove metadata instance from file Deletes a piece of file metadata. @@ -114,7 +167,10 @@ This operation is performed by calling function `deleteFileMetadataById`. See the endpoint docs at [API Reference](https://developer.box.com/reference/delete-files-id-metadata-id-id/). -*Currently we don't have an example for calling `deleteFileMetadataById` in integration tests* + +```ts +await client.fileMetadata.deleteFileMetadataById(fileId, scope, template) +``` ### Arguments diff --git a/docs/folderClassifications.md b/docs/folderClassifications.md index 0094b025..25fe3589 100644 --- a/docs/folderClassifications.md +++ b/docs/folderClassifications.md @@ -3,6 +3,7 @@ - [Get classification on folder](#get-classification-on-folder) - [Add classification to folder](#add-classification-to-folder) +- [Update classification on folder](#update-classification-on-folder) - [Remove classification from folder](#remove-classification-from-folder) ## Get classification on folder @@ -73,6 +74,38 @@ Returns the classification template instance that was applied to the folder. +## Update classification on folder + +Updates a classification on a folder. + +The classification can only be updated if a classification has already been +applied to the folder before. When editing classifications, only values are +defined for the enterprise will be accepted. + +This operation is performed by calling function `updateFolderMetadataEnterpriseSecurityClassification`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-folders-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). + +*Currently we don't have an example for calling `updateFolderMetadataEnterpriseSecurityClassification` in integration tests* + +### Arguments + +- folderId `string` + - The unique identifier that represent a folder. The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/folder/123` the `folder_id` is `123`. The root folder of a Box account is always represented by the ID `0`. Example: "12345" +- requestBody `readonly UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg[]` + - Request body of updateFolderMetadataEnterpriseSecurityClassification method +- headers `UpdateFolderMetadataEnterpriseSecurityClassificationHeadersArg` + - Headers of updateFolderMetadataEnterpriseSecurityClassification method + + +### Returns + +This function returns a value of type `Classification`. + +Returns the updated classification metadata template instance. + + ## Remove classification from folder Removes any classifications from a folder. diff --git a/docs/folderLocks.md b/docs/folderLocks.md index 5d72bd34..4fdfbc19 100644 --- a/docs/folderLocks.md +++ b/docs/folderLocks.md @@ -17,7 +17,10 @@ This operation is performed by calling function `getFolderLocks`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-folder-locks/). -*Currently we don't have an example for calling `getFolderLocks` in integration tests* + +```ts +await client.folderLocks.getFolderLocks({ folderId: folder.id } satisfies GetFolderLocksQueryParamsArg) +``` ### Arguments @@ -48,7 +51,10 @@ This operation is performed by calling function `createFolderLock`. See the endpoint docs at [API Reference](https://developer.box.com/reference/post-folder-locks/). -*Currently we don't have an example for calling `createFolderLock` in integration tests* + +```ts +await client.folderLocks.createFolderLock({ folder: { id: folder.id, type: "folder" } satisfies CreateFolderLockRequestBodyArgFolderField, lockedOperations: { move: true, delete: true } satisfies CreateFolderLockRequestBodyArgLockedOperationsField } satisfies CreateFolderLockRequestBodyArg) +``` ### Arguments @@ -78,7 +84,10 @@ This operation is performed by calling function `deleteFolderLockById`. See the endpoint docs at [API Reference](https://developer.box.com/reference/delete-folder-locks-id/). -*Currently we don't have an example for calling `deleteFolderLockById` in integration tests* + +```ts +await client.folderLocks.deleteFolderLockById(folderLock.id) +``` ### Arguments diff --git a/docs/folderMetadata.md b/docs/folderMetadata.md index 045658f3..b44558b3 100644 --- a/docs/folderMetadata.md +++ b/docs/folderMetadata.md @@ -4,6 +4,7 @@ - [List metadata instances on folder](#list-metadata-instances-on-folder) - [Get metadata instance on folder](#get-metadata-instance-on-folder) - [Create metadata instance on folder](#create-metadata-instance-on-folder) +- [Update metadata instance on folder](#update-metadata-instance-on-folder) - [Remove metadata instance from folder](#remove-metadata-instance-from-folder) ## List metadata instances on folder @@ -110,6 +111,46 @@ Returns the instance of the template that was applied to the folder, including the data that was applied to the template. +## Update metadata instance on folder + +Updates a piece of metadata on a folder. + +The metadata instance can only be updated if the template has already been +applied to the folder before. When editing metadata, only values that match +the metadata template schema will be accepted. + +The update is applied atomically. If any errors occur during the +application of the operations, the metadata instance will not be changed. + +This operation is performed by calling function `updateFolderMetadataById`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-folders-id-metadata-id-id/). + +*Currently we don't have an example for calling `updateFolderMetadataById` in integration tests* + +### Arguments + +- folderId `string` + - The unique identifier that represent a folder. The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/folder/123` the `folder_id` is `123`. The root folder of a Box account is always represented by the ID `0`. Example: "12345" +- scope `UpdateFolderMetadataByIdScopeArg` + - The scope of the metadata template Example: "global" +- templateKey `string` + - The name of the metadata template Example: "properties" +- requestBody `readonly UpdateFolderMetadataByIdRequestBodyArg[]` + - Request body of updateFolderMetadataById method +- headers `UpdateFolderMetadataByIdHeadersArg` + - Headers of updateFolderMetadataById method + + +### Returns + +This function returns a value of type `Metadata`. + +Returns the updated metadata template instance, with the +custom template data included. + + ## Remove metadata instance from folder Deletes a piece of folder metadata. diff --git a/docs/metadataTemplates.md b/docs/metadataTemplates.md index 0936b006..b1f6094b 100644 --- a/docs/metadataTemplates.md +++ b/docs/metadataTemplates.md @@ -3,6 +3,7 @@ - [Find metadata template by instance ID](#find-metadata-template-by-instance-id) - [Get metadata template by name](#get-metadata-template-by-name) +- [Update metadata template](#update-metadata-template) - [Remove metadata template](#remove-metadata-template) - [Get metadata template by ID](#get-metadata-template-by-id) - [List all global metadata templates](#list-all-global-metadata-templates) @@ -49,7 +50,10 @@ This operation is performed by calling function `getMetadataTemplateSchema`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-metadata-templates-id-id-schema/). -*Currently we don't have an example for calling `getMetadataTemplateSchema` in integration tests* + +```ts +await client.metadataTemplates.getMetadataTemplateSchema("enterprise" as GetMetadataTemplateSchemaScopeArg, template.templateKey) +``` ### Arguments @@ -69,6 +73,43 @@ Returns the metadata template matching the `scope` and `template` name. +## Update metadata template + +Updates a metadata template. + +The metadata template can only be updated if the template +already exists. + +The update is applied atomically. If any errors occur during the +application of the operations, the metadata template will not be changed. + +This operation is performed by calling function `updateMetadataTemplateSchema`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-metadata-templates-id-id-schema/). + +*Currently we don't have an example for calling `updateMetadataTemplateSchema` in integration tests* + +### Arguments + +- scope `UpdateMetadataTemplateSchemaScopeArg` + - The scope of the metadata template Example: "global" +- templateKey `string` + - The name of the metadata template Example: "properties" +- requestBody `readonly UpdateMetadataTemplateSchemaRequestBodyArg[]` + - Request body of updateMetadataTemplateSchema method +- headers `UpdateMetadataTemplateSchemaHeadersArg` + - Headers of updateMetadataTemplateSchema method + + +### Returns + +This function returns a value of type `MetadataTemplate`. + +Returns the updated metadata template, with the +custom template data included. + + ## Remove metadata template Delete a metadata template and its instances. @@ -79,7 +120,10 @@ This operation is performed by calling function `deleteMetadataTemplateSchema`. See the endpoint docs at [API Reference](https://developer.box.com/reference/delete-metadata-templates-id-id-schema/). -*Currently we don't have an example for calling `deleteMetadataTemplateSchema` in integration tests* + +```ts +await client.metadataTemplates.deleteMetadataTemplateSchema("enterprise" as DeleteMetadataTemplateSchemaScopeArg, template.templateKey) +``` ### Arguments @@ -108,7 +152,10 @@ This operation is performed by calling function `getMetadataTemplateById`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-metadata-templates-id/). -*Currently we don't have an example for calling `getMetadataTemplateById` in integration tests* + +```ts +await client.metadataTemplates.getMetadataTemplateById(template.id) +``` ### Arguments @@ -135,7 +182,10 @@ This operation is performed by calling function `getMetadataTemplateGlobal`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-metadata-templates-global/). -*Currently we don't have an example for calling `getMetadataTemplateGlobal` in integration tests* + +```ts +await client.metadataTemplates.getMetadataTemplateGlobal() +``` ### Arguments @@ -163,7 +213,10 @@ This operation is performed by calling function `getMetadataTemplateEnterprise`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-metadata-templates-enterprise/). -*Currently we don't have an example for calling `getMetadataTemplateEnterprise` in integration tests* + +```ts +await client.metadataTemplates.getMetadataTemplateEnterprise() +``` ### Arguments @@ -191,7 +244,10 @@ This operation is performed by calling function `createMetadataTemplateSchema`. See the endpoint docs at [API Reference](https://developer.box.com/reference/post-metadata-templates-schema/). -*Currently we don't have an example for calling `createMetadataTemplateSchema` in integration tests* + +```ts +await client.metadataTemplates.createMetadataTemplateSchema({ scope: "enterprise", displayName: templateKey, templateKey: templateKey, fields: [{ type: "string", key: "testName", displayName: "testName" }] } satisfies CreateMetadataTemplateSchemaRequestBodyArg) +``` ### Arguments diff --git a/docs/recentItems.md b/docs/recentItems.md index ec1ac907..77f36bd6 100644 --- a/docs/recentItems.md +++ b/docs/recentItems.md @@ -14,7 +14,10 @@ This operation is performed by calling function `getRecentItems`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-recent-items/). -*Currently we don't have an example for calling `getRecentItems` in integration tests* + +```ts +await client.recentItems.getRecentItems() +``` ### Arguments diff --git a/docs/skills.md b/docs/skills.md index 968b2db0..a347e128 100644 --- a/docs/skills.md +++ b/docs/skills.md @@ -3,6 +3,7 @@ - [List Box Skill cards on file](#list-box-skill-cards-on-file) - [Create Box Skill cards on file](#create-box-skill-cards-on-file) +- [Update Box Skill cards on file](#update-box-skill-cards-on-file) - [Remove Box Skill cards from file](#remove-box-skill-cards-from-file) - [Update all Box Skill cards on file](#update-all-box-skill-cards-on-file) @@ -64,6 +65,35 @@ Returns the instance of the template that was applied to the file, including the data that was applied to the template. +## Update Box Skill cards on file + +Updates one or more Box Skills metadata cards to a file. + +This operation is performed by calling function `updateFileMetadataGlobalBoxSkillsCard`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/put-files-id-metadata-global-box-skills-cards/). + +*Currently we don't have an example for calling `updateFileMetadataGlobalBoxSkillsCard` in integration tests* + +### Arguments + +- fileId `string` + - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" +- requestBody `readonly UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg[]` + - Request body of updateFileMetadataGlobalBoxSkillsCard method +- headers `UpdateFileMetadataGlobalBoxSkillsCardHeadersArg` + - Headers of updateFileMetadataGlobalBoxSkillsCard method + + +### Returns + +This function returns a value of type `SkillCardsMetadata`. + +Returns the updated metadata template, with the +custom template data included. + + ## Remove Box Skill cards from file Removes any Box Skills cards metadata from a file. diff --git a/docs/trashedFiles.md b/docs/trashedFiles.md index 472020c3..ca6a93ec 100644 --- a/docs/trashedFiles.md +++ b/docs/trashedFiles.md @@ -17,7 +17,10 @@ This operation is performed by calling function `restoreFileFromTrash`. See the endpoint docs at [API Reference](https://developer.box.com/reference/post-files-id/). -*Currently we don't have an example for calling `restoreFileFromTrash` in integration tests* + +```ts +await client.trashedFiles.restoreFileFromTrash(file.id) +``` ### Arguments @@ -59,7 +62,7 @@ See the endpoint docs at ```ts -await client.trashedFiles.getFileTrash(uploadedFile.id) +await client.trashedFiles.getFileTrash(file.id) ``` ### Arguments @@ -91,7 +94,10 @@ This operation is performed by calling function `deleteFileTrash`. See the endpoint docs at [API Reference](https://developer.box.com/reference/delete-files-id-trash/). -*Currently we don't have an example for calling `deleteFileTrash` in integration tests* + +```ts +await client.trashedFiles.deleteFileTrash(file.id) +``` ### Arguments diff --git a/docs/trashedFolders.md b/docs/trashedFolders.md index e2d1b5c9..db62877f 100644 --- a/docs/trashedFolders.md +++ b/docs/trashedFolders.md @@ -26,7 +26,10 @@ This operation is performed by calling function `restoreFolderFromTrash`. See the endpoint docs at [API Reference](https://developer.box.com/reference/post-folders-id/). -*Currently we don't have an example for calling `restoreFolderFromTrash` in integration tests* + +```ts +await client.trashedFolders.restoreFolderFromTrash(folder.id) +``` ### Arguments @@ -66,7 +69,10 @@ This operation is performed by calling function `getFolderTrash`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-folders-id-trash/). -*Currently we don't have an example for calling `getFolderTrash` in integration tests* + +```ts +await client.trashedFolders.getFolderTrash(folder.id) +``` ### Arguments @@ -97,7 +103,10 @@ This operation is performed by calling function `deleteFolderTrash`. See the endpoint docs at [API Reference](https://developer.box.com/reference/delete-folders-id-trash/). -*Currently we don't have an example for calling `deleteFolderTrash` in integration tests* + +```ts +await client.trashedFolders.deleteFolderTrash(folder.id) +``` ### Arguments diff --git a/package.json b/package.json index 272a05b9..0d9f8865 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,29 @@ { - "name": "BoxSDK", - "version": "2.0.0", + "name": "box-typescript-sdk-gen", + "author": "Box ", + "version": "0.1.0", "description": "[Box Platform](https://box.dev) provides functionality to provide access to content stored within [Box](https://box.com). It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.", - "main": "dist/index.generated.js", + "keywords": [ + "box", + "sdk", + "api", + "rest", + "boxsdk" + ], + "engines": { + "node": ">=16.0.0" + }, + "main": "./lib/client.generated.js", "scripts": { "build": "tsc", "start": "echo \"Error: no start specified\" && exit 1", "test": "jest" }, - "author": "", - "license": "Apache-2.0, http://www.apache.org/licenses/LICENSE-2.0", + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/box/box-typescript-sdk-gen.git" + }, "dependencies": { "form-data": "^4.0.0", "jsonwebtoken": "^9.0.0", @@ -25,5 +39,8 @@ "jest": "^29.5.0", "ts-jest": "^29.1.0", "typescript": "*" - } + }, + "files": [ + "lib" + ] } \ No newline at end of file diff --git a/src/managers/avatars.generated.ts b/src/managers/avatars.generated.ts index a60106eb..65a4113d 100644 --- a/src/managers/avatars.generated.ts +++ b/src/managers/avatars.generated.ts @@ -61,7 +61,7 @@ export class AvatarsManager { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); - const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/users/", userId, "/avatar") as string, { method: "POST", headers: headersMap, multipartData: [{ partName: "pic", fileStream: requestBody.pic, contentType: requestBody.picContentType, fileName: requestBody.picFileName } satisfies MultipartItem], contentType: "multipart/form-data", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/users/", userId, "/avatar") as string, { method: "POST", headers: headersMap, multipartData: [{ partName: "pic", fileStream: requestBody.pic, fileName: requestBody.picFileName, contentType: requestBody.picContentType } satisfies MultipartItem], contentType: "multipart/form-data", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeUserAvatar(deserializeJson(response.text)); } async deleteUserAvatar(userId: string, headers: DeleteUserAvatarHeadersArg = new DeleteUserAvatarHeadersArg({})): Promise { diff --git a/src/managers/chunkedUploads.generated.ts b/src/managers/chunkedUploads.generated.ts index 9f98cbff..7c0d8bf6 100644 --- a/src/managers/chunkedUploads.generated.ts +++ b/src/managers/chunkedUploads.generated.ts @@ -25,8 +25,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; +import { Json } from "../json.js"; import { isJson } from "../json.js"; export interface CreateFileUploadSessionRequestBodyArg { readonly folderId: string; @@ -174,11 +174,11 @@ export function deserializeCreateFileUploadSessionRequestBodyArg(val: any): Crea return { folderId: folderId, fileSize: fileSize, fileName: fileName } satisfies CreateFileUploadSessionRequestBodyArg; } export function serializeCreateFileUploadSessionForExistingFileRequestBodyArg(val: CreateFileUploadSessionForExistingFileRequestBodyArg): Json { - return { ["file_size"]: val.fileSize, ["file_name"]: val.fileName }; + return { ["file_size"]: val.fileSize, ["file_name"]: val.fileName == void 0 ? void 0 : val.fileName }; } export function deserializeCreateFileUploadSessionForExistingFileRequestBodyArg(val: any): CreateFileUploadSessionForExistingFileRequestBodyArg { const fileSize: number = val.file_size; - const fileName: undefined | string = isJson(val.file_name, "string") ? val.file_name : void 0; + const fileName: undefined | string = val.file_name == void 0 ? void 0 : val.file_name; return { fileSize: fileSize, fileName: fileName } satisfies CreateFileUploadSessionForExistingFileRequestBodyArg; } export function serializeCreateFileUploadSessionCommitRequestBodyArg(val: CreateFileUploadSessionCommitRequestBodyArg): Json { @@ -187,8 +187,8 @@ export function serializeCreateFileUploadSessionCommitRequestBodyArg(val: Create }) as readonly any[] }; } export function deserializeCreateFileUploadSessionCommitRequestBodyArg(val: any): CreateFileUploadSessionCommitRequestBodyArg { - const parts: readonly UploadPart[] = val.parts.map(function (itm: Json): any { + const parts: readonly UploadPart[] = isJson(val.parts, "array") ? val.parts.map(function (itm: Json): any { return deserializeUploadPart(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { parts: parts } satisfies CreateFileUploadSessionCommitRequestBodyArg; } diff --git a/src/managers/classifications.generated.ts b/src/managers/classifications.generated.ts index f77f4cec..43187bc4 100644 --- a/src/managers/classifications.generated.ts +++ b/src/managers/classifications.generated.ts @@ -32,6 +32,62 @@ export class DeleteMetadataTemplateEnterpriseSecurityClassificationSchemaHeaders Object.assign(this, fields); } } +export interface UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField { + readonly classificationDefinition?: string; + readonly colorId?: number; +} +export interface UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField { + readonly key: string; + readonly classification?: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField; +} +export interface UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg { + readonly op: string; + readonly fieldKey: string; + readonly data: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField; +} +export class UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddHeadersArg) { + Object.assign(this, fields); + } +} +export interface UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField { + readonly classificationDefinition?: string; + readonly colorId?: number; +} +export interface UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField { + readonly key: string; + readonly classification?: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField; +} +export interface UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg { + readonly op: string; + readonly fieldKey: string; + readonly enumOptionKey: string; + readonly data: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField; +} +export class UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateHeadersArg) { + Object.assign(this, fields); + } +} +export interface UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg { + readonly op: string; + readonly fieldKey: string; + readonly enumOptionKey: string; +} +export class UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteHeadersArg) { + Object.assign(this, fields); + } +} export type CreateMetadataTemplateSchemaClassificationRequestBodyArgScopeField = "enterprise"; export type CreateMetadataTemplateSchemaClassificationRequestBodyArgTemplateKeyField = "securityClassification-6VMVochwUWo"; export type CreateMetadataTemplateSchemaClassificationRequestBodyArgDisplayNameField = "Classification"; @@ -75,7 +131,7 @@ export class CreateMetadataTemplateSchemaClassificationHeadersArg { export class ClassificationsManager { readonly auth?: Authentication; readonly networkSession?: NetworkSession; - constructor(fields: Omit) { + constructor(fields: Omit) { Object.assign(this, fields); } async getMetadataTemplateEnterpriseSecurityClassificationSchema(headers: GetMetadataTemplateEnterpriseSecurityClassificationSchemaHeadersArg = new GetMetadataTemplateEnterpriseSecurityClassificationSchemaHeadersArg({})): Promise { @@ -92,6 +148,27 @@ export class ClassificationsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema") as string, { method: "DELETE", headers: headersMap, responseFormat: void 0, auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return void 0; } + async updateMetadataTemplateEnterpriseSecurityClassificationSchemaAdd(requestBody: readonly UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg[], headers: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddHeadersArg = new UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#add") as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeClassificationTemplate(deserializeJson(response.text)); + } + async updateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdate(requestBody: readonly UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg[], headers: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateHeadersArg = new UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#update") as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeClassificationTemplate(deserializeJson(response.text)); + } + async updateMetadataTemplateEnterpriseSecurityClassificationSchemaDelete(requestBody: readonly UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg[], headers: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteHeadersArg = new UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#delete") as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeClassificationTemplate(deserializeJson(response.text)); + } async createMetadataTemplateSchemaClassification(requestBody: CreateMetadataTemplateSchemaClassificationRequestBodyArg, headers: CreateMetadataTemplateSchemaClassificationHeadersArg = new CreateMetadataTemplateSchemaClassificationHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; @@ -100,6 +177,66 @@ export class ClassificationsManager { return deserializeClassificationTemplate(deserializeJson(response.text)); } } +export function serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField(val: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField): Json { + return { ["classificationDefinition"]: val.classificationDefinition == void 0 ? void 0 : val.classificationDefinition, ["colorID"]: val.colorId == void 0 ? void 0 : val.colorId }; +} +export function deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField(val: any): UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField { + const classificationDefinition: undefined | string = val.classificationDefinition == void 0 ? void 0 : val.classificationDefinition; + const colorId: undefined | number = val.colorID == void 0 ? void 0 : val.colorID; + return { classificationDefinition: classificationDefinition, colorId: colorId } satisfies UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField; +} +export function serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField(val: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField): Json { + return { ["key"]: val.key, ["classification"]: val.classification == void 0 ? void 0 : serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField(val.classification) }; +} +export function deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField(val: any): UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField { + const key: string = val.key; + const classification: undefined | UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField = val.classification == void 0 ? void 0 : deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataFieldClassificationField(val.classification); + return { key: key, classification: classification } satisfies UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField; +} +export function serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg(val: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg): Json { + return { ["op"]: val.op, ["fieldKey"]: val.fieldKey, ["data"]: serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField(val.data) }; +} +export function deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg(val: any): UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg { + const op: string = val.op; + const fieldKey: string = val.fieldKey; + const data: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField = deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArgDataField(val.data); + return { op: op, fieldKey: fieldKey, data: data } satisfies UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaAddRequestBodyArg; +} +export function serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField(val: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField): Json { + return { ["classificationDefinition"]: val.classificationDefinition == void 0 ? void 0 : val.classificationDefinition, ["colorID"]: val.colorId == void 0 ? void 0 : val.colorId }; +} +export function deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField(val: any): UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField { + const classificationDefinition: undefined | string = val.classificationDefinition == void 0 ? void 0 : val.classificationDefinition; + const colorId: undefined | number = val.colorID == void 0 ? void 0 : val.colorID; + return { classificationDefinition: classificationDefinition, colorId: colorId } satisfies UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField; +} +export function serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField(val: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField): Json { + return { ["key"]: val.key, ["classification"]: val.classification == void 0 ? void 0 : serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField(val.classification) }; +} +export function deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField(val: any): UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField { + const key: string = val.key; + const classification: undefined | UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField = val.classification == void 0 ? void 0 : deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataFieldClassificationField(val.classification); + return { key: key, classification: classification } satisfies UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField; +} +export function serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg(val: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg): Json { + return { ["op"]: val.op, ["fieldKey"]: val.fieldKey, ["enumOptionKey"]: val.enumOptionKey, ["data"]: serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField(val.data) }; +} +export function deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg(val: any): UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg { + const op: string = val.op; + const fieldKey: string = val.fieldKey; + const enumOptionKey: string = val.enumOptionKey; + const data: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField = deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArgDataField(val.data); + return { op: op, fieldKey: fieldKey, enumOptionKey: enumOptionKey, data: data } satisfies UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaUpdateRequestBodyArg; +} +export function serializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg(val: UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg): Json { + return { ["op"]: val.op, ["fieldKey"]: val.fieldKey, ["enumOptionKey"]: val.enumOptionKey }; +} +export function deserializeUpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg(val: any): UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg { + const op: string = val.op; + const fieldKey: string = val.fieldKey; + const enumOptionKey: string = val.enumOptionKey; + return { op: op, fieldKey: fieldKey, enumOptionKey: enumOptionKey } satisfies UpdateMetadataTemplateEnterpriseSecurityClassificationSchemaDeleteRequestBodyArg; +} export function serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgScopeField(val: CreateMetadataTemplateSchemaClassificationRequestBodyArgScopeField): Json { return val; } @@ -173,11 +310,11 @@ export function deserializeCreateMetadataTemplateSchemaClassificationRequestBody throw "".concat("Invalid value: ", val) as string; } export function serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigFieldClassificationField(val: CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigFieldClassificationField): Json { - return { ["classificationDefinition"]: val.classificationDefinition, ["colorID"]: val.colorId }; + return { ["classificationDefinition"]: val.classificationDefinition == void 0 ? void 0 : val.classificationDefinition, ["colorID"]: val.colorId == void 0 ? void 0 : val.colorId }; } export function deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigFieldClassificationField(val: any): CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigFieldClassificationField { - const classificationDefinition: undefined | string = isJson(val.classificationDefinition, "string") ? val.classificationDefinition : void 0; - const colorId: undefined | number = isJson(val.colorID, "number") ? val.colorID : void 0; + const classificationDefinition: undefined | string = val.classificationDefinition == void 0 ? void 0 : val.classificationDefinition; + const colorId: undefined | number = val.colorID == void 0 ? void 0 : val.colorID; return { classificationDefinition: classificationDefinition, colorId: colorId } satisfies CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigFieldClassificationField; } export function serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigField(val: CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigField): Json { @@ -188,15 +325,15 @@ export function deserializeCreateMetadataTemplateSchemaClassificationRequestBody return { classification: classification } satisfies CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigField; } export function serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField(val: CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField): Json { - return { ["key"]: val.key, ["staticConfig"]: val.staticConfig == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigField(val.staticConfig) }; + return { ["key"]: val.key == void 0 ? void 0 : val.key, ["staticConfig"]: val.staticConfig == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigField(val.staticConfig) }; } export function deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField(val: any): CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField { - const key: undefined | string = isJson(val.key, "string") ? val.key : void 0; + const key: undefined | string = val.key == void 0 ? void 0 : val.key; const staticConfig: undefined | CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigField = val.staticConfig == void 0 ? void 0 : deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsFieldStaticConfigField(val.staticConfig); return { key: key, staticConfig: staticConfig } satisfies CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField; } export function serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField(val: CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldTypeField(val.type), ["key"]: val.key == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldKeyField(val.key), ["displayName"]: val.displayName == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldDisplayNameField(val.displayName), ["hidden"]: val.hidden, ["options"]: val.options == void 0 ? void 0 : val.options.map(function (item: CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField): any { + return { ["type"]: val.type == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldTypeField(val.type), ["key"]: val.key == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldKeyField(val.key), ["displayName"]: val.displayName == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldDisplayNameField(val.displayName), ["hidden"]: val.hidden == void 0 ? void 0 : val.hidden, ["options"]: val.options == void 0 ? void 0 : val.options.map(function (item: CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField): any { return serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField(item); }) as readonly any[] }; } @@ -204,14 +341,14 @@ export function deserializeCreateMetadataTemplateSchemaClassificationRequestBody const type: undefined | CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldTypeField(val.type); const key: undefined | CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldKeyField = val.key == void 0 ? void 0 : deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldKeyField(val.key); const displayName: undefined | CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldDisplayNameField = val.displayName == void 0 ? void 0 : deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldDisplayNameField(val.displayName); - const hidden: undefined | boolean = isJson(val.hidden, "boolean") ? val.hidden : void 0; - const options: undefined | readonly CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField[] = isJson(val.options, "array") ? val.options.map(function (itm: Json): any { + const hidden: undefined | boolean = val.hidden == void 0 ? void 0 : val.hidden; + const options: undefined | readonly CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField[] = val.options == void 0 ? void 0 : isJson(val.options, "array") ? val.options.map(function (itm: Json): any { return deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsFieldOptionsField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { type: type, key: key, displayName: displayName, hidden: hidden, options: options } satisfies CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField; } export function serializeCreateMetadataTemplateSchemaClassificationRequestBodyArg(val: CreateMetadataTemplateSchemaClassificationRequestBodyArg): Json { - return { ["scope"]: serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgScopeField(val.scope), ["templateKey"]: val.templateKey == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgTemplateKeyField(val.templateKey), ["displayName"]: serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgDisplayNameField(val.displayName), ["hidden"]: val.hidden, ["copyInstanceOnItemCopy"]: val.copyInstanceOnItemCopy, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField): any { + return { ["scope"]: serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgScopeField(val.scope), ["templateKey"]: val.templateKey == void 0 ? void 0 : serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgTemplateKeyField(val.templateKey), ["displayName"]: serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgDisplayNameField(val.displayName), ["hidden"]: val.hidden == void 0 ? void 0 : val.hidden, ["copyInstanceOnItemCopy"]: val.copyInstanceOnItemCopy == void 0 ? void 0 : val.copyInstanceOnItemCopy, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField): any { return serializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField(item); }) as readonly any[] }; } @@ -219,10 +356,10 @@ export function deserializeCreateMetadataTemplateSchemaClassificationRequestBody const scope: CreateMetadataTemplateSchemaClassificationRequestBodyArgScopeField = deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgScopeField(val.scope); const templateKey: undefined | CreateMetadataTemplateSchemaClassificationRequestBodyArgTemplateKeyField = val.templateKey == void 0 ? void 0 : deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgTemplateKeyField(val.templateKey); const displayName: CreateMetadataTemplateSchemaClassificationRequestBodyArgDisplayNameField = deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgDisplayNameField(val.displayName); - const hidden: undefined | boolean = isJson(val.hidden, "boolean") ? val.hidden : void 0; - const copyInstanceOnItemCopy: undefined | boolean = isJson(val.copyInstanceOnItemCopy, "boolean") ? val.copyInstanceOnItemCopy : void 0; - const fields: undefined | readonly CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField[] = isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { + const hidden: undefined | boolean = val.hidden == void 0 ? void 0 : val.hidden; + const copyInstanceOnItemCopy: undefined | boolean = val.copyInstanceOnItemCopy == void 0 ? void 0 : val.copyInstanceOnItemCopy; + const fields: undefined | readonly CreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField[] = val.fields == void 0 ? void 0 : isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { return deserializeCreateMetadataTemplateSchemaClassificationRequestBodyArgFieldsField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { scope: scope, templateKey: templateKey, displayName: displayName, hidden: hidden, copyInstanceOnItemCopy: copyInstanceOnItemCopy, fields: fields } satisfies CreateMetadataTemplateSchemaClassificationRequestBodyArg; } diff --git a/src/managers/comments.generated.ts b/src/managers/comments.generated.ts index 260d0f1e..9329bec3 100644 --- a/src/managers/comments.generated.ts +++ b/src/managers/comments.generated.ts @@ -115,7 +115,7 @@ export class CommentsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/comments/", commentId) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeCommentFull(deserializeJson(response.text)); } - async updateCommentById(commentId: string, requestBody: UpdateCommentByIdRequestBodyArg, queryParams: UpdateCommentByIdQueryParamsArg = {} satisfies UpdateCommentByIdQueryParamsArg, headers: UpdateCommentByIdHeadersArg = new UpdateCommentByIdHeadersArg({})): Promise { + async updateCommentById(commentId: string, requestBody: UpdateCommentByIdRequestBodyArg = {} satisfies UpdateCommentByIdRequestBodyArg, queryParams: UpdateCommentByIdQueryParamsArg = {} satisfies UpdateCommentByIdQueryParamsArg, headers: UpdateCommentByIdHeadersArg = new UpdateCommentByIdHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -144,10 +144,10 @@ export class CommentsManager { } } export function serializeUpdateCommentByIdRequestBodyArg(val: UpdateCommentByIdRequestBodyArg): Json { - return { ["message"]: val.message }; + return { ["message"]: val.message == void 0 ? void 0 : val.message }; } export function deserializeUpdateCommentByIdRequestBodyArg(val: any): UpdateCommentByIdRequestBodyArg { - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; return { message: message } satisfies UpdateCommentByIdRequestBodyArg; } export function serializeCreateCommentRequestBodyArgItemFieldTypeField(val: CreateCommentRequestBodyArgItemFieldTypeField): Json { @@ -174,11 +174,11 @@ export function deserializeCreateCommentRequestBodyArgItemField(val: any): Creat return { id: id, type: type } satisfies CreateCommentRequestBodyArgItemField; } export function serializeCreateCommentRequestBodyArg(val: CreateCommentRequestBodyArg): Json { - return { ["message"]: val.message, ["tagged_message"]: val.taggedMessage, ["item"]: serializeCreateCommentRequestBodyArgItemField(val.item) }; + return { ["message"]: val.message, ["tagged_message"]: val.taggedMessage == void 0 ? void 0 : val.taggedMessage, ["item"]: serializeCreateCommentRequestBodyArgItemField(val.item) }; } export function deserializeCreateCommentRequestBodyArg(val: any): CreateCommentRequestBodyArg { const message: string = val.message; - const taggedMessage: undefined | string = isJson(val.tagged_message, "string") ? val.tagged_message : void 0; + const taggedMessage: undefined | string = val.tagged_message == void 0 ? void 0 : val.tagged_message; const item: CreateCommentRequestBodyArgItemField = deserializeCreateCommentRequestBodyArgItemField(val.item); return { message: message, taggedMessage: taggedMessage, item: item } satisfies CreateCommentRequestBodyArg; } diff --git a/src/managers/fileClassifications.generated.ts b/src/managers/fileClassifications.generated.ts index 3140084c..37e0977f 100644 --- a/src/managers/fileClassifications.generated.ts +++ b/src/managers/fileClassifications.generated.ts @@ -35,6 +35,21 @@ export class CreateFileMetadataEnterpriseSecurityClassificationHeadersArg { Object.assign(this, fields); } } +export type UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField = "replace"; +export type UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField = "/Box__Security__Classification__Key"; +export interface UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg { + readonly op?: UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField; + readonly path?: UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField; + readonly value?: string; +} +export class UpdateFileMetadataEnterpriseSecurityClassificationHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateFileMetadataEnterpriseSecurityClassificationHeadersArg) { + Object.assign(this, fields); + } +} export class DeleteFileMetadataEnterpriseSecurityClassificationHeadersArg { readonly extraHeaders?: { readonly [key: string]: undefined | string; @@ -46,7 +61,7 @@ export class DeleteFileMetadataEnterpriseSecurityClassificationHeadersArg { export class FileClassificationsManager { readonly auth?: Authentication; readonly networkSession?: NetworkSession; - constructor(fields: Omit) { + constructor(fields: Omit) { Object.assign(this, fields); } async getFileMetadataEnterpriseSecurityClassification6VmVochwUWo(fileId: string, headers: GetFileMetadataEnterpriseSecurityClassification6VmVochwUWoHeadersArg = new GetFileMetadataEnterpriseSecurityClassification6VmVochwUWoHeadersArg({})): Promise { @@ -56,13 +71,20 @@ export class FileClassificationsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/metadata/enterprise/securityClassification-6VMVochwUWo") as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeClassification(deserializeJson(response.text)); } - async createFileMetadataEnterpriseSecurityClassification(fileId: string, requestBody: CreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg, headers: CreateFileMetadataEnterpriseSecurityClassificationHeadersArg = new CreateFileMetadataEnterpriseSecurityClassificationHeadersArg({})): Promise { + async createFileMetadataEnterpriseSecurityClassification(fileId: string, requestBody: CreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg = {} satisfies CreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg, headers: CreateFileMetadataEnterpriseSecurityClassificationHeadersArg = new CreateFileMetadataEnterpriseSecurityClassificationHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/metadata/enterprise/securityClassification-6VMVochwUWo") as string, { method: "POST", headers: headersMap, body: serializeJson(serializeCreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeClassification(deserializeJson(response.text)); } + async updateFileMetadataEnterpriseSecurityClassification(fileId: string, requestBody: readonly UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg[], headers: UpdateFileMetadataEnterpriseSecurityClassificationHeadersArg = new UpdateFileMetadataEnterpriseSecurityClassificationHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/metadata/enterprise/securityClassification-6VMVochwUWo") as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeClassification(deserializeJson(response.text)); + } async deleteFileMetadataEnterpriseSecurityClassification(fileId: string, headers: DeleteFileMetadataEnterpriseSecurityClassificationHeadersArg = new DeleteFileMetadataEnterpriseSecurityClassificationHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; @@ -72,9 +94,42 @@ export class FileClassificationsManager { } } export function serializeCreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg(val: CreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg): Json { - return { ["Box__Security__Classification__Key"]: val.boxSecurityClassificationKey }; + return { ["Box__Security__Classification__Key"]: val.boxSecurityClassificationKey == void 0 ? void 0 : val.boxSecurityClassificationKey }; } export function deserializeCreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg(val: any): CreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg { - const boxSecurityClassificationKey: undefined | string = isJson(val.Box__Security__Classification__Key, "string") ? val.Box__Security__Classification__Key : void 0; + const boxSecurityClassificationKey: undefined | string = val.Box__Security__Classification__Key == void 0 ? void 0 : val.Box__Security__Classification__Key; return { boxSecurityClassificationKey: boxSecurityClassificationKey } satisfies CreateFileMetadataEnterpriseSecurityClassificationRequestBodyArg; } +export function serializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField(val: UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField): Json { + return val; +} +export function deserializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField(val: any): UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField\""; + } + if (val == "replace") { + return "replace"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField(val: UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField): Json { + return val; +} +export function deserializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField(val: any): UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField\""; + } + if (val == "/Box__Security__Classification__Key") { + return "/Box__Security__Classification__Key"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg(val: UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg): Json { + return { ["op"]: val.op == void 0 ? void 0 : serializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField(val.op), ["path"]: val.path == void 0 ? void 0 : serializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField(val.path), ["value"]: val.value == void 0 ? void 0 : val.value }; +} +export function deserializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg(val: any): UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg { + const op: undefined | UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField = val.op == void 0 ? void 0 : deserializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgOpField(val.op); + const path: undefined | UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField = val.path == void 0 ? void 0 : deserializeUpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArgPathField(val.path); + const value: undefined | string = val.value == void 0 ? void 0 : val.value; + return { op: op, path: path, value: value } satisfies UpdateFileMetadataEnterpriseSecurityClassificationRequestBodyArg; +} diff --git a/src/managers/fileMetadata.generated.ts b/src/managers/fileMetadata.generated.ts index cf5b0c41..39678394 100644 --- a/src/managers/fileMetadata.generated.ts +++ b/src/managers/fileMetadata.generated.ts @@ -40,8 +40,9 @@ export class GetFileMetadataByIdHeadersArg { } } export type CreateFileMetadataByIdScopeArg = "global" | "enterprise"; -export interface CreateFileMetadataByIdRequestBodyArg { -} +export type CreateFileMetadataByIdRequestBodyArg = { + readonly [key: string]: string; +}; export class CreateFileMetadataByIdHeadersArg { readonly extraHeaders?: { readonly [key: string]: undefined | string; @@ -50,6 +51,22 @@ export class CreateFileMetadataByIdHeadersArg { Object.assign(this, fields); } } +export type UpdateFileMetadataByIdScopeArg = "global" | "enterprise"; +export type UpdateFileMetadataByIdRequestBodyArgOpField = "add" | "replace" | "remove" | "test" | "move" | "copy"; +export interface UpdateFileMetadataByIdRequestBodyArg { + readonly op?: UpdateFileMetadataByIdRequestBodyArgOpField; + readonly path?: string; + readonly value?: string; + readonly from?: string; +} +export class UpdateFileMetadataByIdHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateFileMetadataByIdHeadersArg) { + Object.assign(this, fields); + } +} export type DeleteFileMetadataByIdScopeArg = "global" | "enterprise"; export class DeleteFileMetadataByIdHeadersArg { readonly extraHeaders?: { @@ -62,7 +79,7 @@ export class DeleteFileMetadataByIdHeadersArg { export class FileMetadataManager { readonly auth?: Authentication; readonly networkSession?: NetworkSession; - constructor(fields: Omit) { + constructor(fields: Omit) { Object.assign(this, fields); } async getFileMetadata(fileId: string, headers: GetFileMetadataHeadersArg = new GetFileMetadataHeadersArg({})): Promise { @@ -86,6 +103,13 @@ export class FileMetadataManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/metadata/", scope, "/", templateKey) as string, { method: "POST", headers: headersMap, body: serializeJson(serializeCreateFileMetadataByIdRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeMetadata(deserializeJson(response.text)); } + async updateFileMetadataById(fileId: string, scope: UpdateFileMetadataByIdScopeArg, templateKey: string, requestBody: readonly UpdateFileMetadataByIdRequestBodyArg[], headers: UpdateFileMetadataByIdHeadersArg = new UpdateFileMetadataByIdHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/metadata/", scope, "/", templateKey) as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateFileMetadataByIdRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeMetadata(deserializeJson(response.text)); + } async deleteFileMetadataById(fileId: string, scope: DeleteFileMetadataByIdScopeArg, templateKey: string, headers: DeleteFileMetadataByIdHeadersArg = new DeleteFileMetadataByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; @@ -125,10 +149,62 @@ export function deserializeCreateFileMetadataByIdScopeArg(val: any): CreateFileM throw "".concat("Invalid value: ", val) as string; } export function serializeCreateFileMetadataByIdRequestBodyArg(val: CreateFileMetadataByIdRequestBodyArg): Json { - return {}; + return val; } export function deserializeCreateFileMetadataByIdRequestBodyArg(val: any): CreateFileMetadataByIdRequestBodyArg { - return {} satisfies CreateFileMetadataByIdRequestBodyArg; + return val; +} +export function serializeUpdateFileMetadataByIdScopeArg(val: UpdateFileMetadataByIdScopeArg): Json { + return val; +} +export function deserializeUpdateFileMetadataByIdScopeArg(val: any): UpdateFileMetadataByIdScopeArg { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFileMetadataByIdScopeArg\""; + } + if (val == "global") { + return "global"; + } + if (val == "enterprise") { + return "enterprise"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFileMetadataByIdRequestBodyArgOpField(val: UpdateFileMetadataByIdRequestBodyArgOpField): Json { + return val; +} +export function deserializeUpdateFileMetadataByIdRequestBodyArgOpField(val: any): UpdateFileMetadataByIdRequestBodyArgOpField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFileMetadataByIdRequestBodyArgOpField\""; + } + if (val == "add") { + return "add"; + } + if (val == "replace") { + return "replace"; + } + if (val == "remove") { + return "remove"; + } + if (val == "test") { + return "test"; + } + if (val == "move") { + return "move"; + } + if (val == "copy") { + return "copy"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFileMetadataByIdRequestBodyArg(val: UpdateFileMetadataByIdRequestBodyArg): Json { + return { ["op"]: val.op == void 0 ? void 0 : serializeUpdateFileMetadataByIdRequestBodyArgOpField(val.op), ["path"]: val.path == void 0 ? void 0 : val.path, ["value"]: val.value == void 0 ? void 0 : val.value, ["from"]: val.from == void 0 ? void 0 : val.from }; +} +export function deserializeUpdateFileMetadataByIdRequestBodyArg(val: any): UpdateFileMetadataByIdRequestBodyArg { + const op: undefined | UpdateFileMetadataByIdRequestBodyArgOpField = val.op == void 0 ? void 0 : deserializeUpdateFileMetadataByIdRequestBodyArgOpField(val.op); + const path: undefined | string = val.path == void 0 ? void 0 : val.path; + const value: undefined | string = val.value == void 0 ? void 0 : val.value; + const from: undefined | string = val.from == void 0 ? void 0 : val.from; + return { op: op, path: path, value: value, from: from } satisfies UpdateFileMetadataByIdRequestBodyArg; } export function serializeDeleteFileMetadataByIdScopeArg(val: DeleteFileMetadataByIdScopeArg): Json { return val; diff --git a/src/managers/fileVersions.generated.ts b/src/managers/fileVersions.generated.ts index ae5e23fa..83a5c821 100644 --- a/src/managers/fileVersions.generated.ts +++ b/src/managers/fileVersions.generated.ts @@ -105,7 +105,7 @@ export class FileVersionsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/versions/", fileVersionId) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFileVersionFull(deserializeJson(response.text)); } - async updateFileVersionById(fileId: string, fileVersionId: string, requestBody: UpdateFileVersionByIdRequestBodyArg, headers: UpdateFileVersionByIdHeadersArg = new UpdateFileVersionByIdHeadersArg({})): Promise { + async updateFileVersionById(fileId: string, fileVersionId: string, requestBody: UpdateFileVersionByIdRequestBodyArg = {} satisfies UpdateFileVersionByIdRequestBodyArg, headers: UpdateFileVersionByIdHeadersArg = new UpdateFileVersionByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -119,7 +119,7 @@ export class FileVersionsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/versions/", fileVersionId) as string, { method: "DELETE", headers: headersMap, responseFormat: void 0, auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return void 0; } - async promoteFileVersion(fileId: string, requestBody: PromoteFileVersionRequestBodyArg, queryParams: PromoteFileVersionQueryParamsArg = {} satisfies PromoteFileVersionQueryParamsArg, headers: PromoteFileVersionHeadersArg = new PromoteFileVersionHeadersArg({})): Promise { + async promoteFileVersion(fileId: string, requestBody: PromoteFileVersionRequestBodyArg = {} satisfies PromoteFileVersionRequestBodyArg, queryParams: PromoteFileVersionQueryParamsArg = {} satisfies PromoteFileVersionQueryParamsArg, headers: PromoteFileVersionHeadersArg = new PromoteFileVersionHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -131,10 +131,10 @@ export class FileVersionsManager { } } export function serializeUpdateFileVersionByIdRequestBodyArg(val: UpdateFileVersionByIdRequestBodyArg): Json { - return { ["trashed_at"]: val.trashedAt }; + return { ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt }; } export function deserializeUpdateFileVersionByIdRequestBodyArg(val: any): UpdateFileVersionByIdRequestBodyArg { - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; return { trashedAt: trashedAt } satisfies UpdateFileVersionByIdRequestBodyArg; } export function serializePromoteFileVersionRequestBodyArgTypeField(val: PromoteFileVersionRequestBodyArgTypeField): Json { @@ -150,10 +150,10 @@ export function deserializePromoteFileVersionRequestBodyArgTypeField(val: any): throw "".concat("Invalid value: ", val) as string; } export function serializePromoteFileVersionRequestBodyArg(val: PromoteFileVersionRequestBodyArg): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializePromoteFileVersionRequestBodyArgTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializePromoteFileVersionRequestBodyArgTypeField(val.type) }; } export function deserializePromoteFileVersionRequestBodyArg(val: any): PromoteFileVersionRequestBodyArg { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | PromoteFileVersionRequestBodyArgTypeField = val.type == void 0 ? void 0 : deserializePromoteFileVersionRequestBodyArgTypeField(val.type); return { id: id, type: type } satisfies PromoteFileVersionRequestBodyArg; } diff --git a/src/managers/files.generated.ts b/src/managers/files.generated.ts index 2b2b5b43..b8848b9f 100644 --- a/src/managers/files.generated.ts +++ b/src/managers/files.generated.ts @@ -140,7 +140,7 @@ export class FilesManager { 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; return deserializeFileFull(deserializeJson(response.text)); } - async updateFileById(fileId: string, requestBody: UpdateFileByIdRequestBodyArg, queryParams: UpdateFileByIdQueryParamsArg = {} satisfies UpdateFileByIdQueryParamsArg, headers: UpdateFileByIdHeadersArg = new UpdateFileByIdHeadersArg({})): Promise { + async updateFileById(fileId: string, requestBody: UpdateFileByIdRequestBodyArg = {} satisfies UpdateFileByIdRequestBodyArg, queryParams: UpdateFileByIdQueryParamsArg = {} satisfies UpdateFileByIdQueryParamsArg, headers: UpdateFileByIdHeadersArg = new UpdateFileByIdHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -179,10 +179,10 @@ export class FilesManager { } } export function serializeUpdateFileByIdRequestBodyArgParentField(val: UpdateFileByIdRequestBodyArgParentField): Json { - return { ["id"]: val.id }; + return { ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeUpdateFileByIdRequestBodyArgParentField(val: any): UpdateFileByIdRequestBodyArgParentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { id: id } satisfies UpdateFileByIdRequestBodyArgParentField; } export function serializeUpdateFileByIdRequestBodyArgSharedLinkFieldAccessField(val: UpdateFileByIdRequestBodyArgSharedLinkFieldAccessField): Json { @@ -204,20 +204,20 @@ export function deserializeUpdateFileByIdRequestBodyArgSharedLinkFieldAccessFiel throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField): Json { - return { ["can_download"]: val.canDownload }; + return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload }; } export function deserializeUpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField { - const canDownload: undefined | boolean = isJson(val.can_download, "boolean") ? val.can_download : void 0; + const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download; return { canDownload: canDownload } satisfies UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField; } export function serializeUpdateFileByIdRequestBodyArgSharedLinkField(val: UpdateFileByIdRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; + 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) }; } export function deserializeUpdateFileByIdRequestBodyArgSharedLinkField(val: any): UpdateFileByIdRequestBodyArgSharedLinkField { const access: undefined | UpdateFileByIdRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const permissions: undefined | UpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgSharedLinkFieldPermissionsField(val.permissions); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateFileByIdRequestBodyArgSharedLinkField; } @@ -234,12 +234,12 @@ export function deserializeUpdateFileByIdRequestBodyArgLockFieldAccessField(val: throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateFileByIdRequestBodyArgLockField(val: UpdateFileByIdRequestBodyArgLockField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgLockFieldAccessField(val.access), ["expires_at"]: val.expiresAt, ["is_download_prevented"]: val.isDownloadPrevented }; + 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 }; } export function deserializeUpdateFileByIdRequestBodyArgLockField(val: any): UpdateFileByIdRequestBodyArgLockField { const access: undefined | UpdateFileByIdRequestBodyArgLockFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgLockFieldAccessField(val.access); - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; - const isDownloadPrevented: undefined | boolean = isJson(val.is_download_prevented, "boolean") ? val.is_download_prevented : void 0; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; + const isDownloadPrevented: undefined | boolean = val.is_download_prevented == void 0 ? void 0 : val.is_download_prevented; return { access: access, expiresAt: expiresAt, isDownloadPrevented: isDownloadPrevented } satisfies UpdateFileByIdRequestBodyArgLockField; } export function serializeUpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField(val: UpdateFileByIdRequestBodyArgPermissionsFieldCanDownloadField): Json { @@ -265,34 +265,34 @@ export function deserializeUpdateFileByIdRequestBodyArgPermissionsField(val: any return { canDownload: canDownload } satisfies UpdateFileByIdRequestBodyArgPermissionsField; } export function serializeUpdateFileByIdRequestBodyArgCollectionsField(val: UpdateFileByIdRequestBodyArgCollectionsField): Json { - return { ["id"]: val.id, ["type"]: val.type }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : val.type }; } export function deserializeUpdateFileByIdRequestBodyArgCollectionsField(val: any): UpdateFileByIdRequestBodyArgCollectionsField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; return { id: id, type: type } satisfies UpdateFileByIdRequestBodyArgCollectionsField; } export function serializeUpdateFileByIdRequestBodyArg(val: UpdateFileByIdRequestBodyArg): Json { - return { ["name"]: val.name, ["description"]: 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, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFileByIdRequestBodyArgPermissionsField(val.permissions), ["collections"]: val.collections == void 0 ? void 0 : val.collections.map(function (item: UpdateFileByIdRequestBodyArgCollectionsField): any { + 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 { return serializeUpdateFileByIdRequestBodyArgCollectionsField(item); - }) as readonly any[], ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): undefined { - return void 0; + }) as readonly any[], ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): string { + return item; }) as readonly any[] }; } export function deserializeUpdateFileByIdRequestBodyArg(val: any): UpdateFileByIdRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const parent: undefined | UpdateFileByIdRequestBodyArgParentField = val.parent == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgParentField(val.parent); const sharedLink: undefined | UpdateFileByIdRequestBodyArgSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgSharedLinkField(val.shared_link); const lock: undefined | UpdateFileByIdRequestBodyArgLockField = val.lock == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgLockField(val.lock); - const dispositionAt: undefined | string = isJson(val.disposition_at, "string") ? val.disposition_at : void 0; + const dispositionAt: undefined | string = val.disposition_at == void 0 ? void 0 : val.disposition_at; const permissions: undefined | UpdateFileByIdRequestBodyArgPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFileByIdRequestBodyArgPermissionsField(val.permissions); - const collections: undefined | readonly UpdateFileByIdRequestBodyArgCollectionsField[] = isJson(val.collections, "array") ? val.collections.map(function (itm: Json): any { + const collections: undefined | readonly UpdateFileByIdRequestBodyArgCollectionsField[] = val.collections == void 0 ? void 0 : isJson(val.collections, "array") ? val.collections.map(function (itm: Json): any { return deserializeUpdateFileByIdRequestBodyArgCollectionsField(itm); - }) as readonly any[] : void 0; - const tags: undefined | readonly string[] = isJson(val.tags, "array") ? val.tags.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; + }) as readonly any[] : []; + const tags: undefined | readonly string[] = val.tags == void 0 ? void 0 : isJson(val.tags, "array") ? val.tags.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; return { name: name, description: description, parent: parent, sharedLink: sharedLink, lock: lock, dispositionAt: dispositionAt, permissions: permissions, collections: collections, tags: tags } satisfies UpdateFileByIdRequestBodyArg; } export function serializeCopyFileRequestBodyArgParentField(val: CopyFileRequestBodyArgParentField): Json { @@ -303,11 +303,11 @@ export function deserializeCopyFileRequestBodyArgParentField(val: any): CopyFile return { id: id } satisfies CopyFileRequestBodyArgParentField; } export function serializeCopyFileRequestBodyArg(val: CopyFileRequestBodyArg): Json { - return { ["name"]: val.name, ["version"]: val.version, ["parent"]: serializeCopyFileRequestBodyArgParentField(val.parent) }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["version"]: val.version == void 0 ? void 0 : val.version, ["parent"]: serializeCopyFileRequestBodyArgParentField(val.parent) }; } export function deserializeCopyFileRequestBodyArg(val: any): CopyFileRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const version: undefined | string = isJson(val.version, "string") ? val.version : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const version: undefined | string = val.version == void 0 ? void 0 : val.version; const parent: CopyFileRequestBodyArgParentField = deserializeCopyFileRequestBodyArgParentField(val.parent); return { name: name, version: version, parent: parent } satisfies CopyFileRequestBodyArg; } diff --git a/src/managers/folderClassifications.generated.ts b/src/managers/folderClassifications.generated.ts index 13c64686..cbe7f11d 100644 --- a/src/managers/folderClassifications.generated.ts +++ b/src/managers/folderClassifications.generated.ts @@ -35,6 +35,21 @@ export class CreateFolderMetadataEnterpriseSecurityClassificationHeadersArg { Object.assign(this, fields); } } +export type UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField = "replace"; +export type UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField = "/Box__Security__Classification__Key"; +export interface UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg { + readonly op?: UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField; + readonly path?: UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField; + readonly value?: string; +} +export class UpdateFolderMetadataEnterpriseSecurityClassificationHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateFolderMetadataEnterpriseSecurityClassificationHeadersArg) { + Object.assign(this, fields); + } +} export class DeleteFolderMetadataEnterpriseSecurityClassificationHeadersArg { readonly extraHeaders?: { readonly [key: string]: undefined | string; @@ -46,7 +61,7 @@ export class DeleteFolderMetadataEnterpriseSecurityClassificationHeadersArg { export class FolderClassificationsManager { readonly auth?: Authentication; readonly networkSession?: NetworkSession; - constructor(fields: Omit) { + constructor(fields: Omit) { Object.assign(this, fields); } async getFolderMetadataEnterpriseSecurityClassification6VmVochwUWo(folderId: string, headers: GetFolderMetadataEnterpriseSecurityClassification6VmVochwUWoHeadersArg = new GetFolderMetadataEnterpriseSecurityClassification6VmVochwUWoHeadersArg({})): Promise { @@ -56,13 +71,20 @@ export class FolderClassificationsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId, "/metadata/enterprise/securityClassification-6VMVochwUWo") as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeClassification(deserializeJson(response.text)); } - async createFolderMetadataEnterpriseSecurityClassification(folderId: string, requestBody: CreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg, headers: CreateFolderMetadataEnterpriseSecurityClassificationHeadersArg = new CreateFolderMetadataEnterpriseSecurityClassificationHeadersArg({})): Promise { + async createFolderMetadataEnterpriseSecurityClassification(folderId: string, requestBody: CreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg = {} satisfies CreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg, headers: CreateFolderMetadataEnterpriseSecurityClassificationHeadersArg = new CreateFolderMetadataEnterpriseSecurityClassificationHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId, "/metadata/enterprise/securityClassification-6VMVochwUWo") as string, { method: "POST", headers: headersMap, body: serializeJson(serializeCreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeClassification(deserializeJson(response.text)); } + async updateFolderMetadataEnterpriseSecurityClassification(folderId: string, requestBody: readonly UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg[], headers: UpdateFolderMetadataEnterpriseSecurityClassificationHeadersArg = new UpdateFolderMetadataEnterpriseSecurityClassificationHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId, "/metadata/enterprise/securityClassification-6VMVochwUWo") as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeClassification(deserializeJson(response.text)); + } async deleteFolderMetadataEnterpriseSecurityClassification(folderId: string, headers: DeleteFolderMetadataEnterpriseSecurityClassificationHeadersArg = new DeleteFolderMetadataEnterpriseSecurityClassificationHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; @@ -72,9 +94,42 @@ export class FolderClassificationsManager { } } export function serializeCreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg(val: CreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg): Json { - return { ["Box__Security__Classification__Key"]: val.boxSecurityClassificationKey }; + return { ["Box__Security__Classification__Key"]: val.boxSecurityClassificationKey == void 0 ? void 0 : val.boxSecurityClassificationKey }; } export function deserializeCreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg(val: any): CreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg { - const boxSecurityClassificationKey: undefined | string = isJson(val.Box__Security__Classification__Key, "string") ? val.Box__Security__Classification__Key : void 0; + const boxSecurityClassificationKey: undefined | string = val.Box__Security__Classification__Key == void 0 ? void 0 : val.Box__Security__Classification__Key; return { boxSecurityClassificationKey: boxSecurityClassificationKey } satisfies CreateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg; } +export function serializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField(val: UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField): Json { + return val; +} +export function deserializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField(val: any): UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField\""; + } + if (val == "replace") { + return "replace"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField(val: UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField): Json { + return val; +} +export function deserializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField(val: any): UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField\""; + } + if (val == "/Box__Security__Classification__Key") { + return "/Box__Security__Classification__Key"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg(val: UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg): Json { + return { ["op"]: val.op == void 0 ? void 0 : serializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField(val.op), ["path"]: val.path == void 0 ? void 0 : serializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField(val.path), ["value"]: val.value == void 0 ? void 0 : val.value }; +} +export function deserializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg(val: any): UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg { + const op: undefined | UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField = val.op == void 0 ? void 0 : deserializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgOpField(val.op); + const path: undefined | UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField = val.path == void 0 ? void 0 : deserializeUpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArgPathField(val.path); + const value: undefined | string = val.value == void 0 ? void 0 : val.value; + return { op: op, path: path, value: value } satisfies UpdateFolderMetadataEnterpriseSecurityClassificationRequestBodyArg; +} diff --git a/src/managers/folderMetadata.generated.ts b/src/managers/folderMetadata.generated.ts index 6d785b48..c69e803e 100644 --- a/src/managers/folderMetadata.generated.ts +++ b/src/managers/folderMetadata.generated.ts @@ -37,8 +37,9 @@ export class GetFolderMetadataByIdHeadersArg { } } export type CreateFolderMetadataByIdScopeArg = "global" | "enterprise"; -export interface CreateFolderMetadataByIdRequestBodyArg { -} +export type CreateFolderMetadataByIdRequestBodyArg = { + readonly [key: string]: string; +}; export class CreateFolderMetadataByIdHeadersArg { readonly extraHeaders?: { readonly [key: string]: undefined | string; @@ -47,6 +48,22 @@ export class CreateFolderMetadataByIdHeadersArg { Object.assign(this, fields); } } +export type UpdateFolderMetadataByIdScopeArg = "global" | "enterprise"; +export type UpdateFolderMetadataByIdRequestBodyArgOpField = "add" | "replace" | "remove" | "test" | "move" | "copy"; +export interface UpdateFolderMetadataByIdRequestBodyArg { + readonly op?: UpdateFolderMetadataByIdRequestBodyArgOpField; + readonly path?: string; + readonly value?: string; + readonly from?: string; +} +export class UpdateFolderMetadataByIdHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateFolderMetadataByIdHeadersArg) { + Object.assign(this, fields); + } +} export type DeleteFolderMetadataByIdScopeArg = "global" | "enterprise"; export class DeleteFolderMetadataByIdHeadersArg { readonly extraHeaders?: { @@ -59,7 +76,7 @@ export class DeleteFolderMetadataByIdHeadersArg { export class FolderMetadataManager { readonly auth?: Authentication; readonly networkSession?: NetworkSession; - constructor(fields: Omit) { + constructor(fields: Omit) { Object.assign(this, fields); } async getFolderMetadata(folderId: string, headers: GetFolderMetadataHeadersArg = new GetFolderMetadataHeadersArg({})): Promise { @@ -83,6 +100,13 @@ export class FolderMetadataManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId, "/metadata/", scope, "/", templateKey) as string, { method: "POST", headers: headersMap, body: serializeJson(serializeCreateFolderMetadataByIdRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeMetadata(deserializeJson(response.text)); } + async updateFolderMetadataById(folderId: string, scope: UpdateFolderMetadataByIdScopeArg, templateKey: string, requestBody: readonly UpdateFolderMetadataByIdRequestBodyArg[], headers: UpdateFolderMetadataByIdHeadersArg = new UpdateFolderMetadataByIdHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId, "/metadata/", scope, "/", templateKey) as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateFolderMetadataByIdRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeMetadata(deserializeJson(response.text)); + } async deleteFolderMetadataById(folderId: string, scope: DeleteFolderMetadataByIdScopeArg, templateKey: string, headers: DeleteFolderMetadataByIdHeadersArg = new DeleteFolderMetadataByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; @@ -122,10 +146,62 @@ export function deserializeCreateFolderMetadataByIdScopeArg(val: any): CreateFol throw "".concat("Invalid value: ", val) as string; } export function serializeCreateFolderMetadataByIdRequestBodyArg(val: CreateFolderMetadataByIdRequestBodyArg): Json { - return {}; + return val; } export function deserializeCreateFolderMetadataByIdRequestBodyArg(val: any): CreateFolderMetadataByIdRequestBodyArg { - return {} satisfies CreateFolderMetadataByIdRequestBodyArg; + return val; +} +export function serializeUpdateFolderMetadataByIdScopeArg(val: UpdateFolderMetadataByIdScopeArg): Json { + return val; +} +export function deserializeUpdateFolderMetadataByIdScopeArg(val: any): UpdateFolderMetadataByIdScopeArg { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFolderMetadataByIdScopeArg\""; + } + if (val == "global") { + return "global"; + } + if (val == "enterprise") { + return "enterprise"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFolderMetadataByIdRequestBodyArgOpField(val: UpdateFolderMetadataByIdRequestBodyArgOpField): Json { + return val; +} +export function deserializeUpdateFolderMetadataByIdRequestBodyArgOpField(val: any): UpdateFolderMetadataByIdRequestBodyArgOpField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFolderMetadataByIdRequestBodyArgOpField\""; + } + if (val == "add") { + return "add"; + } + if (val == "replace") { + return "replace"; + } + if (val == "remove") { + return "remove"; + } + if (val == "test") { + return "test"; + } + if (val == "move") { + return "move"; + } + if (val == "copy") { + return "copy"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFolderMetadataByIdRequestBodyArg(val: UpdateFolderMetadataByIdRequestBodyArg): Json { + return { ["op"]: val.op == void 0 ? void 0 : serializeUpdateFolderMetadataByIdRequestBodyArgOpField(val.op), ["path"]: val.path == void 0 ? void 0 : val.path, ["value"]: val.value == void 0 ? void 0 : val.value, ["from"]: val.from == void 0 ? void 0 : val.from }; +} +export function deserializeUpdateFolderMetadataByIdRequestBodyArg(val: any): UpdateFolderMetadataByIdRequestBodyArg { + const op: undefined | UpdateFolderMetadataByIdRequestBodyArgOpField = val.op == void 0 ? void 0 : deserializeUpdateFolderMetadataByIdRequestBodyArgOpField(val.op); + const path: undefined | string = val.path == void 0 ? void 0 : val.path; + const value: undefined | string = val.value == void 0 ? void 0 : val.value; + const from: undefined | string = val.from == void 0 ? void 0 : val.from; + return { op: op, path: path, value: value, from: from } satisfies UpdateFolderMetadataByIdRequestBodyArg; } export function serializeDeleteFolderMetadataByIdScopeArg(val: DeleteFolderMetadataByIdScopeArg): Json { return val; diff --git a/src/managers/folders.generated.ts b/src/managers/folders.generated.ts index eeb3273b..807f50ea 100644 --- a/src/managers/folders.generated.ts +++ b/src/managers/folders.generated.ts @@ -177,7 +177,7 @@ export class FoldersManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFolderFull(deserializeJson(response.text)); } - async updateFolderById(folderId: string, requestBody: UpdateFolderByIdRequestBodyArg, queryParams: UpdateFolderByIdQueryParamsArg = {} satisfies UpdateFolderByIdQueryParamsArg, headers: UpdateFolderByIdHeadersArg = new UpdateFolderByIdHeadersArg({})): Promise { + async updateFolderById(folderId: string, requestBody: UpdateFolderByIdRequestBodyArg = {} satisfies UpdateFolderByIdRequestBodyArg, queryParams: UpdateFolderByIdQueryParamsArg = {} satisfies UpdateFolderByIdQueryParamsArg, headers: UpdateFolderByIdHeadersArg = new UpdateFolderByIdHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -247,10 +247,10 @@ export function deserializeUpdateFolderByIdRequestBodyArgSyncStateField(val: any throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateFolderByIdRequestBodyArgParentField(val: UpdateFolderByIdRequestBodyArgParentField): Json { - return { ["id"]: val.id }; + return { ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeUpdateFolderByIdRequestBodyArgParentField(val: any): UpdateFolderByIdRequestBodyArgParentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { id: id } satisfies UpdateFolderByIdRequestBodyArgParentField; } export function serializeUpdateFolderByIdRequestBodyArgSharedLinkFieldAccessField(val: UpdateFolderByIdRequestBodyArgSharedLinkFieldAccessField): Json { @@ -272,20 +272,20 @@ export function deserializeUpdateFolderByIdRequestBodyArgSharedLinkFieldAccessFi throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField): Json { - return { ["can_download"]: val.canDownload }; + return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload }; } export function deserializeUpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField { - const canDownload: undefined | boolean = isJson(val.can_download, "boolean") ? val.can_download : void 0; + const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download; return { canDownload: canDownload } satisfies UpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField; } export function serializeUpdateFolderByIdRequestBodyArgSharedLinkField(val: UpdateFolderByIdRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; + return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgSharedLinkFieldAccessField(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 : serializeUpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; } export function deserializeUpdateFolderByIdRequestBodyArgSharedLinkField(val: any): UpdateFolderByIdRequestBodyArgSharedLinkField { const access: undefined | UpdateFolderByIdRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFolderByIdRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const permissions: undefined | UpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFolderByIdRequestBodyArgSharedLinkFieldPermissionsField(val.permissions); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateFolderByIdRequestBodyArgSharedLinkField; } @@ -312,36 +312,36 @@ export function deserializeUpdateFolderByIdRequestBodyArgFolderUploadEmailField( return { access: access } satisfies UpdateFolderByIdRequestBodyArgFolderUploadEmailField; } export function serializeUpdateFolderByIdRequestBodyArgCollectionsField(val: UpdateFolderByIdRequestBodyArgCollectionsField): Json { - return { ["id"]: val.id, ["type"]: val.type }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : val.type }; } export function deserializeUpdateFolderByIdRequestBodyArgCollectionsField(val: any): UpdateFolderByIdRequestBodyArgCollectionsField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; return { id: id, type: type } satisfies UpdateFolderByIdRequestBodyArgCollectionsField; } export function serializeUpdateFolderByIdRequestBodyArg(val: UpdateFolderByIdRequestBodyArg): Json { - return { ["name"]: val.name, ["description"]: val.description, ["sync_state"]: val.syncState == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgSyncStateField(val.syncState), ["can_non_owners_invite"]: val.canNonOwnersInvite, ["parent"]: val.parent == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgParentField(val.parent), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgSharedLinkField(val.sharedLink), ["folder_upload_email"]: val.folderUploadEmail == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgFolderUploadEmailField(val.folderUploadEmail), ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): undefined { - return void 0; - }) as readonly any[], ["is_collaboration_restricted_to_enterprise"]: val.isCollaborationRestrictedToEnterprise, ["collections"]: val.collections == void 0 ? void 0 : val.collections.map(function (item: UpdateFolderByIdRequestBodyArgCollectionsField): any { + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["description"]: val.description == void 0 ? void 0 : val.description, ["sync_state"]: val.syncState == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgSyncStateField(val.syncState), ["can_non_owners_invite"]: val.canNonOwnersInvite == void 0 ? void 0 : val.canNonOwnersInvite, ["parent"]: val.parent == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgParentField(val.parent), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgSharedLinkField(val.sharedLink), ["folder_upload_email"]: val.folderUploadEmail == void 0 ? void 0 : serializeUpdateFolderByIdRequestBodyArgFolderUploadEmailField(val.folderUploadEmail), ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): string { + return item; + }) as readonly any[], ["is_collaboration_restricted_to_enterprise"]: val.isCollaborationRestrictedToEnterprise == void 0 ? void 0 : val.isCollaborationRestrictedToEnterprise, ["collections"]: val.collections == void 0 ? void 0 : val.collections.map(function (item: UpdateFolderByIdRequestBodyArgCollectionsField): any { return serializeUpdateFolderByIdRequestBodyArgCollectionsField(item); - }) as readonly any[], ["can_non_owners_view_collaborators"]: val.canNonOwnersViewCollaborators }; + }) as readonly any[], ["can_non_owners_view_collaborators"]: val.canNonOwnersViewCollaborators == void 0 ? void 0 : val.canNonOwnersViewCollaborators }; } export function deserializeUpdateFolderByIdRequestBodyArg(val: any): UpdateFolderByIdRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const syncState: undefined | UpdateFolderByIdRequestBodyArgSyncStateField = val.sync_state == void 0 ? void 0 : deserializeUpdateFolderByIdRequestBodyArgSyncStateField(val.sync_state); - const canNonOwnersInvite: undefined | boolean = isJson(val.can_non_owners_invite, "boolean") ? val.can_non_owners_invite : void 0; + const canNonOwnersInvite: undefined | boolean = val.can_non_owners_invite == void 0 ? void 0 : val.can_non_owners_invite; const parent: undefined | UpdateFolderByIdRequestBodyArgParentField = val.parent == void 0 ? void 0 : deserializeUpdateFolderByIdRequestBodyArgParentField(val.parent); const sharedLink: undefined | UpdateFolderByIdRequestBodyArgSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeUpdateFolderByIdRequestBodyArgSharedLinkField(val.shared_link); const folderUploadEmail: undefined | UpdateFolderByIdRequestBodyArgFolderUploadEmailField = val.folder_upload_email == void 0 ? void 0 : deserializeUpdateFolderByIdRequestBodyArgFolderUploadEmailField(val.folder_upload_email); - const tags: undefined | readonly string[] = isJson(val.tags, "array") ? val.tags.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; - const isCollaborationRestrictedToEnterprise: undefined | boolean = isJson(val.is_collaboration_restricted_to_enterprise, "boolean") ? val.is_collaboration_restricted_to_enterprise : void 0; - const collections: undefined | readonly UpdateFolderByIdRequestBodyArgCollectionsField[] = isJson(val.collections, "array") ? val.collections.map(function (itm: Json): any { + const tags: undefined | readonly string[] = val.tags == void 0 ? void 0 : isJson(val.tags, "array") ? val.tags.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; + const isCollaborationRestrictedToEnterprise: undefined | boolean = val.is_collaboration_restricted_to_enterprise == void 0 ? void 0 : val.is_collaboration_restricted_to_enterprise; + const collections: undefined | readonly UpdateFolderByIdRequestBodyArgCollectionsField[] = val.collections == void 0 ? void 0 : isJson(val.collections, "array") ? val.collections.map(function (itm: Json): any { return deserializeUpdateFolderByIdRequestBodyArgCollectionsField(itm); - }) as readonly any[] : void 0; - const canNonOwnersViewCollaborators: undefined | boolean = isJson(val.can_non_owners_view_collaborators, "boolean") ? val.can_non_owners_view_collaborators : void 0; + }) as readonly any[] : []; + const canNonOwnersViewCollaborators: undefined | boolean = val.can_non_owners_view_collaborators == void 0 ? void 0 : val.can_non_owners_view_collaborators; return { name: name, description: description, syncState: syncState, canNonOwnersInvite: canNonOwnersInvite, parent: parent, sharedLink: sharedLink, folderUploadEmail: folderUploadEmail, tags: tags, isCollaborationRestrictedToEnterprise: isCollaborationRestrictedToEnterprise, collections: collections, canNonOwnersViewCollaborators: canNonOwnersViewCollaborators } satisfies UpdateFolderByIdRequestBodyArg; } export function serializeCreateFolderRequestBodyArgParentField(val: CreateFolderRequestBodyArgParentField): Json { @@ -409,10 +409,10 @@ export function deserializeCopyFolderRequestBodyArgParentField(val: any): CopyFo return { id: id } satisfies CopyFolderRequestBodyArgParentField; } export function serializeCopyFolderRequestBodyArg(val: CopyFolderRequestBodyArg): Json { - return { ["name"]: val.name, ["parent"]: serializeCopyFolderRequestBodyArgParentField(val.parent) }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["parent"]: serializeCopyFolderRequestBodyArgParentField(val.parent) }; } export function deserializeCopyFolderRequestBodyArg(val: any): CopyFolderRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const parent: CopyFolderRequestBodyArgParentField = deserializeCopyFolderRequestBodyArgParentField(val.parent); return { name: name, parent: parent } satisfies CopyFolderRequestBodyArg; } diff --git a/src/managers/groups.generated.ts b/src/managers/groups.generated.ts index 2e66eea9..1ec57490 100644 --- a/src/managers/groups.generated.ts +++ b/src/managers/groups.generated.ts @@ -133,7 +133,7 @@ export class GroupsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/groups/", groupId) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeGroupFull(deserializeJson(response.text)); } - async updateGroupById(groupId: string, requestBody: UpdateGroupByIdRequestBodyArg, queryParams: UpdateGroupByIdQueryParamsArg = {} satisfies UpdateGroupByIdQueryParamsArg, headers: UpdateGroupByIdHeadersArg = new UpdateGroupByIdHeadersArg({})): Promise { + async updateGroupById(groupId: string, requestBody: UpdateGroupByIdRequestBodyArg = {} satisfies UpdateGroupByIdRequestBodyArg, queryParams: UpdateGroupByIdQueryParamsArg = {} satisfies UpdateGroupByIdQueryParamsArg, headers: UpdateGroupByIdHeadersArg = new UpdateGroupByIdHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -188,13 +188,13 @@ export function deserializeCreateGroupRequestBodyArgMemberViewabilityLevelField( throw "".concat("Invalid value: ", val) as string; } export function serializeCreateGroupRequestBodyArg(val: CreateGroupRequestBodyArg): Json { - return { ["name"]: val.name, ["provenance"]: val.provenance, ["external_sync_identifier"]: val.externalSyncIdentifier, ["description"]: val.description, ["invitability_level"]: val.invitabilityLevel == void 0 ? void 0 : serializeCreateGroupRequestBodyArgInvitabilityLevelField(val.invitabilityLevel), ["member_viewability_level"]: val.memberViewabilityLevel == void 0 ? void 0 : serializeCreateGroupRequestBodyArgMemberViewabilityLevelField(val.memberViewabilityLevel) }; + return { ["name"]: val.name, ["provenance"]: val.provenance == void 0 ? void 0 : val.provenance, ["external_sync_identifier"]: val.externalSyncIdentifier == void 0 ? void 0 : val.externalSyncIdentifier, ["description"]: val.description == void 0 ? void 0 : val.description, ["invitability_level"]: val.invitabilityLevel == void 0 ? void 0 : serializeCreateGroupRequestBodyArgInvitabilityLevelField(val.invitabilityLevel), ["member_viewability_level"]: val.memberViewabilityLevel == void 0 ? void 0 : serializeCreateGroupRequestBodyArgMemberViewabilityLevelField(val.memberViewabilityLevel) }; } export function deserializeCreateGroupRequestBodyArg(val: any): CreateGroupRequestBodyArg { const name: string = val.name; - const provenance: undefined | string = isJson(val.provenance, "string") ? val.provenance : void 0; - const externalSyncIdentifier: undefined | string = isJson(val.external_sync_identifier, "string") ? val.external_sync_identifier : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const provenance: undefined | string = val.provenance == void 0 ? void 0 : val.provenance; + const externalSyncIdentifier: undefined | string = val.external_sync_identifier == void 0 ? void 0 : val.external_sync_identifier; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const invitabilityLevel: undefined | CreateGroupRequestBodyArgInvitabilityLevelField = val.invitability_level == void 0 ? void 0 : deserializeCreateGroupRequestBodyArgInvitabilityLevelField(val.invitability_level); const memberViewabilityLevel: undefined | CreateGroupRequestBodyArgMemberViewabilityLevelField = val.member_viewability_level == void 0 ? void 0 : deserializeCreateGroupRequestBodyArgMemberViewabilityLevelField(val.member_viewability_level); return { name: name, provenance: provenance, externalSyncIdentifier: externalSyncIdentifier, description: description, invitabilityLevel: invitabilityLevel, memberViewabilityLevel: memberViewabilityLevel } satisfies CreateGroupRequestBodyArg; @@ -236,13 +236,13 @@ export function deserializeUpdateGroupByIdRequestBodyArgMemberViewabilityLevelFi throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateGroupByIdRequestBodyArg(val: UpdateGroupByIdRequestBodyArg): Json { - return { ["name"]: val.name, ["provenance"]: val.provenance, ["external_sync_identifier"]: val.externalSyncIdentifier, ["description"]: val.description, ["invitability_level"]: val.invitabilityLevel == void 0 ? void 0 : serializeUpdateGroupByIdRequestBodyArgInvitabilityLevelField(val.invitabilityLevel), ["member_viewability_level"]: val.memberViewabilityLevel == void 0 ? void 0 : serializeUpdateGroupByIdRequestBodyArgMemberViewabilityLevelField(val.memberViewabilityLevel) }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["provenance"]: val.provenance == void 0 ? void 0 : val.provenance, ["external_sync_identifier"]: val.externalSyncIdentifier == void 0 ? void 0 : val.externalSyncIdentifier, ["description"]: val.description == void 0 ? void 0 : val.description, ["invitability_level"]: val.invitabilityLevel == void 0 ? void 0 : serializeUpdateGroupByIdRequestBodyArgInvitabilityLevelField(val.invitabilityLevel), ["member_viewability_level"]: val.memberViewabilityLevel == void 0 ? void 0 : serializeUpdateGroupByIdRequestBodyArgMemberViewabilityLevelField(val.memberViewabilityLevel) }; } export function deserializeUpdateGroupByIdRequestBodyArg(val: any): UpdateGroupByIdRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const provenance: undefined | string = isJson(val.provenance, "string") ? val.provenance : void 0; - const externalSyncIdentifier: undefined | string = isJson(val.external_sync_identifier, "string") ? val.external_sync_identifier : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const provenance: undefined | string = val.provenance == void 0 ? void 0 : val.provenance; + const externalSyncIdentifier: undefined | string = val.external_sync_identifier == void 0 ? void 0 : val.external_sync_identifier; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const invitabilityLevel: undefined | UpdateGroupByIdRequestBodyArgInvitabilityLevelField = val.invitability_level == void 0 ? void 0 : deserializeUpdateGroupByIdRequestBodyArgInvitabilityLevelField(val.invitability_level); const memberViewabilityLevel: undefined | UpdateGroupByIdRequestBodyArgMemberViewabilityLevelField = val.member_viewability_level == void 0 ? void 0 : deserializeUpdateGroupByIdRequestBodyArgMemberViewabilityLevelField(val.member_viewability_level); return { name: name, provenance: provenance, externalSyncIdentifier: externalSyncIdentifier, description: description, invitabilityLevel: invitabilityLevel, memberViewabilityLevel: memberViewabilityLevel } satisfies UpdateGroupByIdRequestBodyArg; diff --git a/src/managers/integrationMappings.generated.ts b/src/managers/integrationMappings.generated.ts index 6a8e5e4b..65a58c78 100644 --- a/src/managers/integrationMappings.generated.ts +++ b/src/managers/integrationMappings.generated.ts @@ -54,13 +54,9 @@ export class CreateIntegrationMappingSlackHeadersArg { Object.assign(this, fields); } } -export interface UpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField { -} -export interface UpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField { -} export interface UpdateIntegrationMappingSlackByIdRequestBodyArg { - readonly boxItem?: UpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField; - readonly options?: UpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField; + readonly boxItem?: IntegrationMappingBoxItemSlack; + readonly options?: IntegrationMappingSlackOptions; } export class UpdateIntegrationMappingSlackByIdHeadersArg { readonly extraHeaders?: { @@ -101,7 +97,7 @@ export class IntegrationMappingsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/integration_mappings/slack") as string, { method: "POST", headers: headersMap, body: serializeJson(serializeIntegrationMappingSlackCreateRequest(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeIntegrationMapping(deserializeJson(response.text)); } - async updateIntegrationMappingSlackById(integrationMappingId: string, requestBody: UpdateIntegrationMappingSlackByIdRequestBodyArg, headers: UpdateIntegrationMappingSlackByIdHeadersArg = new UpdateIntegrationMappingSlackByIdHeadersArg({})): Promise { + async updateIntegrationMappingSlackById(integrationMappingId: string, requestBody: UpdateIntegrationMappingSlackByIdRequestBodyArg = {} satisfies UpdateIntegrationMappingSlackByIdRequestBodyArg, headers: UpdateIntegrationMappingSlackByIdHeadersArg = new UpdateIntegrationMappingSlackByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -116,23 +112,11 @@ export class IntegrationMappingsManager { return void 0; } } -export function serializeUpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField(val: UpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField): Json { - return {}; -} -export function deserializeUpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField(val: any): UpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField { - return {} satisfies UpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField; -} -export function serializeUpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField(val: UpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField): Json { - return {}; -} -export function deserializeUpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField(val: any): UpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField { - return {} satisfies UpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField; -} export function serializeUpdateIntegrationMappingSlackByIdRequestBodyArg(val: UpdateIntegrationMappingSlackByIdRequestBodyArg): Json { - return { ["box_item"]: val.boxItem == void 0 ? void 0 : serializeUpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField(val.boxItem), ["options"]: val.options == void 0 ? void 0 : serializeUpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField(val.options) }; + return { ["box_item"]: val.boxItem == void 0 ? void 0 : serializeIntegrationMappingBoxItemSlack(val.boxItem), ["options"]: val.options == void 0 ? void 0 : serializeIntegrationMappingSlackOptions(val.options) }; } export function deserializeUpdateIntegrationMappingSlackByIdRequestBodyArg(val: any): UpdateIntegrationMappingSlackByIdRequestBodyArg { - const boxItem: undefined | UpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField = val.box_item == void 0 ? void 0 : deserializeUpdateIntegrationMappingSlackByIdRequestBodyArgBoxItemField(val.box_item); - const options: undefined | UpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField = val.options == void 0 ? void 0 : deserializeUpdateIntegrationMappingSlackByIdRequestBodyArgOptionsField(val.options); + const boxItem: undefined | IntegrationMappingBoxItemSlack = val.box_item == void 0 ? void 0 : deserializeIntegrationMappingBoxItemSlack(val.box_item); + const options: undefined | IntegrationMappingSlackOptions = val.options == void 0 ? void 0 : deserializeIntegrationMappingSlackOptions(val.options); return { boxItem: boxItem, options: options } satisfies UpdateIntegrationMappingSlackByIdRequestBodyArg; } diff --git a/src/managers/invites.generated.ts b/src/managers/invites.generated.ts index 7dd273a6..d867d50e 100644 --- a/src/managers/invites.generated.ts +++ b/src/managers/invites.generated.ts @@ -13,9 +13,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; -import { isJson } from "../json.js"; +import { Json } from "../json.js"; export interface CreateInviteRequestBodyArgEnterpriseField { readonly id: string; } @@ -83,10 +82,10 @@ export function deserializeCreateInviteRequestBodyArgEnterpriseField(val: any): return { id: id } satisfies CreateInviteRequestBodyArgEnterpriseField; } export function serializeCreateInviteRequestBodyArgActionableByField(val: CreateInviteRequestBodyArgActionableByField): Json { - return { ["login"]: val.login }; + return { ["login"]: val.login == void 0 ? void 0 : val.login }; } export function deserializeCreateInviteRequestBodyArgActionableByField(val: any): CreateInviteRequestBodyArgActionableByField { - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; return { login: login } satisfies CreateInviteRequestBodyArgActionableByField; } export function serializeCreateInviteRequestBodyArg(val: CreateInviteRequestBodyArg): Json { diff --git a/src/managers/legalHoldPolicies.generated.ts b/src/managers/legalHoldPolicies.generated.ts index 7a962ca1..1a06af7e 100644 --- a/src/managers/legalHoldPolicies.generated.ts +++ b/src/managers/legalHoldPolicies.generated.ts @@ -18,7 +18,6 @@ import { FetchResponse } from "../fetch.js"; import { deserializeJson } from "../json.js"; import { Json } from "../json.js"; import { serializeJson } from "../json.js"; -import { isJson } from "../json.js"; export interface GetLegalHoldPoliciesQueryParamsArg { readonly policyName?: string; readonly fields?: string; @@ -107,7 +106,7 @@ export class LegalHoldPoliciesManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/legal_hold_policies/", legalHoldPolicyId) as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeLegalHoldPolicy(deserializeJson(response.text)); } - async updateLegalHoldPolicyById(legalHoldPolicyId: string, requestBody: UpdateLegalHoldPolicyByIdRequestBodyArg, headers: UpdateLegalHoldPolicyByIdHeadersArg = new UpdateLegalHoldPolicyByIdHeadersArg({})): Promise { + async updateLegalHoldPolicyById(legalHoldPolicyId: string, requestBody: UpdateLegalHoldPolicyByIdRequestBodyArg = {} satisfies UpdateLegalHoldPolicyByIdRequestBodyArg, headers: UpdateLegalHoldPolicyByIdHeadersArg = new UpdateLegalHoldPolicyByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -123,22 +122,22 @@ export class LegalHoldPoliciesManager { } } export function serializeCreateLegalHoldPolicyRequestBodyArg(val: CreateLegalHoldPolicyRequestBodyArg): Json { - return { ["policy_name"]: val.policyName, ["description"]: val.description, ["filter_started_at"]: val.filterStartedAt, ["filter_ended_at"]: val.filterEndedAt, ["is_ongoing"]: val.isOngoing }; + return { ["policy_name"]: val.policyName, ["description"]: val.description == void 0 ? void 0 : val.description, ["filter_started_at"]: val.filterStartedAt == void 0 ? void 0 : val.filterStartedAt, ["filter_ended_at"]: val.filterEndedAt == void 0 ? void 0 : val.filterEndedAt, ["is_ongoing"]: val.isOngoing == void 0 ? void 0 : val.isOngoing }; } export function deserializeCreateLegalHoldPolicyRequestBodyArg(val: any): CreateLegalHoldPolicyRequestBodyArg { const policyName: string = val.policy_name; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const filterStartedAt: undefined | string = isJson(val.filter_started_at, "string") ? val.filter_started_at : void 0; - const filterEndedAt: undefined | string = isJson(val.filter_ended_at, "string") ? val.filter_ended_at : void 0; - const isOngoing: undefined | boolean = isJson(val.is_ongoing, "boolean") ? val.is_ongoing : void 0; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const filterStartedAt: undefined | string = val.filter_started_at == void 0 ? void 0 : val.filter_started_at; + const filterEndedAt: undefined | string = val.filter_ended_at == void 0 ? void 0 : val.filter_ended_at; + const isOngoing: undefined | boolean = val.is_ongoing == void 0 ? void 0 : val.is_ongoing; return { policyName: policyName, description: description, filterStartedAt: filterStartedAt, filterEndedAt: filterEndedAt, isOngoing: isOngoing } satisfies CreateLegalHoldPolicyRequestBodyArg; } export function serializeUpdateLegalHoldPolicyByIdRequestBodyArg(val: UpdateLegalHoldPolicyByIdRequestBodyArg): Json { - return { ["policy_name"]: val.policyName, ["description"]: val.description, ["release_notes"]: val.releaseNotes }; + return { ["policy_name"]: val.policyName == void 0 ? void 0 : val.policyName, ["description"]: val.description == void 0 ? void 0 : val.description, ["release_notes"]: val.releaseNotes == void 0 ? void 0 : val.releaseNotes }; } export function deserializeUpdateLegalHoldPolicyByIdRequestBodyArg(val: any): UpdateLegalHoldPolicyByIdRequestBodyArg { - const policyName: undefined | string = isJson(val.policy_name, "string") ? val.policy_name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const releaseNotes: undefined | string = isJson(val.release_notes, "string") ? val.release_notes : void 0; + const policyName: undefined | string = val.policy_name == void 0 ? void 0 : val.policy_name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const releaseNotes: undefined | string = val.release_notes == void 0 ? void 0 : val.release_notes; return { policyName: policyName, description: description, releaseNotes: releaseNotes } satisfies UpdateLegalHoldPolicyByIdRequestBodyArg; } diff --git a/src/managers/memberships.generated.ts b/src/managers/memberships.generated.ts index 887c77a3..cc87dca3 100644 --- a/src/managers/memberships.generated.ts +++ b/src/managers/memberships.generated.ts @@ -50,13 +50,13 @@ export interface CreateGroupMembershipRequestBodyArgGroupField { readonly id: string; } export type CreateGroupMembershipRequestBodyArgRoleField = "member" | "admin"; -export interface CreateGroupMembershipRequestBodyArgConfigurablePermissionsField { -} export interface CreateGroupMembershipRequestBodyArg { readonly user: CreateGroupMembershipRequestBodyArgUserField; readonly group: CreateGroupMembershipRequestBodyArgGroupField; readonly role?: CreateGroupMembershipRequestBodyArgRoleField; - readonly configurablePermissions?: CreateGroupMembershipRequestBodyArgConfigurablePermissionsField; + readonly configurablePermissions?: { + readonly [key: string]: boolean; + }; } export interface CreateGroupMembershipQueryParamsArg { readonly fields?: string; @@ -81,11 +81,11 @@ export class GetGroupMembershipByIdHeadersArg { } } export type UpdateGroupMembershipByIdRequestBodyArgRoleField = "member" | "admin"; -export interface UpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField { -} export interface UpdateGroupMembershipByIdRequestBodyArg { readonly role?: UpdateGroupMembershipByIdRequestBodyArgRoleField; - readonly configurablePermissions?: UpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField; + readonly configurablePermissions?: { + readonly [key: string]: boolean; + }; } export interface UpdateGroupMembershipByIdQueryParamsArg { readonly fields?: string; @@ -152,7 +152,7 @@ export class MembershipsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/group_memberships/", groupMembershipId) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeGroupMembership(deserializeJson(response.text)); } - async updateGroupMembershipById(groupMembershipId: string, requestBody: UpdateGroupMembershipByIdRequestBodyArg, queryParams: UpdateGroupMembershipByIdQueryParamsArg = {} satisfies UpdateGroupMembershipByIdQueryParamsArg, headers: UpdateGroupMembershipByIdHeadersArg = new UpdateGroupMembershipByIdHeadersArg({})): Promise { + async updateGroupMembershipById(groupMembershipId: string, requestBody: UpdateGroupMembershipByIdRequestBodyArg = {} satisfies UpdateGroupMembershipByIdRequestBodyArg, queryParams: UpdateGroupMembershipByIdQueryParamsArg = {} satisfies UpdateGroupMembershipByIdQueryParamsArg, headers: UpdateGroupMembershipByIdHeadersArg = new UpdateGroupMembershipByIdHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -199,20 +199,16 @@ export function deserializeCreateGroupMembershipRequestBodyArgRoleField(val: any } throw "".concat("Invalid value: ", val) as string; } -export function serializeCreateGroupMembershipRequestBodyArgConfigurablePermissionsField(val: CreateGroupMembershipRequestBodyArgConfigurablePermissionsField): Json { - return {}; -} -export function deserializeCreateGroupMembershipRequestBodyArgConfigurablePermissionsField(val: any): CreateGroupMembershipRequestBodyArgConfigurablePermissionsField { - return {} satisfies CreateGroupMembershipRequestBodyArgConfigurablePermissionsField; -} export function serializeCreateGroupMembershipRequestBodyArg(val: CreateGroupMembershipRequestBodyArg): Json { - return { ["user"]: serializeCreateGroupMembershipRequestBodyArgUserField(val.user), ["group"]: serializeCreateGroupMembershipRequestBodyArgGroupField(val.group), ["role"]: val.role == void 0 ? void 0 : serializeCreateGroupMembershipRequestBodyArgRoleField(val.role), ["configurable_permissions"]: val.configurablePermissions == void 0 ? void 0 : serializeCreateGroupMembershipRequestBodyArgConfigurablePermissionsField(val.configurablePermissions) }; + return { ["user"]: serializeCreateGroupMembershipRequestBodyArgUserField(val.user), ["group"]: serializeCreateGroupMembershipRequestBodyArgGroupField(val.group), ["role"]: val.role == void 0 ? void 0 : serializeCreateGroupMembershipRequestBodyArgRoleField(val.role), ["configurable_permissions"]: val.configurablePermissions == void 0 ? void 0 : val.configurablePermissions }; } export function deserializeCreateGroupMembershipRequestBodyArg(val: any): CreateGroupMembershipRequestBodyArg { const user: CreateGroupMembershipRequestBodyArgUserField = deserializeCreateGroupMembershipRequestBodyArgUserField(val.user); const group: CreateGroupMembershipRequestBodyArgGroupField = deserializeCreateGroupMembershipRequestBodyArgGroupField(val.group); const role: undefined | CreateGroupMembershipRequestBodyArgRoleField = val.role == void 0 ? void 0 : deserializeCreateGroupMembershipRequestBodyArgRoleField(val.role); - const configurablePermissions: undefined | CreateGroupMembershipRequestBodyArgConfigurablePermissionsField = val.configurable_permissions == void 0 ? void 0 : deserializeCreateGroupMembershipRequestBodyArgConfigurablePermissionsField(val.configurable_permissions); + const configurablePermissions: undefined | { + readonly [key: string]: boolean; + } = val.configurable_permissions == void 0 ? void 0 : val.configurable_permissions; return { user: user, group: group, role: role, configurablePermissions: configurablePermissions } satisfies CreateGroupMembershipRequestBodyArg; } export function serializeUpdateGroupMembershipByIdRequestBodyArgRoleField(val: UpdateGroupMembershipByIdRequestBodyArgRoleField): Json { @@ -230,17 +226,13 @@ export function deserializeUpdateGroupMembershipByIdRequestBodyArgRoleField(val: } throw "".concat("Invalid value: ", val) as string; } -export function serializeUpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField(val: UpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField): Json { - return {}; -} -export function deserializeUpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField(val: any): UpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField { - return {} satisfies UpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField; -} export function serializeUpdateGroupMembershipByIdRequestBodyArg(val: UpdateGroupMembershipByIdRequestBodyArg): Json { - return { ["role"]: val.role == void 0 ? void 0 : serializeUpdateGroupMembershipByIdRequestBodyArgRoleField(val.role), ["configurable_permissions"]: val.configurablePermissions == void 0 ? void 0 : serializeUpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField(val.configurablePermissions) }; + return { ["role"]: val.role == void 0 ? void 0 : serializeUpdateGroupMembershipByIdRequestBodyArgRoleField(val.role), ["configurable_permissions"]: val.configurablePermissions == void 0 ? void 0 : val.configurablePermissions }; } export function deserializeUpdateGroupMembershipByIdRequestBodyArg(val: any): UpdateGroupMembershipByIdRequestBodyArg { const role: undefined | UpdateGroupMembershipByIdRequestBodyArgRoleField = val.role == void 0 ? void 0 : deserializeUpdateGroupMembershipByIdRequestBodyArgRoleField(val.role); - const configurablePermissions: undefined | UpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField = val.configurable_permissions == void 0 ? void 0 : deserializeUpdateGroupMembershipByIdRequestBodyArgConfigurablePermissionsField(val.configurable_permissions); + const configurablePermissions: undefined | { + readonly [key: string]: boolean; + } = val.configurable_permissions == void 0 ? void 0 : val.configurable_permissions; return { role: role, configurablePermissions: configurablePermissions } satisfies UpdateGroupMembershipByIdRequestBodyArg; } diff --git a/src/managers/metadataTemplates.generated.ts b/src/managers/metadataTemplates.generated.ts index eaab0747..d911c5a0 100644 --- a/src/managers/metadataTemplates.generated.ts +++ b/src/managers/metadataTemplates.generated.ts @@ -39,6 +39,28 @@ export class GetMetadataTemplateSchemaHeadersArg { Object.assign(this, fields); } } +export type UpdateMetadataTemplateSchemaScopeArg = "global" | "enterprise"; +export type UpdateMetadataTemplateSchemaRequestBodyArgOpField = "editTemplate" | "addField" | "reorderFields" | "addEnumOption" | "reorderEnumOptions" | "reorderMultiSelectOptions" | "addMultiSelectOption" | "editField" | "removeField" | "editEnumOption" | "removeEnumOption" | "editMultiSelectOption" | "removeMultiSelectOption"; +export interface UpdateMetadataTemplateSchemaRequestBodyArg { + readonly op: UpdateMetadataTemplateSchemaRequestBodyArgOpField; + readonly data?: { + readonly [key: string]: string; + }; + readonly fieldKey?: string; + readonly fieldKeys?: readonly string[]; + readonly enumOptionKey?: string; + readonly enumOptionKeys?: readonly string[]; + readonly multiSelectOptionKey?: string; + readonly multiSelectOptionKeys?: readonly string[]; +} +export class UpdateMetadataTemplateSchemaHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateMetadataTemplateSchemaHeadersArg) { + Object.assign(this, fields); + } +} export type DeleteMetadataTemplateSchemaScopeArg = "global" | "enterprise"; export class DeleteMetadataTemplateSchemaHeadersArg { readonly extraHeaders?: { @@ -111,7 +133,7 @@ export class CreateMetadataTemplateSchemaHeadersArg { export class MetadataTemplatesManager { readonly auth?: Authentication; readonly networkSession?: NetworkSession; - constructor(fields: Omit) { + constructor(fields: Omit) { Object.assign(this, fields); } async getMetadataTemplates(queryParams: GetMetadataTemplatesQueryParamsArg, headers: GetMetadataTemplatesHeadersArg = new GetMetadataTemplatesHeadersArg({})): Promise { @@ -131,6 +153,13 @@ export class MetadataTemplatesManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/metadata_templates/", scope, "/", templateKey, "/schema") as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeMetadataTemplate(deserializeJson(response.text)); } + async updateMetadataTemplateSchema(scope: UpdateMetadataTemplateSchemaScopeArg, templateKey: string, requestBody: readonly UpdateMetadataTemplateSchemaRequestBodyArg[], headers: UpdateMetadataTemplateSchemaHeadersArg = new UpdateMetadataTemplateSchemaHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/metadata_templates/", scope, "/", templateKey, "/schema") as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateMetadataTemplateSchemaRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeMetadataTemplate(deserializeJson(response.text)); + } async deleteMetadataTemplateSchema(scope: DeleteMetadataTemplateSchemaScopeArg, templateKey: string, headers: DeleteMetadataTemplateSchemaHeadersArg = new DeleteMetadataTemplateSchemaHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; @@ -188,6 +217,97 @@ export function deserializeGetMetadataTemplateSchemaScopeArg(val: any): GetMetad } throw "".concat("Invalid value: ", val) as string; } +export function serializeUpdateMetadataTemplateSchemaScopeArg(val: UpdateMetadataTemplateSchemaScopeArg): Json { + return val; +} +export function deserializeUpdateMetadataTemplateSchemaScopeArg(val: any): UpdateMetadataTemplateSchemaScopeArg { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateMetadataTemplateSchemaScopeArg\""; + } + if (val == "global") { + return "global"; + } + if (val == "enterprise") { + return "enterprise"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateMetadataTemplateSchemaRequestBodyArgOpField(val: UpdateMetadataTemplateSchemaRequestBodyArgOpField): Json { + return val; +} +export function deserializeUpdateMetadataTemplateSchemaRequestBodyArgOpField(val: any): UpdateMetadataTemplateSchemaRequestBodyArgOpField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateMetadataTemplateSchemaRequestBodyArgOpField\""; + } + if (val == "editTemplate") { + return "editTemplate"; + } + if (val == "addField") { + return "addField"; + } + if (val == "reorderFields") { + return "reorderFields"; + } + if (val == "addEnumOption") { + return "addEnumOption"; + } + if (val == "reorderEnumOptions") { + return "reorderEnumOptions"; + } + if (val == "reorderMultiSelectOptions") { + return "reorderMultiSelectOptions"; + } + if (val == "addMultiSelectOption") { + return "addMultiSelectOption"; + } + if (val == "editField") { + return "editField"; + } + if (val == "removeField") { + return "removeField"; + } + if (val == "editEnumOption") { + return "editEnumOption"; + } + if (val == "removeEnumOption") { + return "removeEnumOption"; + } + if (val == "editMultiSelectOption") { + return "editMultiSelectOption"; + } + if (val == "removeMultiSelectOption") { + return "removeMultiSelectOption"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateMetadataTemplateSchemaRequestBodyArg(val: UpdateMetadataTemplateSchemaRequestBodyArg): Json { + return { ["op"]: serializeUpdateMetadataTemplateSchemaRequestBodyArgOpField(val.op), ["data"]: val.data == void 0 ? void 0 : val.data, ["fieldKey"]: val.fieldKey == void 0 ? void 0 : val.fieldKey, ["fieldKeys"]: val.fieldKeys == void 0 ? void 0 : val.fieldKeys.map(function (item: string): string { + return item; + }) as readonly any[], ["enumOptionKey"]: val.enumOptionKey == void 0 ? void 0 : val.enumOptionKey, ["enumOptionKeys"]: val.enumOptionKeys == void 0 ? void 0 : val.enumOptionKeys.map(function (item: string): string { + return item; + }) as readonly any[], ["multiSelectOptionKey"]: val.multiSelectOptionKey == void 0 ? void 0 : val.multiSelectOptionKey, ["multiSelectOptionKeys"]: val.multiSelectOptionKeys == void 0 ? void 0 : val.multiSelectOptionKeys.map(function (item: string): string { + return item; + }) as readonly any[] }; +} +export function deserializeUpdateMetadataTemplateSchemaRequestBodyArg(val: any): UpdateMetadataTemplateSchemaRequestBodyArg { + const op: UpdateMetadataTemplateSchemaRequestBodyArgOpField = deserializeUpdateMetadataTemplateSchemaRequestBodyArgOpField(val.op); + const data: undefined | { + readonly [key: string]: string; + } = val.data == void 0 ? void 0 : val.data; + const fieldKey: undefined | string = val.fieldKey == void 0 ? void 0 : val.fieldKey; + const fieldKeys: undefined | readonly string[] = val.fieldKeys == void 0 ? void 0 : isJson(val.fieldKeys, "array") ? val.fieldKeys.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; + const enumOptionKey: undefined | string = val.enumOptionKey == void 0 ? void 0 : val.enumOptionKey; + const enumOptionKeys: undefined | readonly string[] = val.enumOptionKeys == void 0 ? void 0 : isJson(val.enumOptionKeys, "array") ? val.enumOptionKeys.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; + const multiSelectOptionKey: undefined | string = val.multiSelectOptionKey == void 0 ? void 0 : val.multiSelectOptionKey; + const multiSelectOptionKeys: undefined | readonly string[] = val.multiSelectOptionKeys == void 0 ? void 0 : isJson(val.multiSelectOptionKeys, "array") ? val.multiSelectOptionKeys.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; + return { op: op, data: data, fieldKey: fieldKey, fieldKeys: fieldKeys, enumOptionKey: enumOptionKey, enumOptionKeys: enumOptionKeys, multiSelectOptionKey: multiSelectOptionKey, multiSelectOptionKeys: multiSelectOptionKeys } satisfies UpdateMetadataTemplateSchemaRequestBodyArg; +} export function serializeDeleteMetadataTemplateSchemaScopeArg(val: DeleteMetadataTemplateSchemaScopeArg): Json { return val; } @@ -235,7 +355,7 @@ export function deserializeCreateMetadataTemplateSchemaRequestBodyArgFieldsField return { key: key } satisfies CreateMetadataTemplateSchemaRequestBodyArgFieldsFieldOptionsField; } export function serializeCreateMetadataTemplateSchemaRequestBodyArgFieldsField(val: CreateMetadataTemplateSchemaRequestBodyArgFieldsField): Json { - return { ["type"]: serializeCreateMetadataTemplateSchemaRequestBodyArgFieldsFieldTypeField(val.type), ["key"]: val.key, ["displayName"]: val.displayName, ["description"]: val.description, ["hidden"]: val.hidden, ["options"]: val.options == void 0 ? void 0 : val.options.map(function (item: CreateMetadataTemplateSchemaRequestBodyArgFieldsFieldOptionsField): any { + return { ["type"]: serializeCreateMetadataTemplateSchemaRequestBodyArgFieldsFieldTypeField(val.type), ["key"]: val.key, ["displayName"]: val.displayName, ["description"]: val.description == void 0 ? void 0 : val.description, ["hidden"]: val.hidden == void 0 ? void 0 : val.hidden, ["options"]: val.options == void 0 ? void 0 : val.options.map(function (item: CreateMetadataTemplateSchemaRequestBodyArgFieldsFieldOptionsField): any { return serializeCreateMetadataTemplateSchemaRequestBodyArgFieldsFieldOptionsField(item); }) as readonly any[] }; } @@ -243,26 +363,26 @@ export function deserializeCreateMetadataTemplateSchemaRequestBodyArgFieldsField const type: CreateMetadataTemplateSchemaRequestBodyArgFieldsFieldTypeField = deserializeCreateMetadataTemplateSchemaRequestBodyArgFieldsFieldTypeField(val.type); const key: string = val.key; const displayName: string = val.displayName; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const hidden: undefined | boolean = isJson(val.hidden, "boolean") ? val.hidden : void 0; - const options: undefined | readonly CreateMetadataTemplateSchemaRequestBodyArgFieldsFieldOptionsField[] = isJson(val.options, "array") ? val.options.map(function (itm: Json): any { + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const hidden: undefined | boolean = val.hidden == void 0 ? void 0 : val.hidden; + const options: undefined | readonly CreateMetadataTemplateSchemaRequestBodyArgFieldsFieldOptionsField[] = val.options == void 0 ? void 0 : isJson(val.options, "array") ? val.options.map(function (itm: Json): any { return deserializeCreateMetadataTemplateSchemaRequestBodyArgFieldsFieldOptionsField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { type: type, key: key, displayName: displayName, description: description, hidden: hidden, options: options } satisfies CreateMetadataTemplateSchemaRequestBodyArgFieldsField; } export function serializeCreateMetadataTemplateSchemaRequestBodyArg(val: CreateMetadataTemplateSchemaRequestBodyArg): Json { - return { ["scope"]: val.scope, ["templateKey"]: val.templateKey, ["displayName"]: val.displayName, ["hidden"]: val.hidden, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: CreateMetadataTemplateSchemaRequestBodyArgFieldsField): any { + return { ["scope"]: val.scope, ["templateKey"]: val.templateKey == void 0 ? void 0 : val.templateKey, ["displayName"]: val.displayName, ["hidden"]: val.hidden == void 0 ? void 0 : val.hidden, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: CreateMetadataTemplateSchemaRequestBodyArgFieldsField): any { return serializeCreateMetadataTemplateSchemaRequestBodyArgFieldsField(item); - }) as readonly any[], ["copyInstanceOnItemCopy"]: val.copyInstanceOnItemCopy }; + }) as readonly any[], ["copyInstanceOnItemCopy"]: val.copyInstanceOnItemCopy == void 0 ? void 0 : val.copyInstanceOnItemCopy }; } export function deserializeCreateMetadataTemplateSchemaRequestBodyArg(val: any): CreateMetadataTemplateSchemaRequestBodyArg { const scope: string = val.scope; - const templateKey: undefined | string = isJson(val.templateKey, "string") ? val.templateKey : void 0; + const templateKey: undefined | string = val.templateKey == void 0 ? void 0 : val.templateKey; const displayName: string = val.displayName; - const hidden: undefined | boolean = isJson(val.hidden, "boolean") ? val.hidden : void 0; - const fields: undefined | readonly CreateMetadataTemplateSchemaRequestBodyArgFieldsField[] = isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { + const hidden: undefined | boolean = val.hidden == void 0 ? void 0 : val.hidden; + const fields: undefined | readonly CreateMetadataTemplateSchemaRequestBodyArgFieldsField[] = val.fields == void 0 ? void 0 : isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { return deserializeCreateMetadataTemplateSchemaRequestBodyArgFieldsField(itm); - }) as readonly any[] : void 0; - const copyInstanceOnItemCopy: undefined | boolean = isJson(val.copyInstanceOnItemCopy, "boolean") ? val.copyInstanceOnItemCopy : void 0; + }) as readonly any[] : []; + const copyInstanceOnItemCopy: undefined | boolean = val.copyInstanceOnItemCopy == void 0 ? void 0 : val.copyInstanceOnItemCopy; return { scope: scope, templateKey: templateKey, displayName: displayName, hidden: hidden, fields: fields, copyInstanceOnItemCopy: copyInstanceOnItemCopy } satisfies CreateMetadataTemplateSchemaRequestBodyArg; } diff --git a/src/managers/retentionPolicies.generated.ts b/src/managers/retentionPolicies.generated.ts index 20fe4247..654f134b 100644 --- a/src/managers/retentionPolicies.generated.ts +++ b/src/managers/retentionPolicies.generated.ts @@ -133,7 +133,7 @@ export class RetentionPoliciesManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/retention_policies/", retentionPolicyId) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeRetentionPolicy(deserializeJson(response.text)); } - async updateRetentionPolicyById(retentionPolicyId: string, requestBody: UpdateRetentionPolicyByIdRequestBodyArg, headers: UpdateRetentionPolicyByIdHeadersArg = new UpdateRetentionPolicyByIdHeadersArg({})): Promise { + async updateRetentionPolicyById(retentionPolicyId: string, requestBody: UpdateRetentionPolicyByIdRequestBodyArg = {} satisfies UpdateRetentionPolicyByIdRequestBodyArg, headers: UpdateRetentionPolicyByIdHeadersArg = new UpdateRetentionPolicyByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -194,22 +194,22 @@ export function deserializeCreateRetentionPolicyRequestBodyArgRetentionTypeField throw "".concat("Invalid value: ", val) as string; } export function serializeCreateRetentionPolicyRequestBodyArg(val: CreateRetentionPolicyRequestBodyArg): Json { - return { ["policy_name"]: val.policyName, ["description"]: val.description, ["policy_type"]: serializeCreateRetentionPolicyRequestBodyArgPolicyTypeField(val.policyType), ["disposition_action"]: serializeCreateRetentionPolicyRequestBodyArgDispositionActionField(val.dispositionAction), ["retention_length"]: val.retentionLength, ["retention_type"]: val.retentionType == void 0 ? void 0 : serializeCreateRetentionPolicyRequestBodyArgRetentionTypeField(val.retentionType), ["can_owner_extend_retention"]: val.canOwnerExtendRetention, ["are_owners_notified"]: val.areOwnersNotified, ["custom_notification_recipients"]: val.customNotificationRecipients == void 0 ? void 0 : val.customNotificationRecipients.map(function (item: UserMini): any { + return { ["policy_name"]: val.policyName, ["description"]: val.description == void 0 ? void 0 : val.description, ["policy_type"]: serializeCreateRetentionPolicyRequestBodyArgPolicyTypeField(val.policyType), ["disposition_action"]: serializeCreateRetentionPolicyRequestBodyArgDispositionActionField(val.dispositionAction), ["retention_length"]: val.retentionLength == void 0 ? void 0 : val.retentionLength, ["retention_type"]: val.retentionType == void 0 ? void 0 : serializeCreateRetentionPolicyRequestBodyArgRetentionTypeField(val.retentionType), ["can_owner_extend_retention"]: val.canOwnerExtendRetention == void 0 ? void 0 : val.canOwnerExtendRetention, ["are_owners_notified"]: val.areOwnersNotified == void 0 ? void 0 : val.areOwnersNotified, ["custom_notification_recipients"]: val.customNotificationRecipients == void 0 ? void 0 : val.customNotificationRecipients.map(function (item: UserMini): any { return serializeUserMini(item); }) as readonly any[] }; } export function deserializeCreateRetentionPolicyRequestBodyArg(val: any): CreateRetentionPolicyRequestBodyArg { const policyName: string = val.policy_name; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const policyType: CreateRetentionPolicyRequestBodyArgPolicyTypeField = deserializeCreateRetentionPolicyRequestBodyArgPolicyTypeField(val.policy_type); const dispositionAction: CreateRetentionPolicyRequestBodyArgDispositionActionField = deserializeCreateRetentionPolicyRequestBodyArgDispositionActionField(val.disposition_action); - const retentionLength: undefined | string = isJson(val.retention_length, "string") ? val.retention_length : void 0; + const retentionLength: undefined | string = val.retention_length == void 0 ? void 0 : val.retention_length; const retentionType: undefined | CreateRetentionPolicyRequestBodyArgRetentionTypeField = val.retention_type == void 0 ? void 0 : deserializeCreateRetentionPolicyRequestBodyArgRetentionTypeField(val.retention_type); - const canOwnerExtendRetention: undefined | boolean = isJson(val.can_owner_extend_retention, "boolean") ? val.can_owner_extend_retention : void 0; - const areOwnersNotified: undefined | boolean = isJson(val.are_owners_notified, "boolean") ? val.are_owners_notified : void 0; - const customNotificationRecipients: undefined | readonly UserMini[] = isJson(val.custom_notification_recipients, "array") ? val.custom_notification_recipients.map(function (itm: Json): any { + const canOwnerExtendRetention: undefined | boolean = val.can_owner_extend_retention == void 0 ? void 0 : val.can_owner_extend_retention; + const areOwnersNotified: undefined | boolean = val.are_owners_notified == void 0 ? void 0 : val.are_owners_notified; + const customNotificationRecipients: undefined | readonly UserMini[] = val.custom_notification_recipients == void 0 ? void 0 : isJson(val.custom_notification_recipients, "array") ? val.custom_notification_recipients.map(function (itm: Json): any { return deserializeUserMini(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { policyName: policyName, description: description, policyType: policyType, dispositionAction: dispositionAction, retentionLength: retentionLength, retentionType: retentionType, canOwnerExtendRetention: canOwnerExtendRetention, areOwnersNotified: areOwnersNotified, customNotificationRecipients: customNotificationRecipients } satisfies CreateRetentionPolicyRequestBodyArg; } export function serializeUpdateRetentionPolicyByIdRequestBodyArgDispositionActionField(val: UpdateRetentionPolicyByIdRequestBodyArgDispositionActionField): Json { @@ -228,21 +228,21 @@ export function deserializeUpdateRetentionPolicyByIdRequestBodyArgDispositionAct throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateRetentionPolicyByIdRequestBodyArg(val: UpdateRetentionPolicyByIdRequestBodyArg): Json { - return { ["policy_name"]: val.policyName, ["description"]: val.description, ["disposition_action"]: val.dispositionAction == void 0 ? void 0 : serializeUpdateRetentionPolicyByIdRequestBodyArgDispositionActionField(val.dispositionAction), ["retention_type"]: val.retentionType, ["retention_length"]: val.retentionLength, ["status"]: val.status, ["can_owner_extend_retention"]: val.canOwnerExtendRetention, ["are_owners_notified"]: val.areOwnersNotified, ["custom_notification_recipients"]: val.customNotificationRecipients == void 0 ? void 0 : val.customNotificationRecipients.map(function (item: UserMini): any { + return { ["policy_name"]: val.policyName == void 0 ? void 0 : val.policyName, ["description"]: val.description == void 0 ? void 0 : val.description, ["disposition_action"]: val.dispositionAction == void 0 ? void 0 : serializeUpdateRetentionPolicyByIdRequestBodyArgDispositionActionField(val.dispositionAction), ["retention_type"]: val.retentionType == void 0 ? void 0 : val.retentionType, ["retention_length"]: val.retentionLength == void 0 ? void 0 : val.retentionLength, ["status"]: val.status == void 0 ? void 0 : val.status, ["can_owner_extend_retention"]: val.canOwnerExtendRetention == void 0 ? void 0 : val.canOwnerExtendRetention, ["are_owners_notified"]: val.areOwnersNotified == void 0 ? void 0 : val.areOwnersNotified, ["custom_notification_recipients"]: val.customNotificationRecipients == void 0 ? void 0 : val.customNotificationRecipients.map(function (item: UserMini): any { return serializeUserMini(item); }) as readonly any[] }; } export function deserializeUpdateRetentionPolicyByIdRequestBodyArg(val: any): UpdateRetentionPolicyByIdRequestBodyArg { - const policyName: undefined | string = isJson(val.policy_name, "string") ? val.policy_name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const policyName: undefined | string = val.policy_name == void 0 ? void 0 : val.policy_name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const dispositionAction: undefined | UpdateRetentionPolicyByIdRequestBodyArgDispositionActionField = val.disposition_action == void 0 ? void 0 : deserializeUpdateRetentionPolicyByIdRequestBodyArgDispositionActionField(val.disposition_action); - const retentionType: undefined | string = isJson(val.retention_type, "string") ? val.retention_type : void 0; - const retentionLength: undefined | string = isJson(val.retention_length, "string") ? val.retention_length : void 0; - const status: undefined | string = isJson(val.status, "string") ? val.status : void 0; - const canOwnerExtendRetention: undefined | boolean = isJson(val.can_owner_extend_retention, "boolean") ? val.can_owner_extend_retention : void 0; - const areOwnersNotified: undefined | boolean = isJson(val.are_owners_notified, "boolean") ? val.are_owners_notified : void 0; - const customNotificationRecipients: undefined | readonly UserMini[] = isJson(val.custom_notification_recipients, "array") ? val.custom_notification_recipients.map(function (itm: Json): any { + const retentionType: undefined | string = val.retention_type == void 0 ? void 0 : val.retention_type; + const retentionLength: undefined | string = val.retention_length == void 0 ? void 0 : val.retention_length; + const status: undefined | string = val.status == void 0 ? void 0 : val.status; + const canOwnerExtendRetention: undefined | boolean = val.can_owner_extend_retention == void 0 ? void 0 : val.can_owner_extend_retention; + const areOwnersNotified: undefined | boolean = val.are_owners_notified == void 0 ? void 0 : val.are_owners_notified; + const customNotificationRecipients: undefined | readonly UserMini[] = val.custom_notification_recipients == void 0 ? void 0 : isJson(val.custom_notification_recipients, "array") ? val.custom_notification_recipients.map(function (itm: Json): any { return deserializeUserMini(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { policyName: policyName, description: description, dispositionAction: dispositionAction, retentionType: retentionType, retentionLength: retentionLength, status: status, canOwnerExtendRetention: canOwnerExtendRetention, areOwnersNotified: areOwnersNotified, customNotificationRecipients: customNotificationRecipients } satisfies UpdateRetentionPolicyByIdRequestBodyArg; } diff --git a/src/managers/retentionPolicyAssignments.generated.ts b/src/managers/retentionPolicyAssignments.generated.ts index 4f5cb7f5..4177b57e 100644 --- a/src/managers/retentionPolicyAssignments.generated.ts +++ b/src/managers/retentionPolicyAssignments.generated.ts @@ -191,24 +191,24 @@ export function deserializeCreateRetentionPolicyAssignmentRequestBodyArgAssignTo return { type: type, id: id } satisfies CreateRetentionPolicyAssignmentRequestBodyArgAssignToField; } export function serializeCreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField(val: CreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField): Json { - return { ["field"]: val.field, ["value"]: val.value }; + return { ["field"]: val.field == void 0 ? void 0 : val.field, ["value"]: val.value == void 0 ? void 0 : val.value }; } export function deserializeCreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField(val: any): CreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField { - const field: undefined | string = isJson(val.field, "string") ? val.field : void 0; - const value: undefined | string = isJson(val.value, "string") ? val.value : void 0; + const field: undefined | string = val.field == void 0 ? void 0 : val.field; + const value: undefined | string = val.value == void 0 ? void 0 : val.value; return { field: field, value: value } satisfies CreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField; } export function serializeCreateRetentionPolicyAssignmentRequestBodyArg(val: CreateRetentionPolicyAssignmentRequestBodyArg): Json { return { ["policy_id"]: val.policyId, ["assign_to"]: serializeCreateRetentionPolicyAssignmentRequestBodyArgAssignToField(val.assignTo), ["filter_fields"]: val.filterFields == void 0 ? void 0 : val.filterFields.map(function (item: CreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField): any { return serializeCreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField(item); - }) as readonly any[], ["start_date_field"]: val.startDateField }; + }) as readonly any[], ["start_date_field"]: val.startDateField == void 0 ? void 0 : val.startDateField }; } export function deserializeCreateRetentionPolicyAssignmentRequestBodyArg(val: any): CreateRetentionPolicyAssignmentRequestBodyArg { const policyId: string = val.policy_id; const assignTo: CreateRetentionPolicyAssignmentRequestBodyArgAssignToField = deserializeCreateRetentionPolicyAssignmentRequestBodyArgAssignToField(val.assign_to); - const filterFields: undefined | readonly CreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField[] = isJson(val.filter_fields, "array") ? val.filter_fields.map(function (itm: Json): any { + const filterFields: undefined | readonly CreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField[] = val.filter_fields == void 0 ? void 0 : isJson(val.filter_fields, "array") ? val.filter_fields.map(function (itm: Json): any { return deserializeCreateRetentionPolicyAssignmentRequestBodyArgFilterFieldsField(itm); - }) as readonly any[] : void 0; - const startDateField: undefined | string = isJson(val.start_date_field, "string") ? val.start_date_field : void 0; + }) as readonly any[] : []; + const startDateField: undefined | string = val.start_date_field == void 0 ? void 0 : val.start_date_field; return { policyId: policyId, assignTo: assignTo, filterFields: filterFields, startDateField: startDateField } satisfies CreateRetentionPolicyAssignmentRequestBodyArg; } diff --git a/src/managers/search.generated.ts b/src/managers/search.generated.ts index 8fb17fad..7cbf937c 100644 --- a/src/managers/search.generated.ts +++ b/src/managers/search.generated.ts @@ -25,8 +25,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; +import { Json } from "../json.js"; export class CreateMetadataQueryExecuteReadHeadersArg { readonly extraHeaders?: { readonly [key: string]: undefined | string; diff --git a/src/managers/sessionTermination.generated.ts b/src/managers/sessionTermination.generated.ts index f426a161..c2eddcfa 100644 --- a/src/managers/sessionTermination.generated.ts +++ b/src/managers/sessionTermination.generated.ts @@ -13,8 +13,9 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; +import { Json } from "../json.js"; +import { isJson } from "../json.js"; export interface CreateUserTerminateSessionRequestBodyArg { readonly userIds: readonly string[]; readonly userLogins: readonly string[]; @@ -60,29 +61,29 @@ export class SessionTerminationManager { } } export function serializeCreateUserTerminateSessionRequestBodyArg(val: CreateUserTerminateSessionRequestBodyArg): Json { - return { ["user_ids"]: val.userIds.map(function (item: string): undefined { - return void 0; - }) as readonly any[], ["user_logins"]: val.userLogins.map(function (item: string): undefined { - return void 0; + return { ["user_ids"]: val.userIds.map(function (item: string): string { + return item; + }) as readonly any[], ["user_logins"]: val.userLogins.map(function (item: string): string { + return item; }) as readonly any[] }; } export function deserializeCreateUserTerminateSessionRequestBodyArg(val: any): CreateUserTerminateSessionRequestBodyArg { - const userIds: readonly string[] = val.user_ids.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[]; - const userLogins: readonly string[] = val.user_logins.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[]; + const userIds: readonly string[] = isJson(val.user_ids, "array") ? val.user_ids.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; + const userLogins: readonly string[] = isJson(val.user_logins, "array") ? val.user_logins.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; return { userIds: userIds, userLogins: userLogins } satisfies CreateUserTerminateSessionRequestBodyArg; } export function serializeCreateGroupTerminateSessionRequestBodyArg(val: CreateGroupTerminateSessionRequestBodyArg): Json { - return { ["group_ids"]: val.groupIds.map(function (item: string): undefined { - return void 0; + return { ["group_ids"]: val.groupIds.map(function (item: string): string { + return item; }) as readonly any[] }; } export function deserializeCreateGroupTerminateSessionRequestBodyArg(val: any): CreateGroupTerminateSessionRequestBodyArg { - const groupIds: readonly string[] = val.group_ids.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[]; + const groupIds: readonly string[] = isJson(val.group_ids, "array") ? val.group_ids.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; return { groupIds: groupIds } satisfies CreateGroupTerminateSessionRequestBodyArg; } diff --git a/src/managers/sharedLinksFiles.generated.ts b/src/managers/sharedLinksFiles.generated.ts index fe3978c3..3a33b219 100644 --- a/src/managers/sharedLinksFiles.generated.ts +++ b/src/managers/sharedLinksFiles.generated.ts @@ -136,7 +136,7 @@ export class SharedLinksFilesManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "#get_shared_link") as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFileFull(deserializeJson(response.text)); } - async updateFileAddSharedLink(fileId: string, requestBody: UpdateFileAddSharedLinkRequestBodyArg, queryParams: UpdateFileAddSharedLinkQueryParamsArg, headers: UpdateFileAddSharedLinkHeadersArg = new UpdateFileAddSharedLinkHeadersArg({})): Promise { + async updateFileAddSharedLink(fileId: string, requestBody: UpdateFileAddSharedLinkRequestBodyArg = {} satisfies UpdateFileAddSharedLinkRequestBodyArg, queryParams: UpdateFileAddSharedLinkQueryParamsArg, headers: UpdateFileAddSharedLinkHeadersArg = new UpdateFileAddSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -146,7 +146,7 @@ export class SharedLinksFilesManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "#add_shared_link") as string, { method: "PUT", params: queryParamsMap, headers: headersMap, body: serializeJson(serializeUpdateFileAddSharedLinkRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFileFull(deserializeJson(response.text)); } - async updateFileUpdateSharedLink(fileId: string, requestBody: UpdateFileUpdateSharedLinkRequestBodyArg, queryParams: UpdateFileUpdateSharedLinkQueryParamsArg, headers: UpdateFileUpdateSharedLinkHeadersArg = new UpdateFileUpdateSharedLinkHeadersArg({})): Promise { + async updateFileUpdateSharedLink(fileId: string, requestBody: UpdateFileUpdateSharedLinkRequestBodyArg = {} satisfies UpdateFileUpdateSharedLinkRequestBodyArg, queryParams: UpdateFileUpdateSharedLinkQueryParamsArg, headers: UpdateFileUpdateSharedLinkHeadersArg = new UpdateFileUpdateSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -156,7 +156,7 @@ export class SharedLinksFilesManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "#update_shared_link") as string, { method: "PUT", params: queryParamsMap, headers: headersMap, body: serializeJson(serializeUpdateFileUpdateSharedLinkRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFileFull(deserializeJson(response.text)); } - async updateFileRemoveSharedLink(fileId: string, requestBody: UpdateFileRemoveSharedLinkRequestBodyArg, queryParams: UpdateFileRemoveSharedLinkQueryParamsArg, headers: UpdateFileRemoveSharedLinkHeadersArg = new UpdateFileRemoveSharedLinkHeadersArg({})): Promise { + async updateFileRemoveSharedLink(fileId: string, requestBody: UpdateFileRemoveSharedLinkRequestBodyArg = {} satisfies UpdateFileRemoveSharedLinkRequestBodyArg, queryParams: UpdateFileRemoveSharedLinkQueryParamsArg, headers: UpdateFileRemoveSharedLinkHeadersArg = new UpdateFileRemoveSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -186,22 +186,22 @@ export function deserializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldA throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField): Json { - return { ["can_download"]: val.canDownload, ["can_preview"]: val.canPreview, ["can_edit"]: val.canEdit }; + return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload, ["can_preview"]: val.canPreview == void 0 ? void 0 : val.canPreview, ["can_edit"]: val.canEdit == void 0 ? void 0 : val.canEdit }; } export function deserializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField { - const canDownload: undefined | boolean = isJson(val.can_download, "boolean") ? val.can_download : void 0; - const canPreview: undefined | boolean = isJson(val.can_preview, "boolean") ? val.can_preview : void 0; - const canEdit: undefined | boolean = isJson(val.can_edit, "boolean") ? val.can_edit : void 0; + const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download; + const canPreview: undefined | boolean = val.can_preview == void 0 ? void 0 : val.can_preview; + const canEdit: undefined | boolean = val.can_edit == void 0 ? void 0 : val.can_edit; return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies UpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField; } export function serializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkField(val: UpdateFileAddSharedLinkRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; + return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(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 : serializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; } export function deserializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkField(val: any): UpdateFileAddSharedLinkRequestBodyArgSharedLinkField { const access: undefined | UpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const permissions: undefined | UpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFileAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateFileAddSharedLinkRequestBodyArgSharedLinkField; } @@ -231,22 +231,22 @@ export function deserializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFie throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField): Json { - return { ["can_download"]: val.canDownload, ["can_preview"]: val.canPreview, ["can_edit"]: val.canEdit }; + return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload, ["can_preview"]: val.canPreview == void 0 ? void 0 : val.canPreview, ["can_edit"]: val.canEdit == void 0 ? void 0 : val.canEdit }; } export function deserializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField { - const canDownload: undefined | boolean = isJson(val.can_download, "boolean") ? val.can_download : void 0; - const canPreview: undefined | boolean = isJson(val.can_preview, "boolean") ? val.can_preview : void 0; - const canEdit: undefined | boolean = isJson(val.can_edit, "boolean") ? val.can_edit : void 0; + const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download; + const canPreview: undefined | boolean = val.can_preview == void 0 ? void 0 : val.can_preview; + const canEdit: undefined | boolean = val.can_edit == void 0 ? void 0 : val.can_edit; return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies UpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField; } export function serializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkField(val: UpdateFileUpdateSharedLinkRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; + return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(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 : serializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; } export function deserializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkField(val: any): UpdateFileUpdateSharedLinkRequestBodyArgSharedLinkField { const access: undefined | UpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const permissions: undefined | UpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFileUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateFileUpdateSharedLinkRequestBodyArgSharedLinkField; } diff --git a/src/managers/sharedLinksFolders.generated.ts b/src/managers/sharedLinksFolders.generated.ts index 5a830d06..a12cc6da 100644 --- a/src/managers/sharedLinksFolders.generated.ts +++ b/src/managers/sharedLinksFolders.generated.ts @@ -136,7 +136,7 @@ export class SharedLinksFoldersManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId, "#get_shared_link") as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFolderFull(deserializeJson(response.text)); } - async updateFolderAddSharedLink(folderId: string, requestBody: UpdateFolderAddSharedLinkRequestBodyArg, queryParams: UpdateFolderAddSharedLinkQueryParamsArg, headers: UpdateFolderAddSharedLinkHeadersArg = new UpdateFolderAddSharedLinkHeadersArg({})): Promise { + async updateFolderAddSharedLink(folderId: string, requestBody: UpdateFolderAddSharedLinkRequestBodyArg = {} satisfies UpdateFolderAddSharedLinkRequestBodyArg, queryParams: UpdateFolderAddSharedLinkQueryParamsArg, headers: UpdateFolderAddSharedLinkHeadersArg = new UpdateFolderAddSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -146,7 +146,7 @@ export class SharedLinksFoldersManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId, "#add_shared_link") as string, { method: "PUT", params: queryParamsMap, headers: headersMap, body: serializeJson(serializeUpdateFolderAddSharedLinkRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFolderFull(deserializeJson(response.text)); } - async updateFolderUpdateSharedLink(folderId: string, requestBody: UpdateFolderUpdateSharedLinkRequestBodyArg, queryParams: UpdateFolderUpdateSharedLinkQueryParamsArg, headers: UpdateFolderUpdateSharedLinkHeadersArg = new UpdateFolderUpdateSharedLinkHeadersArg({})): Promise { + async updateFolderUpdateSharedLink(folderId: string, requestBody: UpdateFolderUpdateSharedLinkRequestBodyArg = {} satisfies UpdateFolderUpdateSharedLinkRequestBodyArg, queryParams: UpdateFolderUpdateSharedLinkQueryParamsArg, headers: UpdateFolderUpdateSharedLinkHeadersArg = new UpdateFolderUpdateSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -156,7 +156,7 @@ export class SharedLinksFoldersManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/folders/", folderId, "#update_shared_link") as string, { method: "PUT", params: queryParamsMap, headers: headersMap, body: serializeJson(serializeUpdateFolderUpdateSharedLinkRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFolderFull(deserializeJson(response.text)); } - async updateFolderRemoveSharedLink(folderId: string, requestBody: UpdateFolderRemoveSharedLinkRequestBodyArg, queryParams: UpdateFolderRemoveSharedLinkQueryParamsArg, headers: UpdateFolderRemoveSharedLinkHeadersArg = new UpdateFolderRemoveSharedLinkHeadersArg({})): Promise { + async updateFolderRemoveSharedLink(folderId: string, requestBody: UpdateFolderRemoveSharedLinkRequestBodyArg = {} satisfies UpdateFolderRemoveSharedLinkRequestBodyArg, queryParams: UpdateFolderRemoveSharedLinkQueryParamsArg, headers: UpdateFolderRemoveSharedLinkHeadersArg = new UpdateFolderRemoveSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -186,22 +186,22 @@ export function deserializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFiel throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField): Json { - return { ["can_download"]: val.canDownload, ["can_preview"]: val.canPreview, ["can_edit"]: val.canEdit }; + return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload, ["can_preview"]: val.canPreview == void 0 ? void 0 : val.canPreview, ["can_edit"]: val.canEdit == void 0 ? void 0 : val.canEdit }; } export function deserializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField { - const canDownload: undefined | boolean = isJson(val.can_download, "boolean") ? val.can_download : void 0; - const canPreview: undefined | boolean = isJson(val.can_preview, "boolean") ? val.can_preview : void 0; - const canEdit: undefined | boolean = isJson(val.can_edit, "boolean") ? val.can_edit : void 0; + const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download; + const canPreview: undefined | boolean = val.can_preview == void 0 ? void 0 : val.can_preview; + const canEdit: undefined | boolean = val.can_edit == void 0 ? void 0 : val.can_edit; return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies UpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField; } export function serializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkField(val: UpdateFolderAddSharedLinkRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; + return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(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 : serializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; } export function deserializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkField(val: any): UpdateFolderAddSharedLinkRequestBodyArgSharedLinkField { const access: undefined | UpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const permissions: undefined | UpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFolderAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateFolderAddSharedLinkRequestBodyArgSharedLinkField; } @@ -231,22 +231,22 @@ export function deserializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkF throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField): Json { - return { ["can_download"]: val.canDownload, ["can_preview"]: val.canPreview, ["can_edit"]: val.canEdit }; + return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload, ["can_preview"]: val.canPreview == void 0 ? void 0 : val.canPreview, ["can_edit"]: val.canEdit == void 0 ? void 0 : val.canEdit }; } export function deserializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField { - const canDownload: undefined | boolean = isJson(val.can_download, "boolean") ? val.can_download : void 0; - const canPreview: undefined | boolean = isJson(val.can_preview, "boolean") ? val.can_preview : void 0; - const canEdit: undefined | boolean = isJson(val.can_edit, "boolean") ? val.can_edit : void 0; + const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download; + const canPreview: undefined | boolean = val.can_preview == void 0 ? void 0 : val.can_preview; + const canEdit: undefined | boolean = val.can_edit == void 0 ? void 0 : val.can_edit; return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies UpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField; } export function serializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkField(val: UpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; + return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(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 : serializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; } export function deserializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkField(val: any): UpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkField { const access: undefined | UpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const permissions: undefined | UpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateFolderUpdateSharedLinkRequestBodyArgSharedLinkField; } diff --git a/src/managers/sharedLinksWebLinks.generated.ts b/src/managers/sharedLinksWebLinks.generated.ts index e4273d3d..bc393be4 100644 --- a/src/managers/sharedLinksWebLinks.generated.ts +++ b/src/managers/sharedLinksWebLinks.generated.ts @@ -136,7 +136,7 @@ export class SharedLinksWebLinksManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/web_links/", webLinkId, "#get_shared_link") as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeWebLink(deserializeJson(response.text)); } - async updateWebLinkAddSharedLink(webLinkId: string, requestBody: UpdateWebLinkAddSharedLinkRequestBodyArg, queryParams: UpdateWebLinkAddSharedLinkQueryParamsArg, headers: UpdateWebLinkAddSharedLinkHeadersArg = new UpdateWebLinkAddSharedLinkHeadersArg({})): Promise { + async updateWebLinkAddSharedLink(webLinkId: string, requestBody: UpdateWebLinkAddSharedLinkRequestBodyArg = {} satisfies UpdateWebLinkAddSharedLinkRequestBodyArg, queryParams: UpdateWebLinkAddSharedLinkQueryParamsArg, headers: UpdateWebLinkAddSharedLinkHeadersArg = new UpdateWebLinkAddSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -146,7 +146,7 @@ export class SharedLinksWebLinksManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/web_links/", webLinkId, "#add_shared_link") as string, { method: "PUT", params: queryParamsMap, headers: headersMap, body: serializeJson(serializeUpdateWebLinkAddSharedLinkRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeWebLink(deserializeJson(response.text)); } - async updateWebLinkUpdateSharedLink(webLinkId: string, requestBody: UpdateWebLinkUpdateSharedLinkRequestBodyArg, queryParams: UpdateWebLinkUpdateSharedLinkQueryParamsArg, headers: UpdateWebLinkUpdateSharedLinkHeadersArg = new UpdateWebLinkUpdateSharedLinkHeadersArg({})): Promise { + async updateWebLinkUpdateSharedLink(webLinkId: string, requestBody: UpdateWebLinkUpdateSharedLinkRequestBodyArg = {} satisfies UpdateWebLinkUpdateSharedLinkRequestBodyArg, queryParams: UpdateWebLinkUpdateSharedLinkQueryParamsArg, headers: UpdateWebLinkUpdateSharedLinkHeadersArg = new UpdateWebLinkUpdateSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -156,7 +156,7 @@ export class SharedLinksWebLinksManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/web_links/", webLinkId, "#update_shared_link") as string, { method: "PUT", params: queryParamsMap, headers: headersMap, body: serializeJson(serializeUpdateWebLinkUpdateSharedLinkRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeWebLink(deserializeJson(response.text)); } - async updateWebLinkRemoveSharedLink(webLinkId: string, requestBody: UpdateWebLinkRemoveSharedLinkRequestBodyArg, queryParams: UpdateWebLinkRemoveSharedLinkQueryParamsArg, headers: UpdateWebLinkRemoveSharedLinkHeadersArg = new UpdateWebLinkRemoveSharedLinkHeadersArg({})): Promise { + async updateWebLinkRemoveSharedLink(webLinkId: string, requestBody: UpdateWebLinkRemoveSharedLinkRequestBodyArg = {} satisfies UpdateWebLinkRemoveSharedLinkRequestBodyArg, queryParams: UpdateWebLinkRemoveSharedLinkQueryParamsArg, headers: UpdateWebLinkRemoveSharedLinkHeadersArg = new UpdateWebLinkRemoveSharedLinkHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -186,22 +186,22 @@ export function deserializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFie throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField): Json { - return { ["can_download"]: val.canDownload, ["can_preview"]: val.canPreview, ["can_edit"]: val.canEdit }; + return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload, ["can_preview"]: val.canPreview == void 0 ? void 0 : val.canPreview, ["can_edit"]: val.canEdit == void 0 ? void 0 : val.canEdit }; } export function deserializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField { - const canDownload: undefined | boolean = isJson(val.can_download, "boolean") ? val.can_download : void 0; - const canPreview: undefined | boolean = isJson(val.can_preview, "boolean") ? val.can_preview : void 0; - const canEdit: undefined | boolean = isJson(val.can_edit, "boolean") ? val.can_edit : void 0; + const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download; + const canPreview: undefined | boolean = val.can_preview == void 0 ? void 0 : val.can_preview; + const canEdit: undefined | boolean = val.can_edit == void 0 ? void 0 : val.can_edit; return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies UpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField; } export function serializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkField(val: UpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; + return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(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 : serializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; } export function deserializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkField(val: any): UpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkField { const access: undefined | UpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const permissions: undefined | UpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateWebLinkAddSharedLinkRequestBodyArgSharedLinkField; } @@ -231,22 +231,22 @@ export function deserializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLink throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: UpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField): Json { - return { ["can_download"]: val.canDownload, ["can_preview"]: val.canPreview, ["can_edit"]: val.canEdit }; + return { ["can_download"]: val.canDownload == void 0 ? void 0 : val.canDownload, ["can_preview"]: val.canPreview == void 0 ? void 0 : val.canPreview, ["can_edit"]: val.canEdit == void 0 ? void 0 : val.canEdit }; } export function deserializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val: any): UpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField { - const canDownload: undefined | boolean = isJson(val.can_download, "boolean") ? val.can_download : void 0; - const canPreview: undefined | boolean = isJson(val.can_preview, "boolean") ? val.can_preview : void 0; - const canEdit: undefined | boolean = isJson(val.can_edit, "boolean") ? val.can_edit : void 0; + const canDownload: undefined | boolean = val.can_download == void 0 ? void 0 : val.can_download; + const canPreview: undefined | boolean = val.can_preview == void 0 ? void 0 : val.can_preview; + const canEdit: undefined | boolean = val.can_edit == void 0 ? void 0 : val.can_edit; return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies UpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField; } export function serializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkField(val: UpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt, ["permissions"]: val.permissions == void 0 ? void 0 : serializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; + return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(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 : serializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions) }; } export function deserializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkField(val: any): UpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkField { const access: undefined | UpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const permissions: undefined | UpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeUpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkFieldPermissionsField(val.permissions); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions } satisfies UpdateWebLinkUpdateSharedLinkRequestBodyArgSharedLinkField; } diff --git a/src/managers/shieldInformationBarrierReports.generated.ts b/src/managers/shieldInformationBarrierReports.generated.ts index eb1f5987..8f1e95e0 100644 --- a/src/managers/shieldInformationBarrierReports.generated.ts +++ b/src/managers/shieldInformationBarrierReports.generated.ts @@ -16,8 +16,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; +import { Json } from "../json.js"; export interface GetShieldInformationBarrierReportsQueryParamsArg { readonly shieldInformationBarrierId: string; readonly marker?: string; diff --git a/src/managers/shieldInformationBarrierSegmentMembers.generated.ts b/src/managers/shieldInformationBarrierSegmentMembers.generated.ts index d67b4a8c..f8e03632 100644 --- a/src/managers/shieldInformationBarrierSegmentMembers.generated.ts +++ b/src/managers/shieldInformationBarrierSegmentMembers.generated.ts @@ -134,10 +134,10 @@ export function deserializeCreateShieldInformationBarrierSegmentMemberRequestBod throw "".concat("Invalid value: ", val) as string; } export function serializeCreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentField(val: CreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentFieldTypeField(val.type) }; } export function deserializeCreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentField(val: any): CreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentFieldTypeField(val.type); return { id: id, type: type } satisfies CreateShieldInformationBarrierSegmentMemberRequestBodyArgShieldInformationBarrierSegmentField; } diff --git a/src/managers/shieldInformationBarrierSegmentRestrictions.generated.ts b/src/managers/shieldInformationBarrierSegmentRestrictions.generated.ts index 91403293..22b5e352 100644 --- a/src/managers/shieldInformationBarrierSegmentRestrictions.generated.ts +++ b/src/managers/shieldInformationBarrierSegmentRestrictions.generated.ts @@ -136,10 +136,10 @@ export function deserializeCreateShieldInformationBarrierSegmentRestrictionReque throw "".concat("Invalid value: ", val) as string; } export function serializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentField(val: CreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentFieldTypeField(val.type) }; } export function deserializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentField(val: any): CreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentFieldTypeField(val.type); return { id: id, type: type } satisfies CreateShieldInformationBarrierSegmentRestrictionRequestBodyArgShieldInformationBarrierSegmentField; } @@ -156,10 +156,10 @@ export function deserializeCreateShieldInformationBarrierSegmentRestrictionReque throw "".concat("Invalid value: ", val) as string; } export function serializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentField(val: CreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentFieldTypeField(val.type) }; } export function deserializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentField(val: any): CreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentFieldTypeField(val.type); return { id: id, type: type } satisfies CreateShieldInformationBarrierSegmentRestrictionRequestBodyArgRestrictedSegmentField; } diff --git a/src/managers/shieldInformationBarrierSegments.generated.ts b/src/managers/shieldInformationBarrierSegments.generated.ts index 592b2be0..38e5f0ed 100644 --- a/src/managers/shieldInformationBarrierSegments.generated.ts +++ b/src/managers/shieldInformationBarrierSegments.generated.ts @@ -18,7 +18,6 @@ import { FetchResponse } from "../fetch.js"; import { deserializeJson } from "../json.js"; import { Json } from "../json.js"; import { serializeJson } from "../json.js"; -import { isJson } from "../json.js"; export class GetShieldInformationBarrierSegmentByIdHeadersArg { readonly extraHeaders?: { readonly [key: string]: undefined | string; @@ -86,7 +85,7 @@ export class ShieldInformationBarrierSegmentsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/shield_information_barrier_segments/", shieldInformationBarrierSegmentId) as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeShieldInformationBarrierSegment(deserializeJson(response.text)); } - async updateShieldInformationBarrierSegmentById(shieldInformationBarrierSegmentId: string, requestBody: UpdateShieldInformationBarrierSegmentByIdRequestBodyArg, headers: UpdateShieldInformationBarrierSegmentByIdHeadersArg = new UpdateShieldInformationBarrierSegmentByIdHeadersArg({})): Promise { + async updateShieldInformationBarrierSegmentById(shieldInformationBarrierSegmentId: string, requestBody: UpdateShieldInformationBarrierSegmentByIdRequestBodyArg = {} satisfies UpdateShieldInformationBarrierSegmentByIdRequestBodyArg, headers: UpdateShieldInformationBarrierSegmentByIdHeadersArg = new UpdateShieldInformationBarrierSegmentByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -119,19 +118,19 @@ export class ShieldInformationBarrierSegmentsManager { } } export function serializeUpdateShieldInformationBarrierSegmentByIdRequestBodyArg(val: UpdateShieldInformationBarrierSegmentByIdRequestBodyArg): Json { - return { ["name"]: val.name, ["description"]: val.description }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["description"]: val.description == void 0 ? void 0 : val.description }; } export function deserializeUpdateShieldInformationBarrierSegmentByIdRequestBodyArg(val: any): UpdateShieldInformationBarrierSegmentByIdRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; return { name: name, description: description } satisfies UpdateShieldInformationBarrierSegmentByIdRequestBodyArg; } export function serializeCreateShieldInformationBarrierSegmentRequestBodyArg(val: CreateShieldInformationBarrierSegmentRequestBodyArg): Json { - return { ["shield_information_barrier"]: serializeShieldInformationBarrierBase(val.shieldInformationBarrier), ["name"]: val.name, ["description"]: val.description }; + return { ["shield_information_barrier"]: serializeShieldInformationBarrierBase(val.shieldInformationBarrier), ["name"]: val.name, ["description"]: val.description == void 0 ? void 0 : val.description }; } export function deserializeCreateShieldInformationBarrierSegmentRequestBodyArg(val: any): CreateShieldInformationBarrierSegmentRequestBodyArg { const shieldInformationBarrier: ShieldInformationBarrierBase = deserializeShieldInformationBarrierBase(val.shield_information_barrier); const name: string = val.name; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; return { shieldInformationBarrier: shieldInformationBarrier, name: name, description: description } satisfies CreateShieldInformationBarrierSegmentRequestBodyArg; } diff --git a/src/managers/skills.generated.ts b/src/managers/skills.generated.ts index a2f534ac..a3d46f02 100644 --- a/src/managers/skills.generated.ts +++ b/src/managers/skills.generated.ts @@ -38,6 +38,20 @@ export class CreateFileMetadataGlobalBoxSkillsCardHeadersArg { Object.assign(this, fields); } } +export type UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField = "replace"; +export interface UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg { + readonly op?: UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField; + readonly path?: string; + readonly value?: KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard; +} +export class UpdateFileMetadataGlobalBoxSkillsCardHeadersArg { + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor(fields: UpdateFileMetadataGlobalBoxSkillsCardHeadersArg) { + Object.assign(this, fields); + } +} export class DeleteFileMetadataGlobalBoxSkillsCardHeadersArg { readonly extraHeaders?: { readonly [key: string]: undefined | string; @@ -82,7 +96,7 @@ export class UpdateSkillInvocationByIdHeadersArg { export class SkillsManager { readonly auth?: Authentication; readonly networkSession?: NetworkSession; - constructor(fields: Omit) { + constructor(fields: Omit) { Object.assign(this, fields); } async getFileMetadataGlobalBoxSkillsCards(fileId: string, headers: GetFileMetadataGlobalBoxSkillsCardsHeadersArg = new GetFileMetadataGlobalBoxSkillsCardsHeadersArg({})): Promise { @@ -99,6 +113,13 @@ export class SkillsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/metadata/global/boxSkillsCards") as string, { method: "POST", headers: headersMap, body: serializeJson(serializeCreateFileMetadataGlobalBoxSkillsCardRequestBodyArg(requestBody)), contentType: "application/json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeSkillCardsMetadata(deserializeJson(response.text)); } + async updateFileMetadataGlobalBoxSkillsCard(fileId: string, requestBody: readonly UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg[], headers: UpdateFileMetadataGlobalBoxSkillsCardHeadersArg = new UpdateFileMetadataGlobalBoxSkillsCardHeadersArg({})): Promise { + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/files/", fileId, "/metadata/global/boxSkillsCards") as string, { method: "PUT", headers: headersMap, body: serializeJson(requestBody.map(serializeUpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg) as readonly any[]), contentType: "application/json-patch+json", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + return deserializeSkillCardsMetadata(deserializeJson(response.text)); + } async deleteFileMetadataGlobalBoxSkillsCard(fileId: string, headers: DeleteFileMetadataGlobalBoxSkillsCardHeadersArg = new DeleteFileMetadataGlobalBoxSkillsCardHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; @@ -120,11 +141,32 @@ export function serializeCreateFileMetadataGlobalBoxSkillsCardRequestBodyArg(val }) as readonly any[] }; } export function deserializeCreateFileMetadataGlobalBoxSkillsCardRequestBodyArg(val: any): CreateFileMetadataGlobalBoxSkillsCardRequestBodyArg { - const cards: readonly KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard[] = val.cards.map(function (itm: Json): any { + const cards: readonly KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard[] = isJson(val.cards, "array") ? val.cards.map(function (itm: Json): any { return deserializeKeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { cards: cards } satisfies CreateFileMetadataGlobalBoxSkillsCardRequestBodyArg; } +export function serializeUpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField(val: UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField): Json { + return val; +} +export function deserializeUpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField(val: any): UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField\""; + } + if (val == "replace") { + return "replace"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeUpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg(val: UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg): Json { + return { ["op"]: val.op == void 0 ? void 0 : serializeUpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField(val.op), ["path"]: val.path == void 0 ? void 0 : val.path, ["value"]: val.value == void 0 ? void 0 : serializeKeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard(val.value) }; +} +export function deserializeUpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg(val: any): UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg { + const op: undefined | UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField = val.op == void 0 ? void 0 : deserializeUpdateFileMetadataGlobalBoxSkillsCardRequestBodyArgOpField(val.op); + const path: undefined | string = val.path == void 0 ? void 0 : val.path; + const value: undefined | KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard = val.value == void 0 ? void 0 : deserializeKeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard(val.value); + return { op: op, path: path, value: value } satisfies UpdateFileMetadataGlobalBoxSkillsCardRequestBodyArg; +} export function serializeUpdateSkillInvocationByIdRequestBodyArgStatusField(val: UpdateSkillInvocationByIdRequestBodyArgStatusField): Json { return val; } @@ -155,9 +197,9 @@ export function serializeUpdateSkillInvocationByIdRequestBodyArgMetadataField(va }) as readonly any[] }; } export function deserializeUpdateSkillInvocationByIdRequestBodyArgMetadataField(val: any): UpdateSkillInvocationByIdRequestBodyArgMetadataField { - const cards: undefined | readonly KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard[] = isJson(val.cards, "array") ? val.cards.map(function (itm: Json): any { + const cards: undefined | readonly KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard[] = val.cards == void 0 ? void 0 : isJson(val.cards, "array") ? val.cards.map(function (itm: Json): any { return deserializeKeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { cards: cards } satisfies UpdateSkillInvocationByIdRequestBodyArgMetadataField; } export function serializeUpdateSkillInvocationByIdRequestBodyArgFileFieldTypeField(val: UpdateSkillInvocationByIdRequestBodyArgFileFieldTypeField): Json { @@ -173,11 +215,11 @@ export function deserializeUpdateSkillInvocationByIdRequestBodyArgFileFieldTypeF throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateSkillInvocationByIdRequestBodyArgFileField(val: UpdateSkillInvocationByIdRequestBodyArgFileField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeUpdateSkillInvocationByIdRequestBodyArgFileFieldTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeUpdateSkillInvocationByIdRequestBodyArgFileFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeUpdateSkillInvocationByIdRequestBodyArgFileField(val: any): UpdateSkillInvocationByIdRequestBodyArgFileField { const type: undefined | UpdateSkillInvocationByIdRequestBodyArgFileFieldTypeField = val.type == void 0 ? void 0 : deserializeUpdateSkillInvocationByIdRequestBodyArgFileFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies UpdateSkillInvocationByIdRequestBodyArgFileField; } export function serializeUpdateSkillInvocationByIdRequestBodyArgFileVersionFieldTypeField(val: UpdateSkillInvocationByIdRequestBodyArgFileVersionFieldTypeField): Json { @@ -193,19 +235,19 @@ export function deserializeUpdateSkillInvocationByIdRequestBodyArgFileVersionFie throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateSkillInvocationByIdRequestBodyArgFileVersionField(val: UpdateSkillInvocationByIdRequestBodyArgFileVersionField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeUpdateSkillInvocationByIdRequestBodyArgFileVersionFieldTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeUpdateSkillInvocationByIdRequestBodyArgFileVersionFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeUpdateSkillInvocationByIdRequestBodyArgFileVersionField(val: any): UpdateSkillInvocationByIdRequestBodyArgFileVersionField { const type: undefined | UpdateSkillInvocationByIdRequestBodyArgFileVersionFieldTypeField = val.type == void 0 ? void 0 : deserializeUpdateSkillInvocationByIdRequestBodyArgFileVersionFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies UpdateSkillInvocationByIdRequestBodyArgFileVersionField; } export function serializeUpdateSkillInvocationByIdRequestBodyArgUsageField(val: UpdateSkillInvocationByIdRequestBodyArgUsageField): Json { - return { ["unit"]: val.unit, ["value"]: val.value }; + return { ["unit"]: val.unit == void 0 ? void 0 : val.unit, ["value"]: val.value == void 0 ? void 0 : val.value }; } export function deserializeUpdateSkillInvocationByIdRequestBodyArgUsageField(val: any): UpdateSkillInvocationByIdRequestBodyArgUsageField { - const unit: undefined | string = isJson(val.unit, "string") ? val.unit : void 0; - const value: undefined | number = isJson(val.value, "number") ? val.value : void 0; + const unit: undefined | string = val.unit == void 0 ? void 0 : val.unit; + const value: undefined | number = val.value == void 0 ? void 0 : val.value; return { unit: unit, value: value } satisfies UpdateSkillInvocationByIdRequestBodyArgUsageField; } export function serializeUpdateSkillInvocationByIdRequestBodyArg(val: UpdateSkillInvocationByIdRequestBodyArg): Json { diff --git a/src/managers/taskAssignments.generated.ts b/src/managers/taskAssignments.generated.ts index efd3a064..8605c435 100644 --- a/src/managers/taskAssignments.generated.ts +++ b/src/managers/taskAssignments.generated.ts @@ -104,7 +104,7 @@ export class TaskAssignmentsManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/task_assignments/", taskAssignmentId) as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeTaskAssignment(deserializeJson(response.text)); } - async updateTaskAssignmentById(taskAssignmentId: string, requestBody: UpdateTaskAssignmentByIdRequestBodyArg, headers: UpdateTaskAssignmentByIdHeadersArg = new UpdateTaskAssignmentByIdHeadersArg({})): Promise { + async updateTaskAssignmentById(taskAssignmentId: string, requestBody: UpdateTaskAssignmentByIdRequestBodyArg = {} satisfies UpdateTaskAssignmentByIdRequestBodyArg, headers: UpdateTaskAssignmentByIdHeadersArg = new UpdateTaskAssignmentByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -140,11 +140,11 @@ export function deserializeCreateTaskAssignmentRequestBodyArgTaskField(val: any) return { id: id, type: type } satisfies CreateTaskAssignmentRequestBodyArgTaskField; } export function serializeCreateTaskAssignmentRequestBodyArgAssignToField(val: CreateTaskAssignmentRequestBodyArgAssignToField): Json { - return { ["id"]: val.id, ["login"]: val.login }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["login"]: val.login == void 0 ? void 0 : val.login }; } export function deserializeCreateTaskAssignmentRequestBodyArgAssignToField(val: any): CreateTaskAssignmentRequestBodyArgAssignToField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; return { id: id, login: login } satisfies CreateTaskAssignmentRequestBodyArgAssignToField; } export function serializeCreateTaskAssignmentRequestBodyArg(val: CreateTaskAssignmentRequestBodyArg): Json { @@ -177,10 +177,10 @@ export function deserializeUpdateTaskAssignmentByIdRequestBodyArgResolutionState throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateTaskAssignmentByIdRequestBodyArg(val: UpdateTaskAssignmentByIdRequestBodyArg): Json { - return { ["message"]: val.message, ["resolution_state"]: val.resolutionState == void 0 ? void 0 : serializeUpdateTaskAssignmentByIdRequestBodyArgResolutionStateField(val.resolutionState) }; + return { ["message"]: val.message == void 0 ? void 0 : val.message, ["resolution_state"]: val.resolutionState == void 0 ? void 0 : serializeUpdateTaskAssignmentByIdRequestBodyArgResolutionStateField(val.resolutionState) }; } export function deserializeUpdateTaskAssignmentByIdRequestBodyArg(val: any): UpdateTaskAssignmentByIdRequestBodyArg { - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; const resolutionState: undefined | UpdateTaskAssignmentByIdRequestBodyArgResolutionStateField = val.resolution_state == void 0 ? void 0 : deserializeUpdateTaskAssignmentByIdRequestBodyArgResolutionStateField(val.resolution_state); return { message: message, resolutionState: resolutionState } satisfies UpdateTaskAssignmentByIdRequestBodyArg; } diff --git a/src/managers/tasks.generated.ts b/src/managers/tasks.generated.ts index bd807de8..7b5aa1bb 100644 --- a/src/managers/tasks.generated.ts +++ b/src/managers/tasks.generated.ts @@ -108,7 +108,7 @@ export class TasksManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/tasks/", taskId) as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeTask(deserializeJson(response.text)); } - async updateTaskById(taskId: string, requestBody: UpdateTaskByIdRequestBodyArg, headers: UpdateTaskByIdHeadersArg = new UpdateTaskByIdHeadersArg({})): Promise { + async updateTaskById(taskId: string, requestBody: UpdateTaskByIdRequestBodyArg = {} satisfies UpdateTaskByIdRequestBodyArg, headers: UpdateTaskByIdHeadersArg = new UpdateTaskByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -136,10 +136,10 @@ export function deserializeCreateTaskRequestBodyArgItemFieldTypeField(val: any): throw "".concat("Invalid value: ", val) as string; } export function serializeCreateTaskRequestBodyArgItemField(val: CreateTaskRequestBodyArgItemField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateTaskRequestBodyArgItemFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateTaskRequestBodyArgItemFieldTypeField(val.type) }; } export function deserializeCreateTaskRequestBodyArgItemField(val: any): CreateTaskRequestBodyArgItemField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CreateTaskRequestBodyArgItemFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateTaskRequestBodyArgItemFieldTypeField(val.type); return { id: id, type: type } satisfies CreateTaskRequestBodyArgItemField; } @@ -174,13 +174,13 @@ export function deserializeCreateTaskRequestBodyArgCompletionRuleField(val: any) throw "".concat("Invalid value: ", val) as string; } export function serializeCreateTaskRequestBodyArg(val: CreateTaskRequestBodyArg): Json { - return { ["item"]: serializeCreateTaskRequestBodyArgItemField(val.item), ["action"]: val.action == void 0 ? void 0 : serializeCreateTaskRequestBodyArgActionField(val.action), ["message"]: val.message, ["due_at"]: val.dueAt, ["completion_rule"]: val.completionRule == void 0 ? void 0 : serializeCreateTaskRequestBodyArgCompletionRuleField(val.completionRule) }; + return { ["item"]: serializeCreateTaskRequestBodyArgItemField(val.item), ["action"]: val.action == void 0 ? void 0 : serializeCreateTaskRequestBodyArgActionField(val.action), ["message"]: val.message == void 0 ? void 0 : val.message, ["due_at"]: val.dueAt == void 0 ? void 0 : val.dueAt, ["completion_rule"]: val.completionRule == void 0 ? void 0 : serializeCreateTaskRequestBodyArgCompletionRuleField(val.completionRule) }; } export function deserializeCreateTaskRequestBodyArg(val: any): CreateTaskRequestBodyArg { const item: CreateTaskRequestBodyArgItemField = deserializeCreateTaskRequestBodyArgItemField(val.item); const action: undefined | CreateTaskRequestBodyArgActionField = val.action == void 0 ? void 0 : deserializeCreateTaskRequestBodyArgActionField(val.action); - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; - const dueAt: undefined | string = isJson(val.due_at, "string") ? val.due_at : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; + const dueAt: undefined | string = val.due_at == void 0 ? void 0 : val.due_at; const completionRule: undefined | CreateTaskRequestBodyArgCompletionRuleField = val.completion_rule == void 0 ? void 0 : deserializeCreateTaskRequestBodyArgCompletionRuleField(val.completion_rule); return { item: item, action: action, message: message, dueAt: dueAt, completionRule: completionRule } satisfies CreateTaskRequestBodyArg; } @@ -215,12 +215,12 @@ export function deserializeUpdateTaskByIdRequestBodyArgCompletionRuleField(val: throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateTaskByIdRequestBodyArg(val: UpdateTaskByIdRequestBodyArg): Json { - return { ["action"]: val.action == void 0 ? void 0 : serializeUpdateTaskByIdRequestBodyArgActionField(val.action), ["message"]: val.message, ["due_at"]: val.dueAt, ["completion_rule"]: val.completionRule == void 0 ? void 0 : serializeUpdateTaskByIdRequestBodyArgCompletionRuleField(val.completionRule) }; + return { ["action"]: val.action == void 0 ? void 0 : serializeUpdateTaskByIdRequestBodyArgActionField(val.action), ["message"]: val.message == void 0 ? void 0 : val.message, ["due_at"]: val.dueAt == void 0 ? void 0 : val.dueAt, ["completion_rule"]: val.completionRule == void 0 ? void 0 : serializeUpdateTaskByIdRequestBodyArgCompletionRuleField(val.completionRule) }; } export function deserializeUpdateTaskByIdRequestBodyArg(val: any): UpdateTaskByIdRequestBodyArg { const action: undefined | UpdateTaskByIdRequestBodyArgActionField = val.action == void 0 ? void 0 : deserializeUpdateTaskByIdRequestBodyArgActionField(val.action); - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; - const dueAt: undefined | string = isJson(val.due_at, "string") ? val.due_at : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; + const dueAt: undefined | string = val.due_at == void 0 ? void 0 : val.due_at; const completionRule: undefined | UpdateTaskByIdRequestBodyArgCompletionRuleField = val.completion_rule == void 0 ? void 0 : deserializeUpdateTaskByIdRequestBodyArgCompletionRuleField(val.completion_rule); return { action: action, message: message, dueAt: dueAt, completionRule: completionRule } satisfies UpdateTaskByIdRequestBodyArg; } diff --git a/src/managers/transfer.generated.ts b/src/managers/transfer.generated.ts index 5fb9a3bc..8594a24b 100644 --- a/src/managers/transfer.generated.ts +++ b/src/managers/transfer.generated.ts @@ -13,8 +13,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; +import { Json } from "../json.js"; export interface TransferOwnedFolderRequestBodyArgOwnedByField { readonly id: string; } diff --git a/src/managers/trashedFiles.generated.ts b/src/managers/trashedFiles.generated.ts index 513e4336..f7a1c10f 100644 --- a/src/managers/trashedFiles.generated.ts +++ b/src/managers/trashedFiles.generated.ts @@ -16,9 +16,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; -import { isJson } from "../json.js"; +import { Json } from "../json.js"; export interface RestoreFileFromTrashRequestBodyArgParentField { readonly id?: string; } @@ -62,7 +61,7 @@ export class TrashedFilesManager { constructor(fields: Omit) { Object.assign(this, fields); } - async restoreFileFromTrash(fileId: string, requestBody: RestoreFileFromTrashRequestBodyArg, queryParams: RestoreFileFromTrashQueryParamsArg = {} satisfies RestoreFileFromTrashQueryParamsArg, headers: RestoreFileFromTrashHeadersArg = new RestoreFileFromTrashHeadersArg({})): Promise { + async restoreFileFromTrash(fileId: string, requestBody: RestoreFileFromTrashRequestBodyArg = {} satisfies RestoreFileFromTrashRequestBodyArg, queryParams: RestoreFileFromTrashQueryParamsArg = {} satisfies RestoreFileFromTrashQueryParamsArg, headers: RestoreFileFromTrashHeadersArg = new RestoreFileFromTrashHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -91,17 +90,17 @@ export class TrashedFilesManager { } } export function serializeRestoreFileFromTrashRequestBodyArgParentField(val: RestoreFileFromTrashRequestBodyArgParentField): Json { - return { ["id"]: val.id }; + return { ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeRestoreFileFromTrashRequestBodyArgParentField(val: any): RestoreFileFromTrashRequestBodyArgParentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { id: id } satisfies RestoreFileFromTrashRequestBodyArgParentField; } export function serializeRestoreFileFromTrashRequestBodyArg(val: RestoreFileFromTrashRequestBodyArg): Json { - return { ["name"]: val.name, ["parent"]: val.parent == void 0 ? void 0 : serializeRestoreFileFromTrashRequestBodyArgParentField(val.parent) }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["parent"]: val.parent == void 0 ? void 0 : serializeRestoreFileFromTrashRequestBodyArgParentField(val.parent) }; } export function deserializeRestoreFileFromTrashRequestBodyArg(val: any): RestoreFileFromTrashRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const parent: undefined | RestoreFileFromTrashRequestBodyArgParentField = val.parent == void 0 ? void 0 : deserializeRestoreFileFromTrashRequestBodyArgParentField(val.parent); return { name: name, parent: parent } satisfies RestoreFileFromTrashRequestBodyArg; } diff --git a/src/managers/trashedFolders.generated.ts b/src/managers/trashedFolders.generated.ts index b64b7ccc..40c344a3 100644 --- a/src/managers/trashedFolders.generated.ts +++ b/src/managers/trashedFolders.generated.ts @@ -16,9 +16,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; -import { isJson } from "../json.js"; +import { Json } from "../json.js"; export interface RestoreFolderFromTrashRequestBodyArgParentField { readonly id?: string; } @@ -62,7 +61,7 @@ export class TrashedFoldersManager { constructor(fields: Omit) { Object.assign(this, fields); } - async restoreFolderFromTrash(folderId: string, requestBody: RestoreFolderFromTrashRequestBodyArg, queryParams: RestoreFolderFromTrashQueryParamsArg = {} satisfies RestoreFolderFromTrashQueryParamsArg, headers: RestoreFolderFromTrashHeadersArg = new RestoreFolderFromTrashHeadersArg({})): Promise { + async restoreFolderFromTrash(folderId: string, requestBody: RestoreFolderFromTrashRequestBodyArg = {} satisfies RestoreFolderFromTrashRequestBodyArg, queryParams: RestoreFolderFromTrashQueryParamsArg = {} satisfies RestoreFolderFromTrashQueryParamsArg, headers: RestoreFolderFromTrashHeadersArg = new RestoreFolderFromTrashHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -91,17 +90,17 @@ export class TrashedFoldersManager { } } export function serializeRestoreFolderFromTrashRequestBodyArgParentField(val: RestoreFolderFromTrashRequestBodyArgParentField): Json { - return { ["id"]: val.id }; + return { ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeRestoreFolderFromTrashRequestBodyArgParentField(val: any): RestoreFolderFromTrashRequestBodyArgParentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { id: id } satisfies RestoreFolderFromTrashRequestBodyArgParentField; } export function serializeRestoreFolderFromTrashRequestBodyArg(val: RestoreFolderFromTrashRequestBodyArg): Json { - return { ["name"]: val.name, ["parent"]: val.parent == void 0 ? void 0 : serializeRestoreFolderFromTrashRequestBodyArgParentField(val.parent) }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["parent"]: val.parent == void 0 ? void 0 : serializeRestoreFolderFromTrashRequestBodyArgParentField(val.parent) }; } export function deserializeRestoreFolderFromTrashRequestBodyArg(val: any): RestoreFolderFromTrashRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const parent: undefined | RestoreFolderFromTrashRequestBodyArgParentField = val.parent == void 0 ? void 0 : deserializeRestoreFolderFromTrashRequestBodyArgParentField(val.parent); return { name: name, parent: parent } satisfies RestoreFolderFromTrashRequestBodyArg; } diff --git a/src/managers/trashedWebLinks.generated.ts b/src/managers/trashedWebLinks.generated.ts index 20c96ca0..6896ad40 100644 --- a/src/managers/trashedWebLinks.generated.ts +++ b/src/managers/trashedWebLinks.generated.ts @@ -16,9 +16,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; -import { isJson } from "../json.js"; +import { Json } from "../json.js"; export interface CreateWebLinkByIdRequestBodyArgParentField { readonly id?: string; } @@ -62,7 +61,7 @@ export class TrashedWebLinksManager { constructor(fields: Omit) { Object.assign(this, fields); } - async createWebLinkById(webLinkId: string, requestBody: CreateWebLinkByIdRequestBodyArg, queryParams: CreateWebLinkByIdQueryParamsArg = {} satisfies CreateWebLinkByIdQueryParamsArg, headers: CreateWebLinkByIdHeadersArg = new CreateWebLinkByIdHeadersArg({})): Promise { + async createWebLinkById(webLinkId: string, requestBody: CreateWebLinkByIdRequestBodyArg = {} satisfies CreateWebLinkByIdRequestBodyArg, queryParams: CreateWebLinkByIdQueryParamsArg = {} satisfies CreateWebLinkByIdQueryParamsArg, headers: CreateWebLinkByIdHeadersArg = new CreateWebLinkByIdHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -91,17 +90,17 @@ export class TrashedWebLinksManager { } } export function serializeCreateWebLinkByIdRequestBodyArgParentField(val: CreateWebLinkByIdRequestBodyArgParentField): Json { - return { ["id"]: val.id }; + return { ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeCreateWebLinkByIdRequestBodyArgParentField(val: any): CreateWebLinkByIdRequestBodyArgParentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { id: id } satisfies CreateWebLinkByIdRequestBodyArgParentField; } export function serializeCreateWebLinkByIdRequestBodyArg(val: CreateWebLinkByIdRequestBodyArg): Json { - return { ["name"]: val.name, ["parent"]: val.parent == void 0 ? void 0 : serializeCreateWebLinkByIdRequestBodyArgParentField(val.parent) }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["parent"]: val.parent == void 0 ? void 0 : serializeCreateWebLinkByIdRequestBodyArgParentField(val.parent) }; } export function deserializeCreateWebLinkByIdRequestBodyArg(val: any): CreateWebLinkByIdRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const parent: undefined | CreateWebLinkByIdRequestBodyArgParentField = val.parent == void 0 ? void 0 : deserializeCreateWebLinkByIdRequestBodyArgParentField(val.parent); return { name: name, parent: parent } satisfies CreateWebLinkByIdRequestBodyArg; } diff --git a/src/managers/uploads.generated.ts b/src/managers/uploads.generated.ts index 0984ec6d..c4121e1d 100644 --- a/src/managers/uploads.generated.ts +++ b/src/managers/uploads.generated.ts @@ -20,9 +20,8 @@ import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { MultipartItem } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; -import { isJson } from "../json.js"; +import { Json } from "../json.js"; export interface UploadFileVersionRequestBodyArgAttributesField { readonly name: string; readonly contentModifiedAt?: string; @@ -102,7 +101,7 @@ export class UploadsManager { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{ ["if-match"]: toString(headers.ifMatch), ["content-md5"]: toString(headers.contentMd5) }, ...headers.extraHeaders }); - const response: FetchResponse = await fetch("".concat("https://upload.box.com/api/2.0/files/", fileId, "/content") as string, { method: "POST", params: queryParamsMap, headers: headersMap, multipartData: [{ partName: "attributes", body: serializeJson(serializeUploadFileVersionRequestBodyArgAttributesField(requestBody.attributes)) } satisfies MultipartItem, { partName: "file", fileStream: requestBody.file, contentType: requestBody.fileContentType, fileName: requestBody.fileFileName } satisfies MultipartItem], contentType: "multipart/form-data", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + const response: FetchResponse = await fetch("".concat("https://upload.box.com/api/2.0/files/", fileId, "/content") as string, { method: "POST", params: queryParamsMap, headers: headersMap, multipartData: [{ partName: "attributes", body: serializeJson(serializeUploadFileVersionRequestBodyArgAttributesField(requestBody.attributes)) } satisfies MultipartItem, { partName: "file", fileStream: requestBody.file, fileName: requestBody.fileFileName, contentType: requestBody.fileContentType } satisfies MultipartItem], contentType: "multipart/form-data", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFiles(deserializeJson(response.text)); } async uploadFile(requestBody: UploadFileRequestBodyArg, queryParams: UploadFileQueryParamsArg = {} satisfies UploadFileQueryParamsArg, headers: UploadFileHeadersArg = new UploadFileHeadersArg({})): Promise { @@ -112,10 +111,10 @@ export class UploadsManager { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{ ["content-md5"]: toString(headers.contentMd5) }, ...headers.extraHeaders }); - const response: FetchResponse = await fetch("".concat("https://upload.box.com/api/2.0/files/content") as string, { method: "POST", params: queryParamsMap, headers: headersMap, multipartData: [{ partName: "attributes", body: serializeJson(serializeUploadFileRequestBodyArgAttributesField(requestBody.attributes)) } satisfies MultipartItem, { partName: "file", fileStream: requestBody.file, contentType: requestBody.fileContentType, fileName: requestBody.fileFileName } satisfies MultipartItem], contentType: "multipart/form-data", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; + const response: FetchResponse = await fetch("".concat("https://upload.box.com/api/2.0/files/content") as string, { method: "POST", params: queryParamsMap, headers: headersMap, multipartData: [{ partName: "attributes", body: serializeJson(serializeUploadFileRequestBodyArgAttributesField(requestBody.attributes)) } satisfies MultipartItem, { partName: "file", fileStream: requestBody.file, fileName: requestBody.fileFileName, contentType: requestBody.fileContentType } satisfies MultipartItem], contentType: "multipart/form-data", responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeFiles(deserializeJson(response.text)); } - async preflightFileUpload(requestBody: PreflightFileUploadRequestBodyArg, headers: PreflightFileUploadHeadersArg = new PreflightFileUploadHeadersArg({})): Promise { + async preflightFileUpload(requestBody: PreflightFileUploadRequestBodyArg = {} satisfies PreflightFileUploadRequestBodyArg, headers: PreflightFileUploadHeadersArg = new PreflightFileUploadHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -124,11 +123,11 @@ export class UploadsManager { } } export function serializeUploadFileVersionRequestBodyArgAttributesField(val: UploadFileVersionRequestBodyArgAttributesField): Json { - return { ["name"]: val.name, ["content_modified_at"]: val.contentModifiedAt }; + return { ["name"]: val.name, ["content_modified_at"]: val.contentModifiedAt == void 0 ? void 0 : val.contentModifiedAt }; } export function deserializeUploadFileVersionRequestBodyArgAttributesField(val: any): UploadFileVersionRequestBodyArgAttributesField { const name: string = val.name; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; return { name: name, contentModifiedAt: contentModifiedAt } satisfies UploadFileVersionRequestBodyArgAttributesField; } export function serializeUploadFileRequestBodyArgAttributesFieldParentField(val: UploadFileRequestBodyArgAttributesFieldParentField): Json { @@ -139,28 +138,28 @@ export function deserializeUploadFileRequestBodyArgAttributesFieldParentField(va return { id: id } satisfies UploadFileRequestBodyArgAttributesFieldParentField; } export function serializeUploadFileRequestBodyArgAttributesField(val: UploadFileRequestBodyArgAttributesField): Json { - return { ["name"]: val.name, ["parent"]: serializeUploadFileRequestBodyArgAttributesFieldParentField(val.parent), ["content_created_at"]: val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt }; + return { ["name"]: val.name, ["parent"]: serializeUploadFileRequestBodyArgAttributesFieldParentField(val.parent), ["content_created_at"]: val.contentCreatedAt == void 0 ? void 0 : val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt == void 0 ? void 0 : val.contentModifiedAt }; } export function deserializeUploadFileRequestBodyArgAttributesField(val: any): UploadFileRequestBodyArgAttributesField { const name: string = val.name; const parent: UploadFileRequestBodyArgAttributesFieldParentField = deserializeUploadFileRequestBodyArgAttributesFieldParentField(val.parent); - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; return { name: name, parent: parent, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt } satisfies UploadFileRequestBodyArgAttributesField; } export function serializePreflightFileUploadRequestBodyArgParentField(val: PreflightFileUploadRequestBodyArgParentField): Json { - return { ["id"]: val.id }; + return { ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializePreflightFileUploadRequestBodyArgParentField(val: any): PreflightFileUploadRequestBodyArgParentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { id: id } satisfies PreflightFileUploadRequestBodyArgParentField; } export function serializePreflightFileUploadRequestBodyArg(val: PreflightFileUploadRequestBodyArg): Json { - return { ["name"]: val.name, ["size"]: val.size, ["parent"]: val.parent == void 0 ? void 0 : serializePreflightFileUploadRequestBodyArgParentField(val.parent) }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["size"]: val.size == void 0 ? void 0 : val.size, ["parent"]: val.parent == void 0 ? void 0 : serializePreflightFileUploadRequestBodyArgParentField(val.parent) }; } export function deserializePreflightFileUploadRequestBodyArg(val: any): PreflightFileUploadRequestBodyArg { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; const parent: undefined | PreflightFileUploadRequestBodyArgParentField = val.parent == void 0 ? void 0 : deserializePreflightFileUploadRequestBodyArgParentField(val.parent); return { name: name, size: size, parent: parent } satisfies PreflightFileUploadRequestBodyArg; } diff --git a/src/managers/userCollaborations.generated.ts b/src/managers/userCollaborations.generated.ts index 0055b682..f22268de 100644 --- a/src/managers/userCollaborations.generated.ts +++ b/src/managers/userCollaborations.generated.ts @@ -175,13 +175,13 @@ export function deserializeUpdateCollaborationByIdRequestBodyArgStatusField(val: throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateCollaborationByIdRequestBodyArg(val: UpdateCollaborationByIdRequestBodyArg): Json { - return { ["role"]: serializeUpdateCollaborationByIdRequestBodyArgRoleField(val.role), ["status"]: val.status == void 0 ? void 0 : serializeUpdateCollaborationByIdRequestBodyArgStatusField(val.status), ["expires_at"]: val.expiresAt, ["can_view_path"]: val.canViewPath }; + return { ["role"]: serializeUpdateCollaborationByIdRequestBodyArgRoleField(val.role), ["status"]: val.status == void 0 ? void 0 : serializeUpdateCollaborationByIdRequestBodyArgStatusField(val.status), ["expires_at"]: val.expiresAt == void 0 ? void 0 : val.expiresAt, ["can_view_path"]: val.canViewPath == void 0 ? void 0 : val.canViewPath }; } export function deserializeUpdateCollaborationByIdRequestBodyArg(val: any): UpdateCollaborationByIdRequestBodyArg { const role: UpdateCollaborationByIdRequestBodyArgRoleField = deserializeUpdateCollaborationByIdRequestBodyArgRoleField(val.role); const status: undefined | UpdateCollaborationByIdRequestBodyArgStatusField = val.status == void 0 ? void 0 : deserializeUpdateCollaborationByIdRequestBodyArgStatusField(val.status); - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; - const canViewPath: undefined | boolean = isJson(val.can_view_path, "boolean") ? val.can_view_path : void 0; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; + const canViewPath: undefined | boolean = val.can_view_path == void 0 ? void 0 : val.can_view_path; return { role: role, status: status, expiresAt: expiresAt, canViewPath: canViewPath } satisfies UpdateCollaborationByIdRequestBodyArg; } export function serializeCreateCollaborationRequestBodyArgItemFieldTypeField(val: CreateCollaborationRequestBodyArgItemFieldTypeField): Json { @@ -200,11 +200,11 @@ export function deserializeCreateCollaborationRequestBodyArgItemFieldTypeField(v throw "".concat("Invalid value: ", val) as string; } export function serializeCreateCollaborationRequestBodyArgItemField(val: CreateCollaborationRequestBodyArgItemField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeCreateCollaborationRequestBodyArgItemFieldTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeCreateCollaborationRequestBodyArgItemFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeCreateCollaborationRequestBodyArgItemField(val: any): CreateCollaborationRequestBodyArgItemField { const type: undefined | CreateCollaborationRequestBodyArgItemFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateCollaborationRequestBodyArgItemFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies CreateCollaborationRequestBodyArgItemField; } export function serializeCreateCollaborationRequestBodyArgAccessibleByFieldTypeField(val: CreateCollaborationRequestBodyArgAccessibleByFieldTypeField): Json { @@ -223,12 +223,12 @@ export function deserializeCreateCollaborationRequestBodyArgAccessibleByFieldTyp throw "".concat("Invalid value: ", val) as string; } export function serializeCreateCollaborationRequestBodyArgAccessibleByField(val: CreateCollaborationRequestBodyArgAccessibleByField): Json { - return { ["type"]: serializeCreateCollaborationRequestBodyArgAccessibleByFieldTypeField(val.type), ["id"]: val.id, ["login"]: val.login }; + return { ["type"]: serializeCreateCollaborationRequestBodyArgAccessibleByFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id, ["login"]: val.login == void 0 ? void 0 : val.login }; } export function deserializeCreateCollaborationRequestBodyArgAccessibleByField(val: any): CreateCollaborationRequestBodyArgAccessibleByField { const type: CreateCollaborationRequestBodyArgAccessibleByFieldTypeField = deserializeCreateCollaborationRequestBodyArgAccessibleByFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; return { type: type, id: id, login: login } satisfies CreateCollaborationRequestBodyArgAccessibleByField; } export function serializeCreateCollaborationRequestBodyArgRoleField(val: CreateCollaborationRequestBodyArgRoleField): Json { @@ -262,13 +262,13 @@ export function deserializeCreateCollaborationRequestBodyArgRoleField(val: any): throw "".concat("Invalid value: ", val) as string; } export function serializeCreateCollaborationRequestBodyArg(val: CreateCollaborationRequestBodyArg): Json { - return { ["item"]: serializeCreateCollaborationRequestBodyArgItemField(val.item), ["accessible_by"]: serializeCreateCollaborationRequestBodyArgAccessibleByField(val.accessibleBy), ["role"]: serializeCreateCollaborationRequestBodyArgRoleField(val.role), ["can_view_path"]: val.canViewPath, ["expires_at"]: val.expiresAt }; + return { ["item"]: serializeCreateCollaborationRequestBodyArgItemField(val.item), ["accessible_by"]: serializeCreateCollaborationRequestBodyArgAccessibleByField(val.accessibleBy), ["role"]: serializeCreateCollaborationRequestBodyArgRoleField(val.role), ["can_view_path"]: val.canViewPath == void 0 ? void 0 : val.canViewPath, ["expires_at"]: val.expiresAt == void 0 ? void 0 : val.expiresAt }; } export function deserializeCreateCollaborationRequestBodyArg(val: any): CreateCollaborationRequestBodyArg { const item: CreateCollaborationRequestBodyArgItemField = deserializeCreateCollaborationRequestBodyArgItemField(val.item); const accessibleBy: CreateCollaborationRequestBodyArgAccessibleByField = deserializeCreateCollaborationRequestBodyArgAccessibleByField(val.accessible_by); const role: CreateCollaborationRequestBodyArgRoleField = deserializeCreateCollaborationRequestBodyArgRoleField(val.role); - const canViewPath: undefined | boolean = isJson(val.can_view_path, "boolean") ? val.can_view_path : void 0; - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; + const canViewPath: undefined | boolean = val.can_view_path == void 0 ? void 0 : val.can_view_path; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; return { item: item, accessibleBy: accessibleBy, role: role, canViewPath: canViewPath, expiresAt: expiresAt } satisfies CreateCollaborationRequestBodyArg; } diff --git a/src/managers/users.generated.ts b/src/managers/users.generated.ts index 76f8dfe4..88c6312d 100644 --- a/src/managers/users.generated.ts +++ b/src/managers/users.generated.ts @@ -196,7 +196,7 @@ export class UsersManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/users/", userId) as string, { method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeUserFull(deserializeJson(response.text)); } - async updateUserById(userId: string, requestBody: UpdateUserByIdRequestBodyArg, queryParams: UpdateUserByIdQueryParamsArg = {} satisfies UpdateUserByIdQueryParamsArg, headers: UpdateUserByIdHeadersArg = new UpdateUserByIdHeadersArg({})): Promise { + async updateUserById(userId: string, requestBody: UpdateUserByIdRequestBodyArg = {} satisfies UpdateUserByIdRequestBodyArg, queryParams: UpdateUserByIdQueryParamsArg = {} satisfies UpdateUserByIdQueryParamsArg, headers: UpdateUserByIdHeadersArg = new UpdateUserByIdHeadersArg({})): Promise { const queryParamsMap: { readonly [key: string]: string; } = prepareParams({ ["fields"]: toString(queryParams.fields) }); @@ -254,31 +254,31 @@ export function deserializeCreateUserRequestBodyArgStatusField(val: any): Create throw "".concat("Invalid value: ", val) as string; } export function serializeCreateUserRequestBodyArg(val: CreateUserRequestBodyArg): Json { - return { ["name"]: val.name, ["login"]: val.login, ["is_platform_access_only"]: val.isPlatformAccessOnly, ["role"]: val.role == void 0 ? void 0 : serializeCreateUserRequestBodyArgRoleField(val.role), ["language"]: val.language, ["is_sync_enabled"]: val.isSyncEnabled, ["job_title"]: val.jobTitle, ["phone"]: val.phone, ["address"]: val.address, ["space_amount"]: val.spaceAmount, ["tracking_codes"]: val.trackingCodes == void 0 ? void 0 : val.trackingCodes.map(function (item: TrackingCode): any { + return { ["name"]: val.name, ["login"]: val.login == void 0 ? void 0 : val.login, ["is_platform_access_only"]: val.isPlatformAccessOnly == void 0 ? void 0 : val.isPlatformAccessOnly, ["role"]: val.role == void 0 ? void 0 : serializeCreateUserRequestBodyArgRoleField(val.role), ["language"]: val.language == void 0 ? void 0 : val.language, ["is_sync_enabled"]: val.isSyncEnabled == void 0 ? void 0 : val.isSyncEnabled, ["job_title"]: val.jobTitle == void 0 ? void 0 : val.jobTitle, ["phone"]: val.phone == void 0 ? void 0 : val.phone, ["address"]: val.address == void 0 ? void 0 : val.address, ["space_amount"]: val.spaceAmount == void 0 ? void 0 : val.spaceAmount, ["tracking_codes"]: val.trackingCodes == void 0 ? void 0 : val.trackingCodes.map(function (item: TrackingCode): any { return serializeTrackingCode(item); - }) as readonly any[], ["can_see_managed_users"]: val.canSeeManagedUsers, ["timezone"]: val.timezone, ["is_external_collab_restricted"]: val.isExternalCollabRestricted, ["is_exempt_from_device_limits"]: val.isExemptFromDeviceLimits, ["is_exempt_from_login_verification"]: val.isExemptFromLoginVerification, ["status"]: val.status == void 0 ? void 0 : serializeCreateUserRequestBodyArgStatusField(val.status), ["external_app_user_id"]: val.externalAppUserId }; + }) as readonly any[], ["can_see_managed_users"]: val.canSeeManagedUsers == void 0 ? void 0 : val.canSeeManagedUsers, ["timezone"]: val.timezone == void 0 ? void 0 : val.timezone, ["is_external_collab_restricted"]: val.isExternalCollabRestricted == void 0 ? void 0 : val.isExternalCollabRestricted, ["is_exempt_from_device_limits"]: val.isExemptFromDeviceLimits == void 0 ? void 0 : val.isExemptFromDeviceLimits, ["is_exempt_from_login_verification"]: val.isExemptFromLoginVerification == void 0 ? void 0 : val.isExemptFromLoginVerification, ["status"]: val.status == void 0 ? void 0 : serializeCreateUserRequestBodyArgStatusField(val.status), ["external_app_user_id"]: val.externalAppUserId == void 0 ? void 0 : val.externalAppUserId }; } export function deserializeCreateUserRequestBodyArg(val: any): CreateUserRequestBodyArg { const name: string = val.name; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; - const isPlatformAccessOnly: undefined | boolean = isJson(val.is_platform_access_only, "boolean") ? val.is_platform_access_only : void 0; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; + const isPlatformAccessOnly: undefined | boolean = val.is_platform_access_only == void 0 ? void 0 : val.is_platform_access_only; const role: undefined | CreateUserRequestBodyArgRoleField = val.role == void 0 ? void 0 : deserializeCreateUserRequestBodyArgRoleField(val.role); - const language: undefined | string = isJson(val.language, "string") ? val.language : void 0; - const isSyncEnabled: undefined | boolean = isJson(val.is_sync_enabled, "boolean") ? val.is_sync_enabled : void 0; - const jobTitle: undefined | string = isJson(val.job_title, "string") ? val.job_title : void 0; - const phone: undefined | string = isJson(val.phone, "string") ? val.phone : void 0; - const address: undefined | string = isJson(val.address, "string") ? val.address : void 0; - const spaceAmount: undefined | number = isJson(val.space_amount, "number") ? val.space_amount : void 0; - const trackingCodes: undefined | readonly TrackingCode[] = isJson(val.tracking_codes, "array") ? val.tracking_codes.map(function (itm: Json): any { + const language: undefined | string = val.language == void 0 ? void 0 : val.language; + const isSyncEnabled: undefined | boolean = val.is_sync_enabled == void 0 ? void 0 : val.is_sync_enabled; + const jobTitle: undefined | string = val.job_title == void 0 ? void 0 : val.job_title; + const phone: undefined | string = val.phone == void 0 ? void 0 : val.phone; + const address: undefined | string = val.address == void 0 ? void 0 : val.address; + const spaceAmount: undefined | number = val.space_amount == void 0 ? void 0 : val.space_amount; + const trackingCodes: undefined | readonly TrackingCode[] = val.tracking_codes == void 0 ? void 0 : isJson(val.tracking_codes, "array") ? val.tracking_codes.map(function (itm: Json): any { return deserializeTrackingCode(itm); - }) as readonly any[] : void 0; - const canSeeManagedUsers: undefined | boolean = isJson(val.can_see_managed_users, "boolean") ? val.can_see_managed_users : void 0; - const timezone: undefined | string = isJson(val.timezone, "string") ? val.timezone : void 0; - const isExternalCollabRestricted: undefined | boolean = isJson(val.is_external_collab_restricted, "boolean") ? val.is_external_collab_restricted : void 0; - const isExemptFromDeviceLimits: undefined | boolean = isJson(val.is_exempt_from_device_limits, "boolean") ? val.is_exempt_from_device_limits : void 0; - const isExemptFromLoginVerification: undefined | boolean = isJson(val.is_exempt_from_login_verification, "boolean") ? val.is_exempt_from_login_verification : void 0; + }) as readonly any[] : []; + const canSeeManagedUsers: undefined | boolean = val.can_see_managed_users == void 0 ? void 0 : val.can_see_managed_users; + const timezone: undefined | string = val.timezone == void 0 ? void 0 : val.timezone; + const isExternalCollabRestricted: undefined | boolean = val.is_external_collab_restricted == void 0 ? void 0 : val.is_external_collab_restricted; + const isExemptFromDeviceLimits: undefined | boolean = val.is_exempt_from_device_limits == void 0 ? void 0 : val.is_exempt_from_device_limits; + const isExemptFromLoginVerification: undefined | boolean = val.is_exempt_from_login_verification == void 0 ? void 0 : val.is_exempt_from_login_verification; const status: undefined | CreateUserRequestBodyArgStatusField = val.status == void 0 ? void 0 : deserializeCreateUserRequestBodyArgStatusField(val.status); - const externalAppUserId: undefined | string = isJson(val.external_app_user_id, "string") ? val.external_app_user_id : void 0; + const externalAppUserId: undefined | string = val.external_app_user_id == void 0 ? void 0 : val.external_app_user_id; return { name: name, login: login, isPlatformAccessOnly: isPlatformAccessOnly, role: role, language: language, isSyncEnabled: isSyncEnabled, jobTitle: jobTitle, phone: phone, address: address, spaceAmount: spaceAmount, trackingCodes: trackingCodes, canSeeManagedUsers: canSeeManagedUsers, timezone: timezone, isExternalCollabRestricted: isExternalCollabRestricted, isExemptFromDeviceLimits: isExemptFromDeviceLimits, isExemptFromLoginVerification: isExemptFromLoginVerification, status: status, externalAppUserId: externalAppUserId } satisfies CreateUserRequestBodyArg; } export function serializeUpdateUserByIdRequestBodyArgRoleField(val: UpdateUserByIdRequestBodyArgRoleField): Json { @@ -318,40 +318,40 @@ export function deserializeUpdateUserByIdRequestBodyArgStatusField(val: any): Up throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateUserByIdRequestBodyArgNotificationEmailField(val: UpdateUserByIdRequestBodyArgNotificationEmailField): Json { - return { ["email"]: val.email }; + return { ["email"]: val.email == void 0 ? void 0 : val.email }; } export function deserializeUpdateUserByIdRequestBodyArgNotificationEmailField(val: any): UpdateUserByIdRequestBodyArgNotificationEmailField { - const email: undefined | string = isJson(val.email, "string") ? val.email : void 0; + const email: undefined | string = val.email == void 0 ? void 0 : val.email; return { email: email } satisfies UpdateUserByIdRequestBodyArgNotificationEmailField; } export function serializeUpdateUserByIdRequestBodyArg(val: UpdateUserByIdRequestBodyArg): Json { - return { ["enterprise"]: val.enterprise, ["notify"]: val.notify, ["name"]: val.name, ["login"]: val.login, ["role"]: val.role == void 0 ? void 0 : serializeUpdateUserByIdRequestBodyArgRoleField(val.role), ["language"]: val.language, ["is_sync_enabled"]: val.isSyncEnabled, ["job_title"]: val.jobTitle, ["phone"]: val.phone, ["address"]: val.address, ["tracking_codes"]: val.trackingCodes == void 0 ? void 0 : val.trackingCodes.map(function (item: TrackingCode): any { + return { ["enterprise"]: val.enterprise == void 0 ? void 0 : val.enterprise, ["notify"]: val.notify == void 0 ? void 0 : val.notify, ["name"]: val.name == void 0 ? void 0 : val.name, ["login"]: val.login == void 0 ? void 0 : val.login, ["role"]: val.role == void 0 ? void 0 : serializeUpdateUserByIdRequestBodyArgRoleField(val.role), ["language"]: val.language == void 0 ? void 0 : val.language, ["is_sync_enabled"]: val.isSyncEnabled == void 0 ? void 0 : val.isSyncEnabled, ["job_title"]: val.jobTitle == void 0 ? void 0 : val.jobTitle, ["phone"]: val.phone == void 0 ? void 0 : val.phone, ["address"]: val.address == void 0 ? void 0 : val.address, ["tracking_codes"]: val.trackingCodes == void 0 ? void 0 : val.trackingCodes.map(function (item: TrackingCode): any { return serializeTrackingCode(item); - }) as readonly any[], ["can_see_managed_users"]: val.canSeeManagedUsers, ["timezone"]: val.timezone, ["is_external_collab_restricted"]: val.isExternalCollabRestricted, ["is_exempt_from_device_limits"]: val.isExemptFromDeviceLimits, ["is_exempt_from_login_verification"]: val.isExemptFromLoginVerification, ["is_password_reset_required"]: val.isPasswordResetRequired, ["status"]: val.status == void 0 ? void 0 : serializeUpdateUserByIdRequestBodyArgStatusField(val.status), ["space_amount"]: val.spaceAmount, ["notification_email"]: val.notificationEmail == void 0 ? void 0 : serializeUpdateUserByIdRequestBodyArgNotificationEmailField(val.notificationEmail), ["external_app_user_id"]: val.externalAppUserId }; + }) as readonly any[], ["can_see_managed_users"]: val.canSeeManagedUsers == void 0 ? void 0 : val.canSeeManagedUsers, ["timezone"]: val.timezone == void 0 ? void 0 : val.timezone, ["is_external_collab_restricted"]: val.isExternalCollabRestricted == void 0 ? void 0 : val.isExternalCollabRestricted, ["is_exempt_from_device_limits"]: val.isExemptFromDeviceLimits == void 0 ? void 0 : val.isExemptFromDeviceLimits, ["is_exempt_from_login_verification"]: val.isExemptFromLoginVerification == void 0 ? void 0 : val.isExemptFromLoginVerification, ["is_password_reset_required"]: val.isPasswordResetRequired == void 0 ? void 0 : val.isPasswordResetRequired, ["status"]: val.status == void 0 ? void 0 : serializeUpdateUserByIdRequestBodyArgStatusField(val.status), ["space_amount"]: val.spaceAmount == void 0 ? void 0 : val.spaceAmount, ["notification_email"]: val.notificationEmail == void 0 ? void 0 : serializeUpdateUserByIdRequestBodyArgNotificationEmailField(val.notificationEmail), ["external_app_user_id"]: val.externalAppUserId == void 0 ? void 0 : val.externalAppUserId }; } export function deserializeUpdateUserByIdRequestBodyArg(val: any): UpdateUserByIdRequestBodyArg { - const enterprise: undefined | string = isJson(val.enterprise, "string") ? val.enterprise : void 0; - const notify: undefined | boolean = isJson(val.notify, "boolean") ? val.notify : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; + const enterprise: undefined | string = val.enterprise == void 0 ? void 0 : val.enterprise; + const notify: undefined | boolean = val.notify == void 0 ? void 0 : val.notify; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; const role: undefined | UpdateUserByIdRequestBodyArgRoleField = val.role == void 0 ? void 0 : deserializeUpdateUserByIdRequestBodyArgRoleField(val.role); - const language: undefined | string = isJson(val.language, "string") ? val.language : void 0; - const isSyncEnabled: undefined | boolean = isJson(val.is_sync_enabled, "boolean") ? val.is_sync_enabled : void 0; - const jobTitle: undefined | string = isJson(val.job_title, "string") ? val.job_title : void 0; - const phone: undefined | string = isJson(val.phone, "string") ? val.phone : void 0; - const address: undefined | string = isJson(val.address, "string") ? val.address : void 0; - const trackingCodes: undefined | readonly TrackingCode[] = isJson(val.tracking_codes, "array") ? val.tracking_codes.map(function (itm: Json): any { + const language: undefined | string = val.language == void 0 ? void 0 : val.language; + const isSyncEnabled: undefined | boolean = val.is_sync_enabled == void 0 ? void 0 : val.is_sync_enabled; + const jobTitle: undefined | string = val.job_title == void 0 ? void 0 : val.job_title; + const phone: undefined | string = val.phone == void 0 ? void 0 : val.phone; + const address: undefined | string = val.address == void 0 ? void 0 : val.address; + const trackingCodes: undefined | readonly TrackingCode[] = val.tracking_codes == void 0 ? void 0 : isJson(val.tracking_codes, "array") ? val.tracking_codes.map(function (itm: Json): any { return deserializeTrackingCode(itm); - }) as readonly any[] : void 0; - const canSeeManagedUsers: undefined | boolean = isJson(val.can_see_managed_users, "boolean") ? val.can_see_managed_users : void 0; - const timezone: undefined | string = isJson(val.timezone, "string") ? val.timezone : void 0; - const isExternalCollabRestricted: undefined | boolean = isJson(val.is_external_collab_restricted, "boolean") ? val.is_external_collab_restricted : void 0; - const isExemptFromDeviceLimits: undefined | boolean = isJson(val.is_exempt_from_device_limits, "boolean") ? val.is_exempt_from_device_limits : void 0; - const isExemptFromLoginVerification: undefined | boolean = isJson(val.is_exempt_from_login_verification, "boolean") ? val.is_exempt_from_login_verification : void 0; - const isPasswordResetRequired: undefined | boolean = isJson(val.is_password_reset_required, "boolean") ? val.is_password_reset_required : void 0; + }) as readonly any[] : []; + const canSeeManagedUsers: undefined | boolean = val.can_see_managed_users == void 0 ? void 0 : val.can_see_managed_users; + const timezone: undefined | string = val.timezone == void 0 ? void 0 : val.timezone; + const isExternalCollabRestricted: undefined | boolean = val.is_external_collab_restricted == void 0 ? void 0 : val.is_external_collab_restricted; + const isExemptFromDeviceLimits: undefined | boolean = val.is_exempt_from_device_limits == void 0 ? void 0 : val.is_exempt_from_device_limits; + const isExemptFromLoginVerification: undefined | boolean = val.is_exempt_from_login_verification == void 0 ? void 0 : val.is_exempt_from_login_verification; + const isPasswordResetRequired: undefined | boolean = val.is_password_reset_required == void 0 ? void 0 : val.is_password_reset_required; const status: undefined | UpdateUserByIdRequestBodyArgStatusField = val.status == void 0 ? void 0 : deserializeUpdateUserByIdRequestBodyArgStatusField(val.status); - const spaceAmount: undefined | number = isJson(val.space_amount, "number") ? val.space_amount : void 0; + const spaceAmount: undefined | number = val.space_amount == void 0 ? void 0 : val.space_amount; const notificationEmail: undefined | UpdateUserByIdRequestBodyArgNotificationEmailField = val.notification_email == void 0 ? void 0 : deserializeUpdateUserByIdRequestBodyArgNotificationEmailField(val.notification_email); - const externalAppUserId: undefined | string = isJson(val.external_app_user_id, "string") ? val.external_app_user_id : void 0; + const externalAppUserId: undefined | string = val.external_app_user_id == void 0 ? void 0 : val.external_app_user_id; return { enterprise: enterprise, notify: notify, name: name, login: login, role: role, language: language, isSyncEnabled: isSyncEnabled, jobTitle: jobTitle, phone: phone, address: address, trackingCodes: trackingCodes, canSeeManagedUsers: canSeeManagedUsers, timezone: timezone, isExternalCollabRestricted: isExternalCollabRestricted, isExemptFromDeviceLimits: isExemptFromDeviceLimits, isExemptFromLoginVerification: isExemptFromLoginVerification, isPasswordResetRequired: isPasswordResetRequired, status: status, spaceAmount: spaceAmount, notificationEmail: notificationEmail, externalAppUserId: externalAppUserId } satisfies UpdateUserByIdRequestBodyArg; } diff --git a/src/managers/webLinks.generated.ts b/src/managers/webLinks.generated.ts index 5562ce60..81678d76 100644 --- a/src/managers/webLinks.generated.ts +++ b/src/managers/webLinks.generated.ts @@ -13,8 +13,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; +import { Json } from "../json.js"; import { isJson } from "../json.js"; export interface CreateWebLinkRequestBodyArgParentField { readonly id: string; @@ -95,7 +95,7 @@ export class WebLinksManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/web_links/", webLinkId) as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeWebLink(deserializeJson(response.text)); } - async updateWebLinkById(webLinkId: string, requestBody: UpdateWebLinkByIdRequestBodyArg, headers: UpdateWebLinkByIdHeadersArg = new UpdateWebLinkByIdHeadersArg({})): Promise { + async updateWebLinkById(webLinkId: string, requestBody: UpdateWebLinkByIdRequestBodyArg = {} satisfies UpdateWebLinkByIdRequestBodyArg, headers: UpdateWebLinkByIdHeadersArg = new UpdateWebLinkByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -118,20 +118,20 @@ export function deserializeCreateWebLinkRequestBodyArgParentField(val: any): Cre return { id: id } satisfies CreateWebLinkRequestBodyArgParentField; } export function serializeCreateWebLinkRequestBodyArg(val: CreateWebLinkRequestBodyArg): Json { - return { ["url"]: val.url, ["parent"]: serializeCreateWebLinkRequestBodyArgParentField(val.parent), ["name"]: val.name, ["description"]: val.description }; + return { ["url"]: val.url, ["parent"]: serializeCreateWebLinkRequestBodyArgParentField(val.parent), ["name"]: val.name == void 0 ? void 0 : val.name, ["description"]: val.description == void 0 ? void 0 : val.description }; } export function deserializeCreateWebLinkRequestBodyArg(val: any): CreateWebLinkRequestBodyArg { const url: string = val.url; const parent: CreateWebLinkRequestBodyArgParentField = deserializeCreateWebLinkRequestBodyArgParentField(val.parent); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; return { url: url, parent: parent, name: name, description: description } satisfies CreateWebLinkRequestBodyArg; } export function serializeUpdateWebLinkByIdRequestBodyArgParentField(val: UpdateWebLinkByIdRequestBodyArgParentField): Json { - return { ["id"]: val.id }; + return { ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeUpdateWebLinkByIdRequestBodyArgParentField(val: any): UpdateWebLinkByIdRequestBodyArgParentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { id: id } satisfies UpdateWebLinkByIdRequestBodyArgParentField; } export function serializeUpdateWebLinkByIdRequestBodyArgSharedLinkFieldAccessField(val: UpdateWebLinkByIdRequestBodyArgSharedLinkFieldAccessField): Json { @@ -153,23 +153,23 @@ export function deserializeUpdateWebLinkByIdRequestBodyArgSharedLinkFieldAccessF throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateWebLinkByIdRequestBodyArgSharedLinkField(val: UpdateWebLinkByIdRequestBodyArgSharedLinkField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateWebLinkByIdRequestBodyArgSharedLinkFieldAccessField(val.access), ["password"]: val.password, ["vanity_name"]: val.vanityName, ["unshared_at"]: val.unsharedAt }; + return { ["access"]: val.access == void 0 ? void 0 : serializeUpdateWebLinkByIdRequestBodyArgSharedLinkFieldAccessField(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 }; } export function deserializeUpdateWebLinkByIdRequestBodyArgSharedLinkField(val: any): UpdateWebLinkByIdRequestBodyArgSharedLinkField { const access: undefined | UpdateWebLinkByIdRequestBodyArgSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeUpdateWebLinkByIdRequestBodyArgSharedLinkFieldAccessField(val.access); - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt } satisfies UpdateWebLinkByIdRequestBodyArgSharedLinkField; } export function serializeUpdateWebLinkByIdRequestBodyArg(val: UpdateWebLinkByIdRequestBodyArg): Json { - return { ["url"]: val.url, ["parent"]: val.parent == void 0 ? void 0 : serializeUpdateWebLinkByIdRequestBodyArgParentField(val.parent), ["name"]: val.name, ["description"]: val.description, ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeUpdateWebLinkByIdRequestBodyArgSharedLinkField(val.sharedLink) }; + return { ["url"]: val.url == void 0 ? void 0 : val.url, ["parent"]: val.parent == void 0 ? void 0 : serializeUpdateWebLinkByIdRequestBodyArgParentField(val.parent), ["name"]: val.name == void 0 ? void 0 : val.name, ["description"]: val.description == void 0 ? void 0 : val.description, ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeUpdateWebLinkByIdRequestBodyArgSharedLinkField(val.sharedLink) }; } export function deserializeUpdateWebLinkByIdRequestBodyArg(val: any): UpdateWebLinkByIdRequestBodyArg { - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; const parent: undefined | UpdateWebLinkByIdRequestBodyArgParentField = val.parent == void 0 ? void 0 : deserializeUpdateWebLinkByIdRequestBodyArgParentField(val.parent); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const sharedLink: undefined | UpdateWebLinkByIdRequestBodyArgSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeUpdateWebLinkByIdRequestBodyArgSharedLinkField(val.shared_link); return { url: url, parent: parent, name: name, description: description, sharedLink: sharedLink } satisfies UpdateWebLinkByIdRequestBodyArg; } diff --git a/src/managers/webhooks.generated.ts b/src/managers/webhooks.generated.ts index 2e2cd9c1..8f301cfa 100644 --- a/src/managers/webhooks.generated.ts +++ b/src/managers/webhooks.generated.ts @@ -115,7 +115,7 @@ export class WebhooksManager { const response: FetchResponse = await fetch("".concat("https://api.box.com/2.0/webhooks/", webhookId) as string, { method: "GET", headers: headersMap, responseFormat: "json", auth: this.auth, networkSession: this.networkSession } satisfies FetchOptions) as FetchResponse; return deserializeWebhook(deserializeJson(response.text)); } - async updateWebhookById(webhookId: string, requestBody: UpdateWebhookByIdRequestBodyArg, headers: UpdateWebhookByIdHeadersArg = new UpdateWebhookByIdHeadersArg({})): Promise { + async updateWebhookById(webhookId: string, requestBody: UpdateWebhookByIdRequestBodyArg = {} satisfies UpdateWebhookByIdRequestBodyArg, headers: UpdateWebhookByIdHeadersArg = new UpdateWebhookByIdHeadersArg({})): Promise { const headersMap: { readonly [key: string]: string; } = prepareParams({ ...{}, ...headers.extraHeaders }); @@ -146,10 +146,10 @@ export function deserializeCreateWebhookRequestBodyArgTargetFieldTypeField(val: throw "".concat("Invalid value: ", val) as string; } export function serializeCreateWebhookRequestBodyArgTargetField(val: CreateWebhookRequestBodyArgTargetField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateWebhookRequestBodyArgTargetFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateWebhookRequestBodyArgTargetFieldTypeField(val.type) }; } export function deserializeCreateWebhookRequestBodyArgTargetField(val: any): CreateWebhookRequestBodyArgTargetField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CreateWebhookRequestBodyArgTargetFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateWebhookRequestBodyArgTargetFieldTypeField(val.type); return { id: id, type: type } satisfies CreateWebhookRequestBodyArgTargetField; } @@ -290,9 +290,9 @@ export function serializeCreateWebhookRequestBodyArg(val: CreateWebhookRequestBo export function deserializeCreateWebhookRequestBodyArg(val: any): CreateWebhookRequestBodyArg { const target: CreateWebhookRequestBodyArgTargetField = deserializeCreateWebhookRequestBodyArgTargetField(val.target); const address: string = val.address; - const triggers: readonly CreateWebhookRequestBodyArgTriggersField[] = val.triggers.map(function (itm: Json): any { + const triggers: readonly CreateWebhookRequestBodyArgTriggersField[] = isJson(val.triggers, "array") ? val.triggers.map(function (itm: Json): any { return deserializeCreateWebhookRequestBodyArgTriggersField(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { target: target, address: address, triggers: triggers } satisfies CreateWebhookRequestBodyArg; } export function serializeUpdateWebhookByIdRequestBodyArgTargetFieldTypeField(val: UpdateWebhookByIdRequestBodyArgTargetFieldTypeField): Json { @@ -311,10 +311,10 @@ export function deserializeUpdateWebhookByIdRequestBodyArgTargetFieldTypeField(v throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateWebhookByIdRequestBodyArgTargetField(val: UpdateWebhookByIdRequestBodyArgTargetField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeUpdateWebhookByIdRequestBodyArgTargetFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeUpdateWebhookByIdRequestBodyArgTargetFieldTypeField(val.type) }; } export function deserializeUpdateWebhookByIdRequestBodyArgTargetField(val: any): UpdateWebhookByIdRequestBodyArgTargetField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | UpdateWebhookByIdRequestBodyArgTargetFieldTypeField = val.type == void 0 ? void 0 : deserializeUpdateWebhookByIdRequestBodyArgTargetFieldTypeField(val.type); return { id: id, type: type } satisfies UpdateWebhookByIdRequestBodyArgTargetField; } @@ -448,15 +448,15 @@ export function deserializeUpdateWebhookByIdRequestBodyArgTriggersField(val: any throw "".concat("Invalid value: ", val) as string; } export function serializeUpdateWebhookByIdRequestBodyArg(val: UpdateWebhookByIdRequestBodyArg): Json { - return { ["target"]: val.target == void 0 ? void 0 : serializeUpdateWebhookByIdRequestBodyArgTargetField(val.target), ["address"]: val.address, ["triggers"]: val.triggers == void 0 ? void 0 : val.triggers.map(function (item: UpdateWebhookByIdRequestBodyArgTriggersField): any { + return { ["target"]: val.target == void 0 ? void 0 : serializeUpdateWebhookByIdRequestBodyArgTargetField(val.target), ["address"]: val.address == void 0 ? void 0 : val.address, ["triggers"]: val.triggers == void 0 ? void 0 : val.triggers.map(function (item: UpdateWebhookByIdRequestBodyArgTriggersField): any { return serializeUpdateWebhookByIdRequestBodyArgTriggersField(item); }) as readonly any[] }; } export function deserializeUpdateWebhookByIdRequestBodyArg(val: any): UpdateWebhookByIdRequestBodyArg { const target: undefined | UpdateWebhookByIdRequestBodyArgTargetField = val.target == void 0 ? void 0 : deserializeUpdateWebhookByIdRequestBodyArgTargetField(val.target); - const address: undefined | string = isJson(val.address, "string") ? val.address : void 0; - const triggers: undefined | readonly UpdateWebhookByIdRequestBodyArgTriggersField[] = isJson(val.triggers, "array") ? val.triggers.map(function (itm: Json): any { + const address: undefined | string = val.address == void 0 ? void 0 : val.address; + const triggers: undefined | readonly UpdateWebhookByIdRequestBodyArgTriggersField[] = val.triggers == void 0 ? void 0 : isJson(val.triggers, "array") ? val.triggers.map(function (itm: Json): any { return deserializeUpdateWebhookByIdRequestBodyArgTriggersField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { target: target, address: address, triggers: triggers } satisfies UpdateWebhookByIdRequestBodyArg; } diff --git a/src/managers/workflows.generated.ts b/src/managers/workflows.generated.ts index 9c993bf6..6921e27b 100644 --- a/src/managers/workflows.generated.ts +++ b/src/managers/workflows.generated.ts @@ -103,11 +103,11 @@ export function deserializeCreateWorkflowStartRequestBodyArgTypeField(val: any): throw "".concat("Invalid value: ", val) as string; } export function serializeCreateWorkflowStartRequestBodyArgFlowField(val: CreateWorkflowStartRequestBodyArgFlowField): Json { - return { ["type"]: val.type, ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : val.type, ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeCreateWorkflowStartRequestBodyArgFlowField(val: any): CreateWorkflowStartRequestBodyArgFlowField { - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies CreateWorkflowStartRequestBodyArgFlowField; } export function serializeCreateWorkflowStartRequestBodyArgFilesFieldTypeField(val: CreateWorkflowStartRequestBodyArgFilesFieldTypeField): Json { @@ -123,11 +123,11 @@ export function deserializeCreateWorkflowStartRequestBodyArgFilesFieldTypeField( throw "".concat("Invalid value: ", val) as string; } export function serializeCreateWorkflowStartRequestBodyArgFilesField(val: CreateWorkflowStartRequestBodyArgFilesField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeCreateWorkflowStartRequestBodyArgFilesFieldTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeCreateWorkflowStartRequestBodyArgFilesFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeCreateWorkflowStartRequestBodyArgFilesField(val: any): CreateWorkflowStartRequestBodyArgFilesField { const type: undefined | CreateWorkflowStartRequestBodyArgFilesFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateWorkflowStartRequestBodyArgFilesFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies CreateWorkflowStartRequestBodyArgFilesField; } export function serializeCreateWorkflowStartRequestBodyArgFolderFieldTypeField(val: CreateWorkflowStartRequestBodyArgFolderFieldTypeField): Json { @@ -143,11 +143,11 @@ export function deserializeCreateWorkflowStartRequestBodyArgFolderFieldTypeField throw "".concat("Invalid value: ", val) as string; } export function serializeCreateWorkflowStartRequestBodyArgFolderField(val: CreateWorkflowStartRequestBodyArgFolderField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeCreateWorkflowStartRequestBodyArgFolderFieldTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeCreateWorkflowStartRequestBodyArgFolderFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeCreateWorkflowStartRequestBodyArgFolderField(val: any): CreateWorkflowStartRequestBodyArgFolderField { const type: undefined | CreateWorkflowStartRequestBodyArgFolderFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateWorkflowStartRequestBodyArgFolderFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies CreateWorkflowStartRequestBodyArgFolderField; } export function serializeCreateWorkflowStartRequestBodyArgOutcomesFieldTypeField(val: CreateWorkflowStartRequestBodyArgOutcomesFieldTypeField): Json { @@ -163,12 +163,12 @@ export function deserializeCreateWorkflowStartRequestBodyArgOutcomesFieldTypeFie throw "".concat("Invalid value: ", val) as string; } export function serializeCreateWorkflowStartRequestBodyArgOutcomesField(val: CreateWorkflowStartRequestBodyArgOutcomesField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateWorkflowStartRequestBodyArgOutcomesFieldTypeField(val.type), ["parameter"]: val.parameter }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCreateWorkflowStartRequestBodyArgOutcomesFieldTypeField(val.type), ["parameter"]: val.parameter == void 0 ? void 0 : val.parameter }; } export function deserializeCreateWorkflowStartRequestBodyArgOutcomesField(val: any): CreateWorkflowStartRequestBodyArgOutcomesField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CreateWorkflowStartRequestBodyArgOutcomesFieldTypeField = val.type == void 0 ? void 0 : deserializeCreateWorkflowStartRequestBodyArgOutcomesFieldTypeField(val.type); - const parameter: undefined | string = isJson(val.parameter, "string") ? val.parameter : void 0; + const parameter: undefined | string = val.parameter == void 0 ? void 0 : val.parameter; return { id: id, type: type, parameter: parameter } satisfies CreateWorkflowStartRequestBodyArgOutcomesField; } export function serializeCreateWorkflowStartRequestBodyArg(val: CreateWorkflowStartRequestBodyArg): Json { @@ -181,12 +181,12 @@ export function serializeCreateWorkflowStartRequestBodyArg(val: CreateWorkflowSt export function deserializeCreateWorkflowStartRequestBodyArg(val: any): CreateWorkflowStartRequestBodyArg { const type: undefined | CreateWorkflowStartRequestBodyArgTypeField = val.type == void 0 ? void 0 : deserializeCreateWorkflowStartRequestBodyArgTypeField(val.type); const flow: CreateWorkflowStartRequestBodyArgFlowField = deserializeCreateWorkflowStartRequestBodyArgFlowField(val.flow); - const files: readonly CreateWorkflowStartRequestBodyArgFilesField[] = val.files.map(function (itm: Json): any { + const files: readonly CreateWorkflowStartRequestBodyArgFilesField[] = isJson(val.files, "array") ? val.files.map(function (itm: Json): any { return deserializeCreateWorkflowStartRequestBodyArgFilesField(itm); - }) as readonly any[]; + }) as readonly any[] : []; const folder: CreateWorkflowStartRequestBodyArgFolderField = deserializeCreateWorkflowStartRequestBodyArgFolderField(val.folder); - const outcomes: undefined | readonly CreateWorkflowStartRequestBodyArgOutcomesField[] = isJson(val.outcomes, "array") ? val.outcomes.map(function (itm: Json): any { + const outcomes: undefined | readonly CreateWorkflowStartRequestBodyArgOutcomesField[] = val.outcomes == void 0 ? void 0 : isJson(val.outcomes, "array") ? val.outcomes.map(function (itm: Json): any { return deserializeCreateWorkflowStartRequestBodyArgOutcomesField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { type: type, flow: flow, files: files, folder: folder, outcomes: outcomes } satisfies CreateWorkflowStartRequestBodyArg; } diff --git a/src/managers/zipDownloads.generated.ts b/src/managers/zipDownloads.generated.ts index 6c9c34c9..0ad3229a 100644 --- a/src/managers/zipDownloads.generated.ts +++ b/src/managers/zipDownloads.generated.ts @@ -19,8 +19,8 @@ import { fetch } from "../fetch.js"; import { FetchOptions } from "../fetch.js"; import { FetchResponse } from "../fetch.js"; import { serializeJson } from "../json.js"; -import { Json } from "../json.js"; import { deserializeJson } from "../json.js"; +import { Json } from "../json.js"; export class CreateZipDownloadHeadersArg { readonly extraHeaders?: { readonly [key: string]: undefined | string; diff --git a/src/schemas.generated.ts b/src/schemas.generated.ts index e9b8ab84..fb8aa248 100644 --- a/src/schemas.generated.ts +++ b/src/schemas.generated.ts @@ -1,5 +1,5 @@ -import { isJson } from "./json.js"; import { Json } from "./json.js"; +import { isJson } from "./json.js"; export type PostOAuth2TokenGrantTypeField = "authorization_code" | "refresh_token" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:token-exchange"; export type PostOAuth2TokenSubjectTokenTypeField = "urn:ietf:params:oauth:token-type:access_token"; export type PostOAuth2TokenActorTokenTypeField = "urn:ietf:params:oauth:token-type:id_token"; @@ -42,8 +42,6 @@ export interface ZipDownloadRequest { readonly items: readonly ZipDownloadRequestItemsField[]; readonly downloadFileName?: string; } -export interface MetadataQueryQueryParamsField { -} export type MetadataQueryOrderByFieldDirectionField = "ASC" | "DESC"; export interface MetadataQueryOrderByField { readonly fieldKey?: string; @@ -52,7 +50,9 @@ export interface MetadataQueryOrderByField { export interface MetadataQuery { readonly from: string; readonly query?: string; - readonly queryParams?: MetadataQueryQueryParamsField; + readonly queryParams?: { + readonly [key: string]: string; + }; readonly ancestorFolderId: string; readonly orderBy?: readonly MetadataQueryOrderByField[]; readonly limit?: number; @@ -78,17 +78,6 @@ export type FileRequestCopyRequest = FileRequestUpdateRequest & { * The folder to associate the new file request to. */ readonly folder: FileRequestCopyRequestFolderField; }; -export interface IntegrationMappingSlackCreateRequestPartnerItemField { -} -export interface IntegrationMappingSlackCreateRequestBoxItemField { -} -export interface IntegrationMappingSlackCreateRequestOptionsField { -} -export interface IntegrationMappingSlackCreateRequest { - readonly partnerItem: IntegrationMappingSlackCreateRequestPartnerItemField; - readonly boxItem: IntegrationMappingSlackCreateRequestBoxItemField; - readonly options?: IntegrationMappingSlackCreateRequestOptionsField; -} export type ClientErrorTypeField = "error"; export type ClientErrorCodeField = "created" | "accepted" | "no_content" | "redirect" | "not_modified" | "bad_request" | "unauthorized" | "forbidden" | "not_found" | "method_not_allowed" | "conflict" | "precondition_failed" | "too_many_requests" | "internal_server_error" | "unavailable" | "item_name_invalid" | "insufficient_scope"; export interface ClientErrorContextInfoField { @@ -446,8 +435,13 @@ export interface LegalHoldPolicyAssignments { readonly prevMarker?: number; readonly entries?: readonly LegalHoldPolicyAssignmentBase[]; } -export interface Metadata { +export interface MetadataBase { + readonly parent?: string; + readonly template?: string; + readonly scope?: string; + readonly version?: number; } +export type Metadata = MetadataBase; export interface Metadatas { readonly entries?: readonly Metadata[]; readonly limit?: number; @@ -469,13 +463,10 @@ export type MetadataFull = Metadata & { * internal system property and should not be used by a client * application. */ readonly typeVersion?: number; + readonly extraData?: { + readonly [key: string]: string; + }; }; -export interface MetadataBase { - readonly parent?: string; - readonly template?: string; - readonly scope?: string; - readonly version?: number; -} export type MetadataCascadePolicyTypeField = "metadata_cascade_policy"; export type MetadataCascadePolicyOwnerEnterpriseFieldTypeField = "enterprise"; export interface MetadataCascadePolicyOwnerEnterpriseField { @@ -520,7 +511,7 @@ export interface MetadataQueryIndices { readonly nextMarker?: string; } export type MetadataTemplateTypeField = "metadata_template"; -export type MetadataTemplateFieldsFieldTypeField = "string" | "float" | "date" | "enum" | "multiSelect"; +export type MetadataTemplateFieldsFieldTypeField = "string" | "float" | "date" | "enum" | "multiSelect" | "integer"; export interface MetadataTemplateFieldsFieldOptionsField { readonly key: string; readonly id?: string; @@ -1498,6 +1489,11 @@ export interface FileFullWatermarkInfoField { } export type FileFullAllowedInviteeRolesField = "editor" | "viewer" | "previewer" | "uploader" | "previewer uploader" | "viewer uploader" | "co-owner"; export interface FileFullMetadataField { + readonly extraData?: { + readonly [key: string]: { + readonly [key: string]: Metadata; + }; + }; } export interface FileFullRepresentationsFieldEntriesFieldContentField { readonly urlTemplate?: string; @@ -1697,27 +1693,6 @@ export interface ShieldInformationBarrierSegment { readonly updatedAt?: string; readonly updatedBy?: UserBase; } -export interface ShieldInformationBarrierReportShieldInformationBarrierField { -} -export type ShieldInformationBarrierReportStatusField = "pending" | "error" | "done" | "cancelled"; -export interface ShieldInformationBarrierReportDetailsField { -} -export type ShieldInformationBarrierReport = ShieldInformationBarrierReportBase & { - readonly shieldInformationBarrier?: ShieldInformationBarrierReportShieldInformationBarrierField; - /** - * Status of the shield information report */ - readonly status?: ShieldInformationBarrierReportStatusField; - readonly details?: ShieldInformationBarrierReportDetailsField; - /** - * ISO date time string when this - * shield information barrier report object was created. */ - readonly createdAt?: string; - readonly createdBy?: UserBase; - /** - * ISO date time string when this - * shield information barrier report was updated. */ - readonly updatedAt?: string; -}; export type ShieldInformationBarrierTypeField = "shield_information_barrier"; export type ShieldInformationBarrierStatusField = "draft" | "pending" | "disabled" | "enabled" | "invalid"; export interface ShieldInformationBarrier { @@ -1997,6 +1972,11 @@ export interface FolderFullPermissionsField { readonly canUpload?: boolean; } export interface FolderFullMetadataField { + readonly extraData?: { + readonly [key: string]: { + readonly [key: string]: Metadata; + }; + }; } export type FolderFullAllowedSharedLinkAccessLevelsField = "open" | "company" | "collaborators"; export type FolderFullAllowedInviteeRolesField = "editor" | "viewer" | "previewer" | "uploader" | "previewer uploader" | "viewer uploader" | "co-owner"; @@ -2354,14 +2334,8 @@ export interface IntegrationMappingPartnerItemSlack { readonly slackOrgId?: string; } export type IntegrationMappingTypeField = "integration_mapping"; -export interface IntegrationMappingBoxItemField { -} export interface IntegrationMappingOptionsField { } -export interface IntegrationMappingCreatedByField { -} -export interface IntegrationMappingModifiedByField { -} export type IntegrationMapping = IntegrationMappingBase & { /** * Mapping type */ @@ -2372,7 +2346,7 @@ export type IntegrationMapping = IntegrationMappingBase & { /** * The Box folder, to which the object from the * partner app domain (referenced in `partner_item_id`) is mapped */ - readonly boxItem: IntegrationMappingBoxItemField; + readonly boxItem: FolderMini; /** * Identifies whether the mapping has * been manually set @@ -2384,11 +2358,11 @@ export type IntegrationMapping = IntegrationMappingBase & { /** * An object representing the user who * created the integration mapping */ - readonly createdBy?: IntegrationMappingCreatedByField; + readonly createdBy?: UserIntegrationMappings; /** * The user who * last modified the integration mapping */ - readonly modifiedBy?: IntegrationMappingModifiedByField; + readonly modifiedBy?: UserIntegrationMappings; /** * When the integration mapping object was created */ readonly createdAt?: string; @@ -2407,6 +2381,11 @@ export interface IntegrationMappingBoxItemSlack { readonly type: IntegrationMappingBoxItemSlackTypeField; readonly id: string; } +export interface IntegrationMappingSlackCreateRequest { + readonly partnerItem: IntegrationMappingPartnerItemSlack; + readonly boxItem: IntegrationMappingBoxItemSlack; + readonly options?: IntegrationMappingSlackOptions; +} export type TimelineSkillCardTypeField = "skill_card"; export type TimelineSkillCardSkillCardTypeField = "timeline"; export interface TimelineSkillCardSkillCardTitleField { @@ -2731,6 +2710,23 @@ export interface ShieldInformationBarrierReportDetailsDetailsField { export interface ShieldInformationBarrierReportDetails { readonly details?: ShieldInformationBarrierReportDetailsDetailsField; } +export type ShieldInformationBarrierReportStatusField = "pending" | "error" | "done" | "cancelled"; +export type ShieldInformationBarrierReport = ShieldInformationBarrierReportBase & { + readonly shieldInformationBarrier?: ShieldInformationBarrierReference; + /** + * Status of the shield information report */ + readonly status?: ShieldInformationBarrierReportStatusField; + readonly details?: ShieldInformationBarrierReportDetails; + /** + * ISO date time string when this + * shield information barrier report object was created. */ + readonly createdAt?: string; + readonly createdBy?: UserBase; + /** + * ISO date time string when this + * shield information barrier report was updated. */ + readonly updatedAt?: string; +}; export type TrackingCodeTypeField = "tracking_code"; export interface TrackingCode { readonly type?: TrackingCodeTypeField; @@ -2796,16 +2792,47 @@ export interface MetadataFilter { readonly templateKey?: string; readonly filters?: MetadataFilterFiltersField; } -export interface MetadataFieldFilterString { -} -export interface MetadataFieldFilterFloat { -} -export interface MetadataFieldFilterMultiSelect { -} -export interface MetadataFieldFilterFloatRange { -} -export interface MetadataFieldFilterDateRange { -} +export type MetadataFieldFilterString = { + readonly [key: string]: string; +}; +export type MetadataFieldFilterFloat = { + readonly [key: string]: number; +}; +export type MetadataFieldFilterMultiSelect = { + readonly [key: string]: readonly string[]; +}; +export type MetadataFieldFilterFloatRange = { + readonly [key: string]: { + /** + * Specifies the (inclusive) upper bound for the metadata field + * value. The value of a field must be lower than (`lt`) or + * equal to this value for the search query to match this + * template. */ + readonly lt?: number; + /** + * Specifies the (inclusive) lower bound for the metadata field + * value. The value of a field must be greater than (`gt`) or + * equal to this value for the search query to match this + * template. */ + readonly gt?: number; + }; +}; +export type MetadataFieldFilterDateRange = { + readonly [key: string]: { + /** + * Specifies the (inclusive) upper bound for the metadata field + * value. The value of a field must be lower than (`lt`) or + * equal to this value for the search query to match this + * template. */ + readonly lt?: string; + /** + * Specifies the (inclusive) lower bound for the metadata field + * value. The value of a field must be greater than (`gt`) or + * equal to this value for the search query to match this + * template. */ + readonly gt?: string; + }; +}; export function serializePostOAuth2TokenGrantTypeField(val: PostOAuth2TokenGrantTypeField): Json { return val; } @@ -2870,24 +2897,24 @@ export function deserializePostOAuth2TokenBoxSubjectTypeField(val: any): PostOAu throw "".concat("Invalid value: ", val) as string; } export function serializePostOAuth2Token(val: PostOAuth2Token): Json { - return { ["grant_type"]: serializePostOAuth2TokenGrantTypeField(val.grantType), ["client_id"]: val.clientId, ["client_secret"]: val.clientSecret, ["code"]: val.code, ["refresh_token"]: val.refreshToken, ["assertion"]: val.assertion, ["subject_token"]: val.subjectToken, ["subject_token_type"]: val.subjectTokenType == void 0 ? void 0 : serializePostOAuth2TokenSubjectTokenTypeField(val.subjectTokenType), ["actor_token"]: val.actorToken, ["actor_token_type"]: val.actorTokenType == void 0 ? void 0 : serializePostOAuth2TokenActorTokenTypeField(val.actorTokenType), ["scope"]: val.scope, ["resource"]: val.resource, ["box_subject_type"]: val.boxSubjectType == void 0 ? void 0 : serializePostOAuth2TokenBoxSubjectTypeField(val.boxSubjectType), ["box_subject_id"]: val.boxSubjectId, ["box_shared_link"]: val.boxSharedLink }; + return { ["grant_type"]: serializePostOAuth2TokenGrantTypeField(val.grantType), ["client_id"]: val.clientId == void 0 ? void 0 : val.clientId, ["client_secret"]: val.clientSecret == void 0 ? void 0 : val.clientSecret, ["code"]: val.code == void 0 ? void 0 : val.code, ["refresh_token"]: val.refreshToken == void 0 ? void 0 : val.refreshToken, ["assertion"]: val.assertion == void 0 ? void 0 : val.assertion, ["subject_token"]: val.subjectToken == void 0 ? void 0 : val.subjectToken, ["subject_token_type"]: val.subjectTokenType == void 0 ? void 0 : serializePostOAuth2TokenSubjectTokenTypeField(val.subjectTokenType), ["actor_token"]: val.actorToken == void 0 ? void 0 : val.actorToken, ["actor_token_type"]: val.actorTokenType == void 0 ? void 0 : serializePostOAuth2TokenActorTokenTypeField(val.actorTokenType), ["scope"]: val.scope == void 0 ? void 0 : val.scope, ["resource"]: val.resource == void 0 ? void 0 : val.resource, ["box_subject_type"]: val.boxSubjectType == void 0 ? void 0 : serializePostOAuth2TokenBoxSubjectTypeField(val.boxSubjectType), ["box_subject_id"]: val.boxSubjectId == void 0 ? void 0 : val.boxSubjectId, ["box_shared_link"]: val.boxSharedLink == void 0 ? void 0 : val.boxSharedLink }; } export function deserializePostOAuth2Token(val: any): PostOAuth2Token { const grantType: PostOAuth2TokenGrantTypeField = deserializePostOAuth2TokenGrantTypeField(val.grant_type); - const clientId: undefined | string = isJson(val.client_id, "string") ? val.client_id : void 0; - const clientSecret: undefined | string = isJson(val.client_secret, "string") ? val.client_secret : void 0; - const code: undefined | string = isJson(val.code, "string") ? val.code : void 0; - const refreshToken: undefined | string = isJson(val.refresh_token, "string") ? val.refresh_token : void 0; - const assertion: undefined | string = isJson(val.assertion, "string") ? val.assertion : void 0; - const subjectToken: undefined | string = isJson(val.subject_token, "string") ? val.subject_token : void 0; + const clientId: undefined | string = val.client_id == void 0 ? void 0 : val.client_id; + const clientSecret: undefined | string = val.client_secret == void 0 ? void 0 : val.client_secret; + const code: undefined | string = val.code == void 0 ? void 0 : val.code; + const refreshToken: undefined | string = val.refresh_token == void 0 ? void 0 : val.refresh_token; + const assertion: undefined | string = val.assertion == void 0 ? void 0 : val.assertion; + const subjectToken: undefined | string = val.subject_token == void 0 ? void 0 : val.subject_token; const subjectTokenType: undefined | PostOAuth2TokenSubjectTokenTypeField = val.subject_token_type == void 0 ? void 0 : deserializePostOAuth2TokenSubjectTokenTypeField(val.subject_token_type); - const actorToken: undefined | string = isJson(val.actor_token, "string") ? val.actor_token : void 0; + const actorToken: undefined | string = val.actor_token == void 0 ? void 0 : val.actor_token; const actorTokenType: undefined | PostOAuth2TokenActorTokenTypeField = val.actor_token_type == void 0 ? void 0 : deserializePostOAuth2TokenActorTokenTypeField(val.actor_token_type); - const scope: undefined | string = isJson(val.scope, "string") ? val.scope : void 0; - const resource: undefined | string = isJson(val.resource, "string") ? val.resource : void 0; + const scope: undefined | string = val.scope == void 0 ? void 0 : val.scope; + const resource: undefined | string = val.resource == void 0 ? void 0 : val.resource; const boxSubjectType: undefined | PostOAuth2TokenBoxSubjectTypeField = val.box_subject_type == void 0 ? void 0 : deserializePostOAuth2TokenBoxSubjectTypeField(val.box_subject_type); - const boxSubjectId: undefined | string = isJson(val.box_subject_id, "string") ? val.box_subject_id : void 0; - const boxSharedLink: undefined | string = isJson(val.box_shared_link, "string") ? val.box_shared_link : void 0; + const boxSubjectId: undefined | string = val.box_subject_id == void 0 ? void 0 : val.box_subject_id; + const boxSharedLink: undefined | string = val.box_shared_link == void 0 ? void 0 : val.box_shared_link; return { grantType: grantType, clientId: clientId, clientSecret: clientSecret, code: code, refreshToken: refreshToken, assertion: assertion, subjectToken: subjectToken, subjectTokenType: subjectTokenType, actorToken: actorToken, actorTokenType: actorTokenType, scope: scope, resource: resource, boxSubjectType: boxSubjectType, boxSubjectId: boxSubjectId, boxSharedLink: boxSharedLink } satisfies PostOAuth2Token; } export function serializePostOAuth2TokenRefreshAccessTokenGrantTypeField(val: PostOAuth2TokenRefreshAccessTokenGrantTypeField): Json { @@ -2913,12 +2940,12 @@ export function deserializePostOAuth2TokenRefreshAccessToken(val: any): PostOAut return { grantType: grantType, clientId: clientId, clientSecret: clientSecret, refreshToken: refreshToken } satisfies PostOAuth2TokenRefreshAccessToken; } export function serializePostOAuth2Revoke(val: PostOAuth2Revoke): Json { - return { ["client_id"]: val.clientId, ["client_secret"]: val.clientSecret, ["token"]: val.token }; + return { ["client_id"]: val.clientId == void 0 ? void 0 : val.clientId, ["client_secret"]: val.clientSecret == void 0 ? void 0 : val.clientSecret, ["token"]: val.token == void 0 ? void 0 : val.token }; } export function deserializePostOAuth2Revoke(val: any): PostOAuth2Revoke { - const clientId: undefined | string = isJson(val.client_id, "string") ? val.client_id : void 0; - const clientSecret: undefined | string = isJson(val.client_secret, "string") ? val.client_secret : void 0; - const token: undefined | string = isJson(val.token, "string") ? val.token : void 0; + const clientId: undefined | string = val.client_id == void 0 ? void 0 : val.client_id; + const clientSecret: undefined | string = val.client_secret == void 0 ? void 0 : val.client_secret; + const token: undefined | string = val.token == void 0 ? void 0 : val.token; return { clientId: clientId, clientSecret: clientSecret, token: token } satisfies PostOAuth2Revoke; } export function serializeZipDownloadRequestItemsFieldTypeField(val: ZipDownloadRequestItemsFieldTypeField): Json { @@ -2947,21 +2974,15 @@ export function deserializeZipDownloadRequestItemsField(val: any): ZipDownloadRe export function serializeZipDownloadRequest(val: ZipDownloadRequest): Json { return { ["items"]: val.items.map(function (item: ZipDownloadRequestItemsField): any { return serializeZipDownloadRequestItemsField(item); - }) as readonly any[], ["download_file_name"]: val.downloadFileName }; + }) as readonly any[], ["download_file_name"]: val.downloadFileName == void 0 ? void 0 : val.downloadFileName }; } export function deserializeZipDownloadRequest(val: any): ZipDownloadRequest { - const items: readonly ZipDownloadRequestItemsField[] = val.items.map(function (itm: Json): any { + const items: readonly ZipDownloadRequestItemsField[] = isJson(val.items, "array") ? val.items.map(function (itm: Json): any { return deserializeZipDownloadRequestItemsField(itm); - }) as readonly any[]; - const downloadFileName: undefined | string = isJson(val.download_file_name, "string") ? val.download_file_name : void 0; + }) as readonly any[] : []; + const downloadFileName: undefined | string = val.download_file_name == void 0 ? void 0 : val.download_file_name; return { items: items, downloadFileName: downloadFileName } satisfies ZipDownloadRequest; } -export function serializeMetadataQueryQueryParamsField(val: MetadataQueryQueryParamsField): Json { - return {}; -} -export function deserializeMetadataQueryQueryParamsField(val: any): MetadataQueryQueryParamsField { - return {} satisfies MetadataQueryQueryParamsField; -} export function serializeMetadataQueryOrderByFieldDirectionField(val: MetadataQueryOrderByFieldDirectionField): Json { return val; } @@ -2978,33 +2999,35 @@ export function deserializeMetadataQueryOrderByFieldDirectionField(val: any): Me throw "".concat("Invalid value: ", val) as string; } export function serializeMetadataQueryOrderByField(val: MetadataQueryOrderByField): Json { - return { ["field_key"]: val.fieldKey, ["direction"]: val.direction == void 0 ? void 0 : serializeMetadataQueryOrderByFieldDirectionField(val.direction) }; + return { ["field_key"]: val.fieldKey == void 0 ? void 0 : val.fieldKey, ["direction"]: val.direction == void 0 ? void 0 : serializeMetadataQueryOrderByFieldDirectionField(val.direction) }; } export function deserializeMetadataQueryOrderByField(val: any): MetadataQueryOrderByField { - const fieldKey: undefined | string = isJson(val.field_key, "string") ? val.field_key : void 0; + const fieldKey: undefined | string = val.field_key == void 0 ? void 0 : val.field_key; const direction: undefined | MetadataQueryOrderByFieldDirectionField = val.direction == void 0 ? void 0 : deserializeMetadataQueryOrderByFieldDirectionField(val.direction); return { fieldKey: fieldKey, direction: direction } satisfies MetadataQueryOrderByField; } export function serializeMetadataQuery(val: MetadataQuery): Json { - return { ["from"]: val.from, ["query"]: val.query, ["query_params"]: val.queryParams == void 0 ? void 0 : serializeMetadataQueryQueryParamsField(val.queryParams), ["ancestor_folder_id"]: val.ancestorFolderId, ["order_by"]: val.orderBy == void 0 ? void 0 : val.orderBy.map(function (item: MetadataQueryOrderByField): any { + return { ["from"]: val.from, ["query"]: val.query == void 0 ? void 0 : val.query, ["query_params"]: val.queryParams == void 0 ? void 0 : val.queryParams, ["ancestor_folder_id"]: val.ancestorFolderId, ["order_by"]: val.orderBy == void 0 ? void 0 : val.orderBy.map(function (item: MetadataQueryOrderByField): any { return serializeMetadataQueryOrderByField(item); - }) as readonly any[], ["limit"]: val.limit, ["marker"]: val.marker, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: string): undefined { - return void 0; + }) as readonly any[], ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["marker"]: val.marker == void 0 ? void 0 : val.marker, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: string): string { + return item; }) as readonly any[] }; } export function deserializeMetadataQuery(val: any): MetadataQuery { const from: string = val.from; - const query: undefined | string = isJson(val.query, "string") ? val.query : void 0; - const queryParams: undefined | MetadataQueryQueryParamsField = val.query_params == void 0 ? void 0 : deserializeMetadataQueryQueryParamsField(val.query_params); + const query: undefined | string = val.query == void 0 ? void 0 : val.query; + const queryParams: undefined | { + readonly [key: string]: string; + } = val.query_params == void 0 ? void 0 : val.query_params; const ancestorFolderId: string = val.ancestor_folder_id; - const orderBy: undefined | readonly MetadataQueryOrderByField[] = isJson(val.order_by, "array") ? val.order_by.map(function (itm: Json): any { + const orderBy: undefined | readonly MetadataQueryOrderByField[] = val.order_by == void 0 ? void 0 : isJson(val.order_by, "array") ? val.order_by.map(function (itm: Json): any { return deserializeMetadataQueryOrderByField(itm); - }) as readonly any[] : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const marker: undefined | string = isJson(val.marker, "string") ? val.marker : void 0; - const fields: undefined | readonly string[] = isJson(val.fields, "array") ? val.fields.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; + }) as readonly any[] : []; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const marker: undefined | string = val.marker == void 0 ? void 0 : val.marker; + const fields: undefined | readonly string[] = val.fields == void 0 ? void 0 : isJson(val.fields, "array") ? val.fields.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; return { from: from, query: query, queryParams: queryParams, ancestorFolderId: ancestorFolderId, orderBy: orderBy, limit: limit, marker: marker, fields: fields } satisfies MetadataQuery; } export function serializeFileRequestUpdateRequestStatusField(val: FileRequestUpdateRequestStatusField): Json { @@ -3023,15 +3046,15 @@ export function deserializeFileRequestUpdateRequestStatusField(val: any): FileRe throw "".concat("Invalid value: ", val) as string; } export function serializeFileRequestUpdateRequest(val: FileRequestUpdateRequest): Json { - return { ["title"]: val.title, ["description"]: val.description, ["status"]: val.status == void 0 ? void 0 : serializeFileRequestUpdateRequestStatusField(val.status), ["is_email_required"]: val.isEmailRequired, ["is_description_required"]: val.isDescriptionRequired, ["expires_at"]: val.expiresAt }; + return { ["title"]: val.title == void 0 ? void 0 : val.title, ["description"]: val.description == void 0 ? void 0 : val.description, ["status"]: val.status == void 0 ? void 0 : serializeFileRequestUpdateRequestStatusField(val.status), ["is_email_required"]: val.isEmailRequired == void 0 ? void 0 : val.isEmailRequired, ["is_description_required"]: val.isDescriptionRequired == void 0 ? void 0 : val.isDescriptionRequired, ["expires_at"]: val.expiresAt == void 0 ? void 0 : val.expiresAt }; } export function deserializeFileRequestUpdateRequest(val: any): FileRequestUpdateRequest { - const title: undefined | string = isJson(val.title, "string") ? val.title : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const title: undefined | string = val.title == void 0 ? void 0 : val.title; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const status: undefined | FileRequestUpdateRequestStatusField = val.status == void 0 ? void 0 : deserializeFileRequestUpdateRequestStatusField(val.status); - const isEmailRequired: undefined | boolean = isJson(val.is_email_required, "boolean") ? val.is_email_required : void 0; - const isDescriptionRequired: undefined | boolean = isJson(val.is_description_required, "boolean") ? val.is_description_required : void 0; - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; + const isEmailRequired: undefined | boolean = val.is_email_required == void 0 ? void 0 : val.is_email_required; + const isDescriptionRequired: undefined | boolean = val.is_description_required == void 0 ? void 0 : val.is_description_required; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; return { title: title, description: description, status: status, isEmailRequired: isEmailRequired, isDescriptionRequired: isDescriptionRequired, expiresAt: expiresAt } satisfies FileRequestUpdateRequest; } export function serializeFileRequestCopyRequestFolderFieldTypeField(val: FileRequestCopyRequestFolderFieldTypeField): Json { @@ -3063,41 +3086,14 @@ export function serializeFileRequestCopyRequest(val: FileRequestCopyRequest): Js } export function deserializeFileRequestCopyRequest(val: any): FileRequestCopyRequest { const folder: FileRequestCopyRequestFolderField = deserializeFileRequestCopyRequestFolderField(val.folder); - const title: undefined | string = isJson(val.title, "string") ? val.title : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const title: undefined | string = val.title == void 0 ? void 0 : val.title; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const status: undefined | FileRequestUpdateRequestStatusField = val.status == void 0 ? void 0 : deserializeFileRequestUpdateRequestStatusField(val.status); - const isEmailRequired: undefined | boolean = isJson(val.is_email_required, "boolean") ? val.is_email_required : void 0; - const isDescriptionRequired: undefined | boolean = isJson(val.is_description_required, "boolean") ? val.is_description_required : void 0; - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; + const isEmailRequired: undefined | boolean = val.is_email_required == void 0 ? void 0 : val.is_email_required; + const isDescriptionRequired: undefined | boolean = val.is_description_required == void 0 ? void 0 : val.is_description_required; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; return { folder: folder, title: title, description: description, status: status, isEmailRequired: isEmailRequired, isDescriptionRequired: isDescriptionRequired, expiresAt: expiresAt } satisfies FileRequestCopyRequest; } -export function serializeIntegrationMappingSlackCreateRequestPartnerItemField(val: IntegrationMappingSlackCreateRequestPartnerItemField): Json { - return {}; -} -export function deserializeIntegrationMappingSlackCreateRequestPartnerItemField(val: any): IntegrationMappingSlackCreateRequestPartnerItemField { - return {} satisfies IntegrationMappingSlackCreateRequestPartnerItemField; -} -export function serializeIntegrationMappingSlackCreateRequestBoxItemField(val: IntegrationMappingSlackCreateRequestBoxItemField): Json { - return {}; -} -export function deserializeIntegrationMappingSlackCreateRequestBoxItemField(val: any): IntegrationMappingSlackCreateRequestBoxItemField { - return {} satisfies IntegrationMappingSlackCreateRequestBoxItemField; -} -export function serializeIntegrationMappingSlackCreateRequestOptionsField(val: IntegrationMappingSlackCreateRequestOptionsField): Json { - return {}; -} -export function deserializeIntegrationMappingSlackCreateRequestOptionsField(val: any): IntegrationMappingSlackCreateRequestOptionsField { - return {} satisfies IntegrationMappingSlackCreateRequestOptionsField; -} -export function serializeIntegrationMappingSlackCreateRequest(val: IntegrationMappingSlackCreateRequest): Json { - return { ["partner_item"]: serializeIntegrationMappingSlackCreateRequestPartnerItemField(val.partnerItem), ["box_item"]: serializeIntegrationMappingSlackCreateRequestBoxItemField(val.boxItem), ["options"]: val.options == void 0 ? void 0 : serializeIntegrationMappingSlackCreateRequestOptionsField(val.options) }; -} -export function deserializeIntegrationMappingSlackCreateRequest(val: any): IntegrationMappingSlackCreateRequest { - const partnerItem: IntegrationMappingSlackCreateRequestPartnerItemField = deserializeIntegrationMappingSlackCreateRequestPartnerItemField(val.partner_item); - const boxItem: IntegrationMappingSlackCreateRequestBoxItemField = deserializeIntegrationMappingSlackCreateRequestBoxItemField(val.box_item); - const options: undefined | IntegrationMappingSlackCreateRequestOptionsField = val.options == void 0 ? void 0 : deserializeIntegrationMappingSlackCreateRequestOptionsField(val.options); - return { partnerItem: partnerItem, boxItem: boxItem, options: options } satisfies IntegrationMappingSlackCreateRequest; -} export function serializeClientErrorTypeField(val: ClientErrorTypeField): Json { return val; } @@ -3171,31 +3167,31 @@ export function deserializeClientErrorCodeField(val: any): ClientErrorCodeField throw "".concat("Invalid value: ", val) as string; } export function serializeClientErrorContextInfoField(val: ClientErrorContextInfoField): Json { - return { ["message"]: val.message }; + return { ["message"]: val.message == void 0 ? void 0 : val.message }; } export function deserializeClientErrorContextInfoField(val: any): ClientErrorContextInfoField { - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; return { message: message } satisfies ClientErrorContextInfoField; } export function serializeClientError(val: ClientError): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeClientErrorTypeField(val.type), ["status"]: val.status, ["code"]: val.code == void 0 ? void 0 : serializeClientErrorCodeField(val.code), ["message"]: val.message, ["context_info"]: val.contextInfo == void 0 ? void 0 : serializeClientErrorContextInfoField(val.contextInfo), ["help_url"]: val.helpUrl, ["request_id"]: val.requestId }; + return { ["type"]: val.type == void 0 ? void 0 : serializeClientErrorTypeField(val.type), ["status"]: val.status == void 0 ? void 0 : val.status, ["code"]: val.code == void 0 ? void 0 : serializeClientErrorCodeField(val.code), ["message"]: val.message == void 0 ? void 0 : val.message, ["context_info"]: val.contextInfo == void 0 ? void 0 : serializeClientErrorContextInfoField(val.contextInfo), ["help_url"]: val.helpUrl == void 0 ? void 0 : val.helpUrl, ["request_id"]: val.requestId == void 0 ? void 0 : val.requestId }; } export function deserializeClientError(val: any): ClientError { const type: undefined | ClientErrorTypeField = val.type == void 0 ? void 0 : deserializeClientErrorTypeField(val.type); - const status: undefined | number = isJson(val.status, "number") ? val.status : void 0; + const status: undefined | number = val.status == void 0 ? void 0 : val.status; const code: undefined | ClientErrorCodeField = val.code == void 0 ? void 0 : deserializeClientErrorCodeField(val.code); - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; const contextInfo: undefined | ClientErrorContextInfoField = val.context_info == void 0 ? void 0 : deserializeClientErrorContextInfoField(val.context_info); - const helpUrl: undefined | string = isJson(val.help_url, "string") ? val.help_url : void 0; - const requestId: undefined | string = isJson(val.request_id, "string") ? val.request_id : void 0; + const helpUrl: undefined | string = val.help_url == void 0 ? void 0 : val.help_url; + const requestId: undefined | string = val.request_id == void 0 ? void 0 : val.request_id; return { type: type, status: status, code: code, message: message, contextInfo: contextInfo, helpUrl: helpUrl, requestId: requestId } satisfies ClientError; } export function serializeOAuth2Error(val: OAuth2Error): Json { - return { ["error"]: val.error, ["error_description"]: val.errorDescription }; + return { ["error"]: val.error == void 0 ? void 0 : val.error, ["error_description"]: val.errorDescription == void 0 ? void 0 : val.errorDescription }; } export function deserializeOAuth2Error(val: any): OAuth2Error { - const error: undefined | string = isJson(val.error, "string") ? val.error : void 0; - const errorDescription: undefined | string = isJson(val.error_description, "string") ? val.error_description : void 0; + const error: undefined | string = val.error == void 0 ? void 0 : val.error; + const errorDescription: undefined | string = val.error_description == void 0 ? void 0 : val.error_description; return { error: error, errorDescription: errorDescription } satisfies OAuth2Error; } export function serializeClassificationTemplateField(val: ClassificationTemplateField): Json { @@ -3211,17 +3207,17 @@ export function deserializeClassificationTemplateField(val: any): Classification throw "".concat("Invalid value: ", val) as string; } export function serializeClassification(val: Classification): Json { - return { ["Box__Security__Classification__Key"]: val.boxSecurityClassificationKey, ["$parent"]: val.parent, ["$template"]: val.template == void 0 ? void 0 : serializeClassificationTemplateField(val.template), ["$scope"]: val.scope, ["$version"]: val.version, ["$type"]: val.type, ["$typeVersion"]: val.typeVersion, ["$canEdit"]: val.canEdit }; + return { ["Box__Security__Classification__Key"]: val.boxSecurityClassificationKey == void 0 ? void 0 : val.boxSecurityClassificationKey, ["$parent"]: val.parent == void 0 ? void 0 : val.parent, ["$template"]: val.template == void 0 ? void 0 : serializeClassificationTemplateField(val.template), ["$scope"]: val.scope == void 0 ? void 0 : val.scope, ["$version"]: val.version == void 0 ? void 0 : val.version, ["$type"]: val.type == void 0 ? void 0 : val.type, ["$typeVersion"]: val.typeVersion == void 0 ? void 0 : val.typeVersion, ["$canEdit"]: val.canEdit == void 0 ? void 0 : val.canEdit }; } export function deserializeClassification(val: any): Classification { - const boxSecurityClassificationKey: undefined | string = isJson(val.Box__Security__Classification__Key, "string") ? val.Box__Security__Classification__Key : void 0; - const parent: undefined | string = isJson(val.$parent, "string") ? val.$parent : void 0; + const boxSecurityClassificationKey: undefined | string = val.Box__Security__Classification__Key == void 0 ? void 0 : val.Box__Security__Classification__Key; + const parent: undefined | string = val.$parent == void 0 ? void 0 : val.$parent; const template: undefined | ClassificationTemplateField = val.$template == void 0 ? void 0 : deserializeClassificationTemplateField(val.$template); - const scope: undefined | string = isJson(val.$scope, "string") ? val.$scope : void 0; - const version: undefined | number = isJson(val.$version, "number") ? val.$version : void 0; - const type: undefined | string = isJson(val.$type, "string") ? val.$type : void 0; - const typeVersion: undefined | number = isJson(val.$typeVersion, "number") ? val.$typeVersion : void 0; - const canEdit: undefined | boolean = isJson(val.$canEdit, "boolean") ? val.$canEdit : void 0; + const scope: undefined | string = val.$scope == void 0 ? void 0 : val.$scope; + const version: undefined | number = val.$version == void 0 ? void 0 : val.$version; + const type: undefined | string = val.$type == void 0 ? void 0 : val.$type; + const typeVersion: undefined | number = val.$typeVersion == void 0 ? void 0 : val.$typeVersion; + const canEdit: undefined | boolean = val.$canEdit == void 0 ? void 0 : val.$canEdit; return { boxSecurityClassificationKey: boxSecurityClassificationKey, parent: parent, template: template, scope: scope, version: version, type: type, typeVersion: typeVersion, canEdit: canEdit } satisfies Classification; } export function serializeClassificationTemplateTypeField(val: ClassificationTemplateTypeField): Json { @@ -3297,11 +3293,11 @@ export function deserializeClassificationTemplateFieldsFieldDisplayNameField(val throw "".concat("Invalid value: ", val) as string; } export function serializeClassificationTemplateFieldsFieldOptionsFieldStaticConfigFieldClassificationField(val: ClassificationTemplateFieldsFieldOptionsFieldStaticConfigFieldClassificationField): Json { - return { ["classificationDefinition"]: val.classificationDefinition, ["colorID"]: val.colorId }; + return { ["classificationDefinition"]: val.classificationDefinition == void 0 ? void 0 : val.classificationDefinition, ["colorID"]: val.colorId == void 0 ? void 0 : val.colorId }; } export function deserializeClassificationTemplateFieldsFieldOptionsFieldStaticConfigFieldClassificationField(val: any): ClassificationTemplateFieldsFieldOptionsFieldStaticConfigFieldClassificationField { - const classificationDefinition: undefined | string = isJson(val.classificationDefinition, "string") ? val.classificationDefinition : void 0; - const colorId: undefined | number = isJson(val.colorID, "number") ? val.colorID : void 0; + const classificationDefinition: undefined | string = val.classificationDefinition == void 0 ? void 0 : val.classificationDefinition; + const colorId: undefined | number = val.colorID == void 0 ? void 0 : val.colorID; return { classificationDefinition: classificationDefinition, colorId: colorId } satisfies ClassificationTemplateFieldsFieldOptionsFieldStaticConfigFieldClassificationField; } export function serializeClassificationTemplateFieldsFieldOptionsFieldStaticConfigField(val: ClassificationTemplateFieldsFieldOptionsFieldStaticConfigField): Json { @@ -3312,46 +3308,46 @@ export function deserializeClassificationTemplateFieldsFieldOptionsFieldStaticCo return { classification: classification } satisfies ClassificationTemplateFieldsFieldOptionsFieldStaticConfigField; } export function serializeClassificationTemplateFieldsFieldOptionsField(val: ClassificationTemplateFieldsFieldOptionsField): Json { - return { ["id"]: val.id, ["key"]: val.key, ["staticConfig"]: val.staticConfig == void 0 ? void 0 : serializeClassificationTemplateFieldsFieldOptionsFieldStaticConfigField(val.staticConfig) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["key"]: val.key == void 0 ? void 0 : val.key, ["staticConfig"]: val.staticConfig == void 0 ? void 0 : serializeClassificationTemplateFieldsFieldOptionsFieldStaticConfigField(val.staticConfig) }; } export function deserializeClassificationTemplateFieldsFieldOptionsField(val: any): ClassificationTemplateFieldsFieldOptionsField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const key: undefined | string = isJson(val.key, "string") ? val.key : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const key: undefined | string = val.key == void 0 ? void 0 : val.key; const staticConfig: undefined | ClassificationTemplateFieldsFieldOptionsFieldStaticConfigField = val.staticConfig == void 0 ? void 0 : deserializeClassificationTemplateFieldsFieldOptionsFieldStaticConfigField(val.staticConfig); return { id: id, key: key, staticConfig: staticConfig } satisfies ClassificationTemplateFieldsFieldOptionsField; } export function serializeClassificationTemplateFieldsField(val: ClassificationTemplateFieldsField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeClassificationTemplateFieldsFieldTypeField(val.type), ["key"]: val.key == void 0 ? void 0 : serializeClassificationTemplateFieldsFieldKeyField(val.key), ["displayName"]: val.displayName == void 0 ? void 0 : serializeClassificationTemplateFieldsFieldDisplayNameField(val.displayName), ["hidden"]: val.hidden, ["options"]: val.options == void 0 ? void 0 : val.options.map(function (item: ClassificationTemplateFieldsFieldOptionsField): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeClassificationTemplateFieldsFieldTypeField(val.type), ["key"]: val.key == void 0 ? void 0 : serializeClassificationTemplateFieldsFieldKeyField(val.key), ["displayName"]: val.displayName == void 0 ? void 0 : serializeClassificationTemplateFieldsFieldDisplayNameField(val.displayName), ["hidden"]: val.hidden == void 0 ? void 0 : val.hidden, ["options"]: val.options == void 0 ? void 0 : val.options.map(function (item: ClassificationTemplateFieldsFieldOptionsField): any { return serializeClassificationTemplateFieldsFieldOptionsField(item); }) as readonly any[] }; } export function deserializeClassificationTemplateFieldsField(val: any): ClassificationTemplateFieldsField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ClassificationTemplateFieldsFieldTypeField = val.type == void 0 ? void 0 : deserializeClassificationTemplateFieldsFieldTypeField(val.type); const key: undefined | ClassificationTemplateFieldsFieldKeyField = val.key == void 0 ? void 0 : deserializeClassificationTemplateFieldsFieldKeyField(val.key); const displayName: undefined | ClassificationTemplateFieldsFieldDisplayNameField = val.displayName == void 0 ? void 0 : deserializeClassificationTemplateFieldsFieldDisplayNameField(val.displayName); - const hidden: undefined | boolean = isJson(val.hidden, "boolean") ? val.hidden : void 0; - const options: undefined | readonly ClassificationTemplateFieldsFieldOptionsField[] = isJson(val.options, "array") ? val.options.map(function (itm: Json): any { + const hidden: undefined | boolean = val.hidden == void 0 ? void 0 : val.hidden; + const options: undefined | readonly ClassificationTemplateFieldsFieldOptionsField[] = val.options == void 0 ? void 0 : isJson(val.options, "array") ? val.options.map(function (itm: Json): any { return deserializeClassificationTemplateFieldsFieldOptionsField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { id: id, type: type, key: key, displayName: displayName, hidden: hidden, options: options } satisfies ClassificationTemplateFieldsField; } export function serializeClassificationTemplate(val: ClassificationTemplate): Json { - return { ["id"]: val.id, ["type"]: serializeClassificationTemplateTypeField(val.type), ["scope"]: val.scope, ["templateKey"]: val.templateKey == void 0 ? void 0 : serializeClassificationTemplateTemplateKeyField(val.templateKey), ["displayName"]: val.displayName == void 0 ? void 0 : serializeClassificationTemplateDisplayNameField(val.displayName), ["hidden"]: val.hidden, ["copyInstanceOnItemCopy"]: val.copyInstanceOnItemCopy, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: ClassificationTemplateFieldsField): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: serializeClassificationTemplateTypeField(val.type), ["scope"]: val.scope == void 0 ? void 0 : val.scope, ["templateKey"]: val.templateKey == void 0 ? void 0 : serializeClassificationTemplateTemplateKeyField(val.templateKey), ["displayName"]: val.displayName == void 0 ? void 0 : serializeClassificationTemplateDisplayNameField(val.displayName), ["hidden"]: val.hidden == void 0 ? void 0 : val.hidden, ["copyInstanceOnItemCopy"]: val.copyInstanceOnItemCopy == void 0 ? void 0 : val.copyInstanceOnItemCopy, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: ClassificationTemplateFieldsField): any { return serializeClassificationTemplateFieldsField(item); }) as readonly any[] }; } export function deserializeClassificationTemplate(val: any): ClassificationTemplate { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: ClassificationTemplateTypeField = deserializeClassificationTemplateTypeField(val.type); - const scope: undefined | string = isJson(val.scope, "string") ? val.scope : void 0; + const scope: undefined | string = val.scope == void 0 ? void 0 : val.scope; const templateKey: undefined | ClassificationTemplateTemplateKeyField = val.templateKey == void 0 ? void 0 : deserializeClassificationTemplateTemplateKeyField(val.templateKey); const displayName: undefined | ClassificationTemplateDisplayNameField = val.displayName == void 0 ? void 0 : deserializeClassificationTemplateDisplayNameField(val.displayName); - const hidden: undefined | boolean = isJson(val.hidden, "boolean") ? val.hidden : void 0; - const copyInstanceOnItemCopy: undefined | boolean = isJson(val.copyInstanceOnItemCopy, "boolean") ? val.copyInstanceOnItemCopy : void 0; - const fields: undefined | readonly ClassificationTemplateFieldsField[] = isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { + const hidden: undefined | boolean = val.hidden == void 0 ? void 0 : val.hidden; + const copyInstanceOnItemCopy: undefined | boolean = val.copyInstanceOnItemCopy == void 0 ? void 0 : val.copyInstanceOnItemCopy; + const fields: undefined | readonly ClassificationTemplateFieldsField[] = val.fields == void 0 ? void 0 : isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { return deserializeClassificationTemplateFieldsField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { id: id, type: type, scope: scope, templateKey: templateKey, displayName: displayName, hidden: hidden, copyInstanceOnItemCopy: copyInstanceOnItemCopy, fields: fields } satisfies ClassificationTemplate; } export function serializeCollaborationAllowlistEntryTypeField(val: CollaborationAllowlistEntryTypeField): Json { @@ -3397,38 +3393,38 @@ export function deserializeCollaborationAllowlistEntryEnterpriseFieldTypeField(v throw "".concat("Invalid value: ", val) as string; } export function serializeCollaborationAllowlistEntryEnterpriseField(val: CollaborationAllowlistEntryEnterpriseField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistEntryEnterpriseFieldTypeField(val.type), ["name"]: val.name }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistEntryEnterpriseFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeCollaborationAllowlistEntryEnterpriseField(val: any): CollaborationAllowlistEntryEnterpriseField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CollaborationAllowlistEntryEnterpriseFieldTypeField = val.type == void 0 ? void 0 : deserializeCollaborationAllowlistEntryEnterpriseFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { id: id, type: type, name: name } satisfies CollaborationAllowlistEntryEnterpriseField; } export function serializeCollaborationAllowlistEntry(val: CollaborationAllowlistEntry): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistEntryTypeField(val.type), ["domain"]: val.domain, ["direction"]: val.direction == void 0 ? void 0 : serializeCollaborationAllowlistEntryDirectionField(val.direction), ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeCollaborationAllowlistEntryEnterpriseField(val.enterprise), ["created_at"]: val.createdAt }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistEntryTypeField(val.type), ["domain"]: val.domain == void 0 ? void 0 : val.domain, ["direction"]: val.direction == void 0 ? void 0 : serializeCollaborationAllowlistEntryDirectionField(val.direction), ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeCollaborationAllowlistEntryEnterpriseField(val.enterprise), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt }; } export function deserializeCollaborationAllowlistEntry(val: any): CollaborationAllowlistEntry { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CollaborationAllowlistEntryTypeField = val.type == void 0 ? void 0 : deserializeCollaborationAllowlistEntryTypeField(val.type); - const domain: undefined | string = isJson(val.domain, "string") ? val.domain : void 0; + const domain: undefined | string = val.domain == void 0 ? void 0 : val.domain; const direction: undefined | CollaborationAllowlistEntryDirectionField = val.direction == void 0 ? void 0 : deserializeCollaborationAllowlistEntryDirectionField(val.direction); const enterprise: undefined | CollaborationAllowlistEntryEnterpriseField = val.enterprise == void 0 ? void 0 : deserializeCollaborationAllowlistEntryEnterpriseField(val.enterprise); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; return { id: id, type: type, domain: domain, direction: direction, enterprise: enterprise, createdAt: createdAt } satisfies CollaborationAllowlistEntry; } export function serializeCollaborationAllowlistEntries(val: CollaborationAllowlistEntries): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: CollaborationAllowlistEntry): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: CollaborationAllowlistEntry): any { return serializeCollaborationAllowlistEntry(item); }) as readonly any[] }; } export function deserializeCollaborationAllowlistEntries(val: any): CollaborationAllowlistEntries { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly CollaborationAllowlistEntry[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly CollaborationAllowlistEntry[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeCollaborationAllowlistEntry(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies CollaborationAllowlistEntries; } export function serializeCollaborationAllowlistExemptTargetTypeField(val: CollaborationAllowlistExemptTargetTypeField): Json { @@ -3456,12 +3452,12 @@ export function deserializeCollaborationAllowlistExemptTargetEnterpriseFieldType throw "".concat("Invalid value: ", val) as string; } export function serializeCollaborationAllowlistExemptTargetEnterpriseField(val: CollaborationAllowlistExemptTargetEnterpriseField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetEnterpriseFieldTypeField(val.type), ["name"]: val.name }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetEnterpriseFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeCollaborationAllowlistExemptTargetEnterpriseField(val: any): CollaborationAllowlistExemptTargetEnterpriseField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CollaborationAllowlistExemptTargetEnterpriseFieldTypeField = val.type == void 0 ? void 0 : deserializeCollaborationAllowlistExemptTargetEnterpriseFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { id: id, type: type, name: name } satisfies CollaborationAllowlistExemptTargetEnterpriseField; } export function serializeCollaborationAllowlistExemptTargetUserFieldTypeField(val: CollaborationAllowlistExemptTargetUserFieldTypeField): Json { @@ -3477,38 +3473,38 @@ export function deserializeCollaborationAllowlistExemptTargetUserFieldTypeField( throw "".concat("Invalid value: ", val) as string; } export function serializeCollaborationAllowlistExemptTargetUserField(val: CollaborationAllowlistExemptTargetUserField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetUserFieldTypeField(val.type), ["name"]: val.name }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetUserFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeCollaborationAllowlistExemptTargetUserField(val: any): CollaborationAllowlistExemptTargetUserField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CollaborationAllowlistExemptTargetUserFieldTypeField = val.type == void 0 ? void 0 : deserializeCollaborationAllowlistExemptTargetUserFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { id: id, type: type, name: name } satisfies CollaborationAllowlistExemptTargetUserField; } export function serializeCollaborationAllowlistExemptTarget(val: CollaborationAllowlistExemptTarget): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetTypeField(val.type), ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetEnterpriseField(val.enterprise), ["user"]: val.user == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetUserField(val.user), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetTypeField(val.type), ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetEnterpriseField(val.enterprise), ["user"]: val.user == void 0 ? void 0 : serializeCollaborationAllowlistExemptTargetUserField(val.user), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt }; } export function deserializeCollaborationAllowlistExemptTarget(val: any): CollaborationAllowlistExemptTarget { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CollaborationAllowlistExemptTargetTypeField = val.type == void 0 ? void 0 : deserializeCollaborationAllowlistExemptTargetTypeField(val.type); const enterprise: undefined | CollaborationAllowlistExemptTargetEnterpriseField = val.enterprise == void 0 ? void 0 : deserializeCollaborationAllowlistExemptTargetEnterpriseField(val.enterprise); const user: undefined | CollaborationAllowlistExemptTargetUserField = val.user == void 0 ? void 0 : deserializeCollaborationAllowlistExemptTargetUserField(val.user); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; return { id: id, type: type, enterprise: enterprise, user: user, createdAt: createdAt, modifiedAt: modifiedAt } satisfies CollaborationAllowlistExemptTarget; } export function serializeCollaborationAllowlistExemptTargets(val: CollaborationAllowlistExemptTargets): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: CollaborationAllowlistExemptTarget): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: CollaborationAllowlistExemptTarget): any { return serializeCollaborationAllowlistExemptTarget(item); }) as readonly any[] }; } export function deserializeCollaborationAllowlistExemptTargets(val: any): CollaborationAllowlistExemptTargets { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly CollaborationAllowlistExemptTarget[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly CollaborationAllowlistExemptTarget[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeCollaborationAllowlistExemptTarget(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies CollaborationAllowlistExemptTargets; } export function serializeCollectionTypeField(val: CollectionTypeField): Json { @@ -3548,10 +3544,10 @@ export function deserializeCollectionCollectionTypeField(val: any): CollectionCo throw "".concat("Invalid value: ", val) as string; } export function serializeCollection(val: Collection): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollectionTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : serializeCollectionNameField(val.name), ["collection_type"]: val.collectionType == void 0 ? void 0 : serializeCollectionCollectionTypeField(val.collectionType) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollectionTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : serializeCollectionNameField(val.name), ["collection_type"]: val.collectionType == void 0 ? void 0 : serializeCollectionCollectionTypeField(val.collectionType) }; } export function deserializeCollection(val: any): Collection { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CollectionTypeField = val.type == void 0 ? void 0 : deserializeCollectionTypeField(val.type); const name: undefined | CollectionNameField = val.name == void 0 ? void 0 : deserializeCollectionNameField(val.name); const collectionType: undefined | CollectionCollectionTypeField = val.collection_type == void 0 ? void 0 : deserializeCollectionCollectionTypeField(val.collection_type); @@ -3573,30 +3569,30 @@ export function deserializeCollectionsOrderFieldDirectionField(val: any): Collec throw "".concat("Invalid value: ", val) as string; } export function serializeCollectionsOrderField(val: CollectionsOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeCollectionsOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeCollectionsOrderFieldDirectionField(val.direction) }; } export function deserializeCollectionsOrderField(val: any): CollectionsOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | CollectionsOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeCollectionsOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies CollectionsOrderField; } export function serializeCollections(val: Collections): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: CollectionsOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: CollectionsOrderField): any { return serializeCollectionsOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Collection): any { return serializeCollection(item); }) as readonly any[] }; } export function deserializeCollections(val: any): Collections { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly CollectionsOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly CollectionsOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeCollectionsOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly Collection[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly Collection[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeCollection(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies Collections; } export function serializeCommentBaseTypeField(val: CommentBaseTypeField): Json { @@ -3612,10 +3608,10 @@ export function deserializeCommentBaseTypeField(val: any): CommentBaseTypeField throw "".concat("Invalid value: ", val) as string; } export function serializeCommentBase(val: CommentBase): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCommentBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCommentBaseTypeField(val.type) }; } export function deserializeCommentBase(val: any): CommentBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CommentBaseTypeField = val.type == void 0 ? void 0 : deserializeCommentBaseTypeField(val.type); return { id: id, type: type } satisfies CommentBase; } @@ -3632,25 +3628,25 @@ export function deserializeEmailAliasTypeField(val: any): EmailAliasTypeField { throw "".concat("Invalid value: ", val) as string; } export function serializeEmailAlias(val: EmailAlias): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeEmailAliasTypeField(val.type), ["email"]: val.email, ["is_confirmed"]: val.isConfirmed }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeEmailAliasTypeField(val.type), ["email"]: val.email == void 0 ? void 0 : val.email, ["is_confirmed"]: val.isConfirmed == void 0 ? void 0 : val.isConfirmed }; } export function deserializeEmailAlias(val: any): EmailAlias { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | EmailAliasTypeField = val.type == void 0 ? void 0 : deserializeEmailAliasTypeField(val.type); - const email: undefined | string = isJson(val.email, "string") ? val.email : void 0; - const isConfirmed: undefined | boolean = isJson(val.is_confirmed, "boolean") ? val.is_confirmed : void 0; + const email: undefined | string = val.email == void 0 ? void 0 : val.email; + const isConfirmed: undefined | boolean = val.is_confirmed == void 0 ? void 0 : val.is_confirmed; return { id: id, type: type, email: email, isConfirmed: isConfirmed } satisfies EmailAlias; } export function serializeEmailAliases(val: EmailAliases): Json { - return { ["total_count"]: val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: EmailAlias): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: EmailAlias): any { return serializeEmailAlias(item); }) as readonly any[] }; } export function deserializeEmailAliases(val: any): EmailAliases { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const entries: undefined | readonly EmailAlias[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const entries: undefined | readonly EmailAlias[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeEmailAlias(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies EmailAliases; } export function serializeEnterpriseBaseTypeField(val: EnterpriseBaseTypeField): Json { @@ -3666,10 +3662,10 @@ export function deserializeEnterpriseBaseTypeField(val: any): EnterpriseBaseType throw "".concat("Invalid value: ", val) as string; } export function serializeEnterpriseBase(val: EnterpriseBase): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeEnterpriseBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeEnterpriseBaseTypeField(val.type) }; } export function deserializeEnterpriseBase(val: any): EnterpriseBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | EnterpriseBaseTypeField = val.type == void 0 ? void 0 : deserializeEnterpriseBaseTypeField(val.type); return { id: id, type: type } satisfies EnterpriseBase; } @@ -3686,11 +3682,11 @@ export function deserializeFileBaseTypeField(val: any): FileBaseTypeField { throw "".concat("Invalid value: ", val) as string; } export function serializeFileBase(val: FileBase): Json { - return { ["id"]: val.id, ["etag"]: val.etag, ["type"]: serializeFileBaseTypeField(val.type) }; + return { ["id"]: val.id, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["type"]: serializeFileBaseTypeField(val.type) }; } export function deserializeFileBase(val: any): FileBase { const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FileBaseTypeField = deserializeFileBaseTypeField(val.type); return { id: id, etag: etag, type: type } satisfies FileBase; } @@ -3719,10 +3715,10 @@ export function serializeFileVersionMini(val: FileVersionMini): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"FileVersionMini\""; } - return { ...base, ...{ ["sha1"]: val.sha1 } }; + return { ...base, ...{ ["sha1"]: val.sha1 == void 0 ? void 0 : val.sha1 } }; } export function deserializeFileVersionMini(val: any): FileVersionMini { - const sha1: undefined | string = isJson(val.sha1, "string") ? val.sha1 : void 0; + const sha1: undefined | string = val.sha1 == void 0 ? void 0 : val.sha1; const id: string = val.id; const type: FileVersionBaseTypeField = deserializeFileVersionBaseTypeField(val.type); return { sha1: sha1, id: id, type: type } satisfies FileVersionMini; @@ -3732,15 +3728,15 @@ export function serializeFileMini(val: FileMini): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"FileMini\""; } - return { ...base, ...{ ["sequence_id"]: val.sequenceId, ["name"]: val.name, ["sha1"]: val.sha1, ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion) } }; + return { ...base, ...{ ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId, ["name"]: val.name == void 0 ? void 0 : val.name, ["sha1"]: val.sha1 == void 0 ? void 0 : val.sha1, ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion) } }; } export function deserializeFileMini(val: any): FileMini { - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const sha1: undefined | string = isJson(val.sha1, "string") ? val.sha1 : void 0; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const sha1: undefined | string = val.sha1 == void 0 ? void 0 : val.sha1; const fileVersion: undefined | FileVersionMini = val.file_version == void 0 ? void 0 : deserializeFileVersionMini(val.file_version); const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FileBaseTypeField = deserializeFileBaseTypeField(val.type); return { sequenceId: sequenceId, name: name, sha1: sha1, fileVersion: fileVersion, id: id, etag: etag, type: type } satisfies FileMini; } @@ -3822,33 +3818,33 @@ export function deserializeAccessTokenIssuedTokenTypeField(val: any): AccessToke throw "".concat("Invalid value: ", val) as string; } export function serializeAccessToken(val: AccessToken): Json { - return { ["access_token"]: val.accessToken, ["expires_in"]: val.expiresIn, ["token_type"]: val.tokenType == void 0 ? void 0 : serializeAccessTokenTokenTypeField(val.tokenType), ["restricted_to"]: val.restrictedTo == void 0 ? void 0 : val.restrictedTo.map(function (item: FileScope): any { + return { ["access_token"]: val.accessToken == void 0 ? void 0 : val.accessToken, ["expires_in"]: val.expiresIn == void 0 ? void 0 : val.expiresIn, ["token_type"]: val.tokenType == void 0 ? void 0 : serializeAccessTokenTokenTypeField(val.tokenType), ["restricted_to"]: val.restrictedTo == void 0 ? void 0 : val.restrictedTo.map(function (item: FileScope): any { return serializeFileScope(item); - }) as readonly any[], ["refresh_token"]: val.refreshToken, ["issued_token_type"]: val.issuedTokenType == void 0 ? void 0 : serializeAccessTokenIssuedTokenTypeField(val.issuedTokenType) }; + }) as readonly any[], ["refresh_token"]: val.refreshToken == void 0 ? void 0 : val.refreshToken, ["issued_token_type"]: val.issuedTokenType == void 0 ? void 0 : serializeAccessTokenIssuedTokenTypeField(val.issuedTokenType) }; } export function deserializeAccessToken(val: any): AccessToken { - const accessToken: undefined | string = isJson(val.access_token, "string") ? val.access_token : void 0; - const expiresIn: undefined | number = isJson(val.expires_in, "number") ? val.expires_in : void 0; + const accessToken: undefined | string = val.access_token == void 0 ? void 0 : val.access_token; + const expiresIn: undefined | number = val.expires_in == void 0 ? void 0 : val.expires_in; const tokenType: undefined | AccessTokenTokenTypeField = val.token_type == void 0 ? void 0 : deserializeAccessTokenTokenTypeField(val.token_type); - const restrictedTo: undefined | readonly FileScope[] = isJson(val.restricted_to, "array") ? val.restricted_to.map(function (itm: Json): any { + const restrictedTo: undefined | readonly FileScope[] = val.restricted_to == void 0 ? void 0 : isJson(val.restricted_to, "array") ? val.restricted_to.map(function (itm: Json): any { return deserializeFileScope(itm); - }) as readonly any[] : void 0; - const refreshToken: undefined | string = isJson(val.refresh_token, "string") ? val.refresh_token : void 0; + }) as readonly any[] : []; + const refreshToken: undefined | string = val.refresh_token == void 0 ? void 0 : val.refresh_token; const issuedTokenType: undefined | AccessTokenIssuedTokenTypeField = val.issued_token_type == void 0 ? void 0 : deserializeAccessTokenIssuedTokenTypeField(val.issued_token_type); return { accessToken: accessToken, expiresIn: expiresIn, tokenType: tokenType, restrictedTo: restrictedTo, refreshToken: refreshToken, issuedTokenType: issuedTokenType } satisfies AccessToken; } export function serializeFilesUnderRetention(val: FilesUnderRetention): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileMini): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileMini): any { return serializeFileMini(item); }) as readonly any[] }; } export function deserializeFilesUnderRetention(val: any): FilesUnderRetention { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly FileMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly FileMini[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFileMini(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies FilesUnderRetention; } export function serializeFileConflict(val: FileConflict): Json { @@ -3859,12 +3855,12 @@ export function serializeFileConflict(val: FileConflict): Json { return { ...base, ...{} }; } export function deserializeFileConflict(val: any): FileConflict { - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const sha1: undefined | string = isJson(val.sha1, "string") ? val.sha1 : void 0; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const sha1: undefined | string = val.sha1 == void 0 ? void 0 : val.sha1; const fileVersion: undefined | FileVersionMini = val.file_version == void 0 ? void 0 : deserializeFileVersionMini(val.file_version); const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FileBaseTypeField = deserializeFileBaseTypeField(val.type); return { sequenceId: sequenceId, name: name, sha1: sha1, fileVersion: fileVersion, id: id, etag: etag, type: type } satisfies FileConflict; } @@ -3874,9 +3870,9 @@ export function serializeConflictErrorContextInfoField(val: ConflictErrorContext }) as readonly any[] }; } export function deserializeConflictErrorContextInfoField(val: any): ConflictErrorContextInfoField { - const conflicts: undefined | readonly FileConflict[] = isJson(val.conflicts, "array") ? val.conflicts.map(function (itm: Json): any { + const conflicts: undefined | readonly FileConflict[] = val.conflicts == void 0 ? void 0 : isJson(val.conflicts, "array") ? val.conflicts.map(function (itm: Json): any { return deserializeFileConflict(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { conflicts: conflicts } satisfies ConflictErrorContextInfoField; } export function serializeConflictError(val: ConflictError): Json { @@ -3888,12 +3884,12 @@ export function serializeConflictError(val: ConflictError): Json { } export function deserializeConflictError(val: any): ConflictError { const type: undefined | ClientErrorTypeField = val.type == void 0 ? void 0 : deserializeClientErrorTypeField(val.type); - const status: undefined | number = isJson(val.status, "number") ? val.status : void 0; + const status: undefined | number = val.status == void 0 ? void 0 : val.status; const code: undefined | ClientErrorCodeField = val.code == void 0 ? void 0 : deserializeClientErrorCodeField(val.code); - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; const contextInfo: undefined | ClientErrorContextInfoField = val.context_info == void 0 ? void 0 : deserializeClientErrorContextInfoField(val.context_info); - const helpUrl: undefined | string = isJson(val.help_url, "string") ? val.help_url : void 0; - const requestId: undefined | string = isJson(val.request_id, "string") ? val.request_id : void 0; + const helpUrl: undefined | string = val.help_url == void 0 ? void 0 : val.help_url; + const requestId: undefined | string = val.request_id == void 0 ? void 0 : val.request_id; return { type: type, status: status, code: code, message: message, contextInfo: contextInfo, helpUrl: helpUrl, requestId: requestId } satisfies ConflictError; } export function serializeFolderBaseTypeField(val: FolderBaseTypeField): Json { @@ -3909,11 +3905,11 @@ export function deserializeFolderBaseTypeField(val: any): FolderBaseTypeField { throw "".concat("Invalid value: ", val) as string; } export function serializeFolderBase(val: FolderBase): Json { - return { ["id"]: val.id, ["etag"]: val.etag, ["type"]: serializeFolderBaseTypeField(val.type) }; + return { ["id"]: val.id, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["type"]: serializeFolderBaseTypeField(val.type) }; } export function deserializeFolderBase(val: any): FolderBase { const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FolderBaseTypeField = deserializeFolderBaseTypeField(val.type); return { id: id, etag: etag, type: type } satisfies FolderBase; } @@ -3922,13 +3918,13 @@ export function serializeFolderMini(val: FolderMini): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"FolderMini\""; } - return { ...base, ...{ ["name"]: val.name, ["sequence_id"]: val.sequenceId } }; + return { ...base, ...{ ["name"]: val.name == void 0 ? void 0 : val.name, ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId } }; } export function deserializeFolderMini(val: any): FolderMini { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FolderBaseTypeField = deserializeFolderBaseTypeField(val.type); return { name: name, sequenceId: sequenceId, id: id, etag: etag, type: type } satisfies FolderMini; } @@ -3945,10 +3941,10 @@ export function deserializeIntegrationMappingBaseIntegrationTypeField(val: any): throw "".concat("Invalid value: ", val) as string; } export function serializeIntegrationMappingBase(val: IntegrationMappingBase): Json { - return { ["id"]: val.id, ["integration_type"]: val.integrationType == void 0 ? void 0 : serializeIntegrationMappingBaseIntegrationTypeField(val.integrationType) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["integration_type"]: val.integrationType == void 0 ? void 0 : serializeIntegrationMappingBaseIntegrationTypeField(val.integrationType) }; } export function deserializeIntegrationMappingBase(val: any): IntegrationMappingBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const integrationType: undefined | IntegrationMappingBaseIntegrationTypeField = val.integration_type == void 0 ? void 0 : deserializeIntegrationMappingBaseIntegrationTypeField(val.integration_type); return { id: id, integrationType: integrationType } satisfies IntegrationMappingBase; } @@ -3981,14 +3977,14 @@ export function serializeIntegrationMappingMini(val: IntegrationMappingMini): Js if (!isJson(base, "object")) { throw "Expecting an object for \"IntegrationMappingMini\""; } - return { ...base, ...{ ["partner_item_id"]: val.partnerItemId, ["partner_item_type"]: val.partnerItemType == void 0 ? void 0 : serializeIntegrationMappingMiniPartnerItemTypeField(val.partnerItemType), ["box_item_id"]: val.boxItemId, ["box_item_type"]: val.boxItemType == void 0 ? void 0 : serializeIntegrationMappingMiniBoxItemTypeField(val.boxItemType) } }; + return { ...base, ...{ ["partner_item_id"]: val.partnerItemId == void 0 ? void 0 : val.partnerItemId, ["partner_item_type"]: val.partnerItemType == void 0 ? void 0 : serializeIntegrationMappingMiniPartnerItemTypeField(val.partnerItemType), ["box_item_id"]: val.boxItemId == void 0 ? void 0 : val.boxItemId, ["box_item_type"]: val.boxItemType == void 0 ? void 0 : serializeIntegrationMappingMiniBoxItemTypeField(val.boxItemType) } }; } export function deserializeIntegrationMappingMini(val: any): IntegrationMappingMini { - const partnerItemId: undefined | string = isJson(val.partner_item_id, "string") ? val.partner_item_id : void 0; + const partnerItemId: undefined | string = val.partner_item_id == void 0 ? void 0 : val.partner_item_id; const partnerItemType: undefined | IntegrationMappingMiniPartnerItemTypeField = val.partner_item_type == void 0 ? void 0 : deserializeIntegrationMappingMiniPartnerItemTypeField(val.partner_item_type); - const boxItemId: undefined | string = isJson(val.box_item_id, "string") ? val.box_item_id : void 0; + const boxItemId: undefined | string = val.box_item_id == void 0 ? void 0 : val.box_item_id; const boxItemType: undefined | IntegrationMappingMiniBoxItemTypeField = val.box_item_type == void 0 ? void 0 : deserializeIntegrationMappingMiniBoxItemTypeField(val.box_item_type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const integrationType: undefined | IntegrationMappingBaseIntegrationTypeField = val.integration_type == void 0 ? void 0 : deserializeIntegrationMappingBaseIntegrationTypeField(val.integration_type); return { partnerItemId: partnerItemId, partnerItemType: partnerItemType, boxItemId: boxItemId, boxItemType: boxItemType, id: id, integrationType: integrationType } satisfies IntegrationMappingMini; } @@ -4005,10 +4001,10 @@ export function deserializeGroupBaseTypeField(val: any): GroupBaseTypeField { throw "".concat("Invalid value: ", val) as string; } export function serializeGroupBase(val: GroupBase): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeGroupBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeGroupBaseTypeField(val.type) }; } export function deserializeGroupBase(val: any): GroupBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | GroupBaseTypeField = val.type == void 0 ? void 0 : deserializeGroupBaseTypeField(val.type); return { id: id, type: type } satisfies GroupBase; } @@ -4032,12 +4028,12 @@ export function serializeGroupMini(val: GroupMini): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"GroupMini\""; } - return { ...base, ...{ ["name"]: val.name, ["group_type"]: val.groupType == void 0 ? void 0 : serializeGroupMiniGroupTypeField(val.groupType) } }; + return { ...base, ...{ ["name"]: val.name == void 0 ? void 0 : val.name, ["group_type"]: val.groupType == void 0 ? void 0 : serializeGroupMiniGroupTypeField(val.groupType) } }; } export function deserializeGroupMini(val: any): GroupMini { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const groupType: undefined | GroupMiniGroupTypeField = val.group_type == void 0 ? void 0 : deserializeGroupMiniGroupTypeField(val.group_type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | GroupBaseTypeField = val.type == void 0 ? void 0 : deserializeGroupBaseTypeField(val.type); return { name: name, groupType: groupType, id: id, type: type } satisfies GroupMini; } @@ -4057,30 +4053,30 @@ export function deserializeGroupsOrderFieldDirectionField(val: any): GroupsOrder throw "".concat("Invalid value: ", val) as string; } export function serializeGroupsOrderField(val: GroupsOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeGroupsOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeGroupsOrderFieldDirectionField(val.direction) }; } export function deserializeGroupsOrderField(val: any): GroupsOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | GroupsOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeGroupsOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies GroupsOrderField; } export function serializeGroups(val: Groups): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: GroupsOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: GroupsOrderField): any { return serializeGroupsOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: GroupMini): any { return serializeGroupMini(item); }) as readonly any[] }; } export function deserializeGroups(val: any): Groups { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly GroupsOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly GroupsOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeGroupsOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly GroupMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly GroupMini[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeGroupMini(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies Groups; } export function serializeGroup(val: Group): Json { @@ -4088,14 +4084,14 @@ export function serializeGroup(val: Group): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"Group\""; } - return { ...base, ...{ ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt } }; + return { ...base, ...{ ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt } }; } export function deserializeGroup(val: any): Group { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const groupType: undefined | GroupMiniGroupTypeField = val.group_type == void 0 ? void 0 : deserializeGroupMiniGroupTypeField(val.group_type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | GroupBaseTypeField = val.type == void 0 ? void 0 : deserializeGroupBaseTypeField(val.type); return { createdAt: createdAt, modifiedAt: modifiedAt, name: name, groupType: groupType, id: id, type: type } satisfies Group; } @@ -4136,10 +4132,10 @@ export function deserializeGroupFullMemberViewabilityLevelField(val: any): Group throw "".concat("Invalid value: ", val) as string; } export function serializeGroupFullPermissionsField(val: GroupFullPermissionsField): Json { - return { ["can_invite_as_collaborator"]: val.canInviteAsCollaborator }; + return { ["can_invite_as_collaborator"]: val.canInviteAsCollaborator == void 0 ? void 0 : val.canInviteAsCollaborator }; } export function deserializeGroupFullPermissionsField(val: any): GroupFullPermissionsField { - const canInviteAsCollaborator: undefined | boolean = isJson(val.can_invite_as_collaborator, "boolean") ? val.can_invite_as_collaborator : void 0; + const canInviteAsCollaborator: undefined | boolean = val.can_invite_as_collaborator == void 0 ? void 0 : val.can_invite_as_collaborator; return { canInviteAsCollaborator: canInviteAsCollaborator } satisfies GroupFullPermissionsField; } export function serializeGroupFull(val: GroupFull): Json { @@ -4147,20 +4143,20 @@ export function serializeGroupFull(val: GroupFull): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"GroupFull\""; } - return { ...base, ...{ ["provenance"]: val.provenance, ["external_sync_identifier"]: val.externalSyncIdentifier, ["description"]: val.description, ["invitability_level"]: val.invitabilityLevel == void 0 ? void 0 : serializeGroupFullInvitabilityLevelField(val.invitabilityLevel), ["member_viewability_level"]: val.memberViewabilityLevel == void 0 ? void 0 : serializeGroupFullMemberViewabilityLevelField(val.memberViewabilityLevel), ["permissions"]: val.permissions == void 0 ? void 0 : serializeGroupFullPermissionsField(val.permissions) } }; + return { ...base, ...{ ["provenance"]: val.provenance == void 0 ? void 0 : val.provenance, ["external_sync_identifier"]: val.externalSyncIdentifier == void 0 ? void 0 : val.externalSyncIdentifier, ["description"]: val.description == void 0 ? void 0 : val.description, ["invitability_level"]: val.invitabilityLevel == void 0 ? void 0 : serializeGroupFullInvitabilityLevelField(val.invitabilityLevel), ["member_viewability_level"]: val.memberViewabilityLevel == void 0 ? void 0 : serializeGroupFullMemberViewabilityLevelField(val.memberViewabilityLevel), ["permissions"]: val.permissions == void 0 ? void 0 : serializeGroupFullPermissionsField(val.permissions) } }; } export function deserializeGroupFull(val: any): GroupFull { - const provenance: undefined | string = isJson(val.provenance, "string") ? val.provenance : void 0; - const externalSyncIdentifier: undefined | string = isJson(val.external_sync_identifier, "string") ? val.external_sync_identifier : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const provenance: undefined | string = val.provenance == void 0 ? void 0 : val.provenance; + const externalSyncIdentifier: undefined | string = val.external_sync_identifier == void 0 ? void 0 : val.external_sync_identifier; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const invitabilityLevel: undefined | GroupFullInvitabilityLevelField = val.invitability_level == void 0 ? void 0 : deserializeGroupFullInvitabilityLevelField(val.invitability_level); const memberViewabilityLevel: undefined | GroupFullMemberViewabilityLevelField = val.member_viewability_level == void 0 ? void 0 : deserializeGroupFullMemberViewabilityLevelField(val.member_viewability_level); const permissions: undefined | GroupFullPermissionsField = val.permissions == void 0 ? void 0 : deserializeGroupFullPermissionsField(val.permissions); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const groupType: undefined | GroupMiniGroupTypeField = val.group_type == void 0 ? void 0 : deserializeGroupMiniGroupTypeField(val.group_type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | GroupBaseTypeField = val.type == void 0 ? void 0 : deserializeGroupBaseTypeField(val.type); return { provenance: provenance, externalSyncIdentifier: externalSyncIdentifier, description: description, invitabilityLevel: invitabilityLevel, memberViewabilityLevel: memberViewabilityLevel, permissions: permissions, createdAt: createdAt, modifiedAt: modifiedAt, name: name, groupType: groupType, id: id, type: type } satisfies GroupFull; } @@ -4177,10 +4173,10 @@ export function deserializeLegalHoldPolicyMiniTypeField(val: any): LegalHoldPoli throw "".concat("Invalid value: ", val) as string; } export function serializeLegalHoldPolicyMini(val: LegalHoldPolicyMini): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeLegalHoldPolicyMiniTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeLegalHoldPolicyMiniTypeField(val.type) }; } export function deserializeLegalHoldPolicyMini(val: any): LegalHoldPolicyMini { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | LegalHoldPolicyMiniTypeField = val.type == void 0 ? void 0 : deserializeLegalHoldPolicyMiniTypeField(val.type); return { id: id, type: type } satisfies LegalHoldPolicyMini; } @@ -4197,43 +4193,53 @@ export function deserializeLegalHoldPolicyAssignmentBaseTypeField(val: any): Leg throw "".concat("Invalid value: ", val) as string; } export function serializeLegalHoldPolicyAssignmentBase(val: LegalHoldPolicyAssignmentBase): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeLegalHoldPolicyAssignmentBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeLegalHoldPolicyAssignmentBaseTypeField(val.type) }; } export function deserializeLegalHoldPolicyAssignmentBase(val: any): LegalHoldPolicyAssignmentBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | LegalHoldPolicyAssignmentBaseTypeField = val.type == void 0 ? void 0 : deserializeLegalHoldPolicyAssignmentBaseTypeField(val.type); return { id: id, type: type } satisfies LegalHoldPolicyAssignmentBase; } export function serializeLegalHoldPolicyAssignments(val: LegalHoldPolicyAssignments): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: LegalHoldPolicyAssignmentBase): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: LegalHoldPolicyAssignmentBase): any { return serializeLegalHoldPolicyAssignmentBase(item); }) as readonly any[] }; } export function deserializeLegalHoldPolicyAssignments(val: any): LegalHoldPolicyAssignments { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly LegalHoldPolicyAssignmentBase[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly LegalHoldPolicyAssignmentBase[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeLegalHoldPolicyAssignmentBase(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies LegalHoldPolicyAssignments; } +export function serializeMetadataBase(val: MetadataBase): Json { + return { ["$parent"]: val.parent == void 0 ? void 0 : val.parent, ["$template"]: val.template == void 0 ? void 0 : val.template, ["$scope"]: val.scope == void 0 ? void 0 : val.scope, ["$version"]: val.version == void 0 ? void 0 : val.version }; +} +export function deserializeMetadataBase(val: any): MetadataBase { + const parent: undefined | string = val.$parent == void 0 ? void 0 : val.$parent; + const template: undefined | string = val.$template == void 0 ? void 0 : val.$template; + const scope: undefined | string = val.$scope == void 0 ? void 0 : val.$scope; + const version: undefined | number = val.$version == void 0 ? void 0 : val.$version; + return { parent: parent, template: template, scope: scope, version: version } satisfies MetadataBase; +} export function serializeMetadata(val: Metadata): Json { - return {}; + return serializeMetadataBase(val); } export function deserializeMetadata(val: any): Metadata { - return {} satisfies Metadata; + return deserializeMetadataBase(val); } export function serializeMetadatas(val: Metadatas): Json { return { ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Metadata): any { return serializeMetadata(item); - }) as readonly any[], ["limit"]: val.limit }; + }) as readonly any[], ["limit"]: val.limit == void 0 ? void 0 : val.limit }; } export function deserializeMetadatas(val: any): Metadatas { - const entries: undefined | readonly Metadata[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly Metadata[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeMetadata(itm); - }) as readonly any[] : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; + }) as readonly any[] : []; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; return { entries: entries, limit: limit } satisfies Metadatas; } export function serializeMetadataFull(val: MetadataFull): Json { @@ -4241,24 +4247,21 @@ export function serializeMetadataFull(val: MetadataFull): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"MetadataFull\""; } - return { ...base, ...{ ["$canEdit"]: val.canEdit, ["$id"]: val.id, ["$type"]: val.type, ["$typeVersion"]: val.typeVersion } }; + return { ...base, ...{ ...{ ["$canEdit"]: val.canEdit == void 0 ? void 0 : val.canEdit, ["$id"]: val.id == void 0 ? void 0 : val.id, ["$type"]: val.type == void 0 ? void 0 : val.type, ["$typeVersion"]: val.typeVersion == void 0 ? void 0 : val.typeVersion }, ...val.extraData } }; } export function deserializeMetadataFull(val: any): MetadataFull { - const canEdit: undefined | boolean = isJson(val.$canEdit, "boolean") ? val.$canEdit : void 0; - const id: undefined | string = isJson(val.$id, "string") ? val.$id : void 0; - const type: undefined | string = isJson(val.$type, "string") ? val.$type : void 0; - const typeVersion: undefined | number = isJson(val.$typeVersion, "number") ? val.$typeVersion : void 0; - return { canEdit: canEdit, id: id, type: type, typeVersion: typeVersion } satisfies MetadataFull; -} -export function serializeMetadataBase(val: MetadataBase): Json { - return { ["$parent"]: val.parent, ["$template"]: val.template, ["$scope"]: val.scope, ["$version"]: val.version }; -} -export function deserializeMetadataBase(val: any): MetadataBase { - const parent: undefined | string = isJson(val.$parent, "string") ? val.$parent : void 0; - const template: undefined | string = isJson(val.$template, "string") ? val.$template : void 0; - const scope: undefined | string = isJson(val.$scope, "string") ? val.$scope : void 0; - const version: undefined | number = isJson(val.$version, "number") ? val.$version : void 0; - return { parent: parent, template: template, scope: scope, version: version } satisfies MetadataBase; + const canEdit: undefined | boolean = val.$canEdit == void 0 ? void 0 : val.$canEdit; + const id: undefined | string = val.$id == void 0 ? void 0 : val.$id; + const type: undefined | string = val.$type == void 0 ? void 0 : val.$type; + const typeVersion: undefined | number = val.$typeVersion == void 0 ? void 0 : val.$typeVersion; + const extraData: undefined | { + readonly [key: string]: string; + } = val == void 0 ? void 0 : val; + const parent: undefined | string = val.$parent == void 0 ? void 0 : val.$parent; + const template: undefined | string = val.$template == void 0 ? void 0 : val.$template; + const scope: undefined | string = val.$scope == void 0 ? void 0 : val.$scope; + const version: undefined | number = val.$version == void 0 ? void 0 : val.$version; + return { canEdit: canEdit, id: id, type: type, typeVersion: typeVersion, extraData: extraData, parent: parent, template: template, scope: scope, version: version } satisfies MetadataFull; } export function serializeMetadataCascadePolicyTypeField(val: MetadataCascadePolicyTypeField): Json { return val; @@ -4285,11 +4288,11 @@ export function deserializeMetadataCascadePolicyOwnerEnterpriseFieldTypeField(va throw "".concat("Invalid value: ", val) as string; } export function serializeMetadataCascadePolicyOwnerEnterpriseField(val: MetadataCascadePolicyOwnerEnterpriseField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeMetadataCascadePolicyOwnerEnterpriseFieldTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeMetadataCascadePolicyOwnerEnterpriseFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeMetadataCascadePolicyOwnerEnterpriseField(val: any): MetadataCascadePolicyOwnerEnterpriseField { const type: undefined | MetadataCascadePolicyOwnerEnterpriseFieldTypeField = val.type == void 0 ? void 0 : deserializeMetadataCascadePolicyOwnerEnterpriseFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies MetadataCascadePolicyOwnerEnterpriseField; } export function serializeMetadataCascadePolicyParentFieldTypeField(val: MetadataCascadePolicyParentFieldTypeField): Json { @@ -4305,11 +4308,11 @@ export function deserializeMetadataCascadePolicyParentFieldTypeField(val: any): throw "".concat("Invalid value: ", val) as string; } export function serializeMetadataCascadePolicyParentField(val: MetadataCascadePolicyParentField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeMetadataCascadePolicyParentFieldTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeMetadataCascadePolicyParentFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeMetadataCascadePolicyParentField(val: any): MetadataCascadePolicyParentField { const type: undefined | MetadataCascadePolicyParentFieldTypeField = val.type == void 0 ? void 0 : deserializeMetadataCascadePolicyParentFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies MetadataCascadePolicyParentField; } export function serializeMetadataCascadePolicyScopeField(val: MetadataCascadePolicyScopeField): Json { @@ -4328,29 +4331,29 @@ export function deserializeMetadataCascadePolicyScopeField(val: any): MetadataCa throw "".concat("Invalid value: ", val) as string; } export function serializeMetadataCascadePolicy(val: MetadataCascadePolicy): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeMetadataCascadePolicyTypeField(val.type), ["owner_enterprise"]: val.ownerEnterprise == void 0 ? void 0 : serializeMetadataCascadePolicyOwnerEnterpriseField(val.ownerEnterprise), ["parent"]: val.parent == void 0 ? void 0 : serializeMetadataCascadePolicyParentField(val.parent), ["scope"]: val.scope == void 0 ? void 0 : serializeMetadataCascadePolicyScopeField(val.scope), ["templateKey"]: val.templateKey }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeMetadataCascadePolicyTypeField(val.type), ["owner_enterprise"]: val.ownerEnterprise == void 0 ? void 0 : serializeMetadataCascadePolicyOwnerEnterpriseField(val.ownerEnterprise), ["parent"]: val.parent == void 0 ? void 0 : serializeMetadataCascadePolicyParentField(val.parent), ["scope"]: val.scope == void 0 ? void 0 : serializeMetadataCascadePolicyScopeField(val.scope), ["templateKey"]: val.templateKey == void 0 ? void 0 : val.templateKey }; } export function deserializeMetadataCascadePolicy(val: any): MetadataCascadePolicy { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | MetadataCascadePolicyTypeField = val.type == void 0 ? void 0 : deserializeMetadataCascadePolicyTypeField(val.type); const ownerEnterprise: undefined | MetadataCascadePolicyOwnerEnterpriseField = val.owner_enterprise == void 0 ? void 0 : deserializeMetadataCascadePolicyOwnerEnterpriseField(val.owner_enterprise); const parent: undefined | MetadataCascadePolicyParentField = val.parent == void 0 ? void 0 : deserializeMetadataCascadePolicyParentField(val.parent); const scope: undefined | MetadataCascadePolicyScopeField = val.scope == void 0 ? void 0 : deserializeMetadataCascadePolicyScopeField(val.scope); - const templateKey: undefined | string = isJson(val.templateKey, "string") ? val.templateKey : void 0; + const templateKey: undefined | string = val.templateKey == void 0 ? void 0 : val.templateKey; return { id: id, type: type, ownerEnterprise: ownerEnterprise, parent: parent, scope: scope, templateKey: templateKey } satisfies MetadataCascadePolicy; } export function serializeMetadataCascadePolicies(val: MetadataCascadePolicies): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: MetadataCascadePolicy): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: MetadataCascadePolicy): any { return serializeMetadataCascadePolicy(item); }) as readonly any[] }; } export function deserializeMetadataCascadePolicies(val: any): MetadataCascadePolicies { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly MetadataCascadePolicy[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly MetadataCascadePolicy[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeMetadataCascadePolicy(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies MetadataCascadePolicies; } export function serializeMetadataQueryIndexStatusField(val: MetadataQueryIndexStatusField): Json { @@ -4387,38 +4390,38 @@ export function deserializeMetadataQueryIndexFieldsFieldSortDirectionField(val: throw "".concat("Invalid value: ", val) as string; } export function serializeMetadataQueryIndexFieldsField(val: MetadataQueryIndexFieldsField): Json { - return { ["key"]: val.key, ["sort_direction"]: val.sortDirection == void 0 ? void 0 : serializeMetadataQueryIndexFieldsFieldSortDirectionField(val.sortDirection) }; + return { ["key"]: val.key == void 0 ? void 0 : val.key, ["sort_direction"]: val.sortDirection == void 0 ? void 0 : serializeMetadataQueryIndexFieldsFieldSortDirectionField(val.sortDirection) }; } export function deserializeMetadataQueryIndexFieldsField(val: any): MetadataQueryIndexFieldsField { - const key: undefined | string = isJson(val.key, "string") ? val.key : void 0; + const key: undefined | string = val.key == void 0 ? void 0 : val.key; const sortDirection: undefined | MetadataQueryIndexFieldsFieldSortDirectionField = val.sort_direction == void 0 ? void 0 : deserializeMetadataQueryIndexFieldsFieldSortDirectionField(val.sort_direction); return { key: key, sortDirection: sortDirection } satisfies MetadataQueryIndexFieldsField; } export function serializeMetadataQueryIndex(val: MetadataQueryIndex): Json { - return { ["id"]: val.id, ["type"]: val.type, ["status"]: serializeMetadataQueryIndexStatusField(val.status), ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: MetadataQueryIndexFieldsField): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type, ["status"]: serializeMetadataQueryIndexStatusField(val.status), ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: MetadataQueryIndexFieldsField): any { return serializeMetadataQueryIndexFieldsField(item); }) as readonly any[] }; } export function deserializeMetadataQueryIndex(val: any): MetadataQueryIndex { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: string = val.type; const status: MetadataQueryIndexStatusField = deserializeMetadataQueryIndexStatusField(val.status); - const fields: undefined | readonly MetadataQueryIndexFieldsField[] = isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { + const fields: undefined | readonly MetadataQueryIndexFieldsField[] = val.fields == void 0 ? void 0 : isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { return deserializeMetadataQueryIndexFieldsField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { id: id, type: type, status: status, fields: fields } satisfies MetadataQueryIndex; } export function serializeMetadataQueryIndices(val: MetadataQueryIndices): Json { return { ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: MetadataQueryIndex): any { return serializeMetadataQueryIndex(item); - }) as readonly any[], ["limit"]: val.limit, ["next_marker"]: val.nextMarker }; + }) as readonly any[], ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker }; } export function deserializeMetadataQueryIndices(val: any): MetadataQueryIndices { - const entries: undefined | readonly MetadataQueryIndex[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly MetadataQueryIndex[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeMetadataQueryIndex(itm); - }) as readonly any[] : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | string = isJson(val.next_marker, "string") ? val.next_marker : void 0; + }) as readonly any[] : []; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | string = val.next_marker == void 0 ? void 0 : val.next_marker; return { entries: entries, limit: limit, nextMarker: nextMarker } satisfies MetadataQueryIndices; } export function serializeMetadataTemplateTypeField(val: MetadataTemplateTypeField): Json { @@ -4455,86 +4458,89 @@ export function deserializeMetadataTemplateFieldsFieldTypeField(val: any): Metad if (val == "multiSelect") { return "multiSelect"; } + if (val == "integer") { + return "integer"; + } throw "".concat("Invalid value: ", val) as string; } export function serializeMetadataTemplateFieldsFieldOptionsField(val: MetadataTemplateFieldsFieldOptionsField): Json { - return { ["key"]: val.key, ["id"]: val.id }; + return { ["key"]: val.key, ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeMetadataTemplateFieldsFieldOptionsField(val: any): MetadataTemplateFieldsFieldOptionsField { const key: string = val.key; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { key: key, id: id } satisfies MetadataTemplateFieldsFieldOptionsField; } export function serializeMetadataTemplateFieldsField(val: MetadataTemplateFieldsField): Json { - return { ["type"]: serializeMetadataTemplateFieldsFieldTypeField(val.type), ["key"]: val.key, ["displayName"]: val.displayName, ["description"]: val.description, ["hidden"]: val.hidden, ["options"]: val.options == void 0 ? void 0 : val.options.map(function (item: MetadataTemplateFieldsFieldOptionsField): any { + return { ["type"]: serializeMetadataTemplateFieldsFieldTypeField(val.type), ["key"]: val.key, ["displayName"]: val.displayName, ["description"]: val.description == void 0 ? void 0 : val.description, ["hidden"]: val.hidden == void 0 ? void 0 : val.hidden, ["options"]: val.options == void 0 ? void 0 : val.options.map(function (item: MetadataTemplateFieldsFieldOptionsField): any { return serializeMetadataTemplateFieldsFieldOptionsField(item); - }) as readonly any[], ["id"]: val.id }; + }) as readonly any[], ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeMetadataTemplateFieldsField(val: any): MetadataTemplateFieldsField { const type: MetadataTemplateFieldsFieldTypeField = deserializeMetadataTemplateFieldsFieldTypeField(val.type); const key: string = val.key; const displayName: string = val.displayName; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const hidden: undefined | boolean = isJson(val.hidden, "boolean") ? val.hidden : void 0; - const options: undefined | readonly MetadataTemplateFieldsFieldOptionsField[] = isJson(val.options, "array") ? val.options.map(function (itm: Json): any { + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const hidden: undefined | boolean = val.hidden == void 0 ? void 0 : val.hidden; + const options: undefined | readonly MetadataTemplateFieldsFieldOptionsField[] = val.options == void 0 ? void 0 : isJson(val.options, "array") ? val.options.map(function (itm: Json): any { return deserializeMetadataTemplateFieldsFieldOptionsField(itm); - }) as readonly any[] : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + }) as readonly any[] : []; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, key: key, displayName: displayName, description: description, hidden: hidden, options: options, id: id } satisfies MetadataTemplateFieldsField; } export function serializeMetadataTemplate(val: MetadataTemplate): Json { - return { ["id"]: val.id, ["type"]: serializeMetadataTemplateTypeField(val.type), ["scope"]: val.scope, ["templateKey"]: val.templateKey, ["displayName"]: val.displayName, ["hidden"]: val.hidden, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: MetadataTemplateFieldsField): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: serializeMetadataTemplateTypeField(val.type), ["scope"]: val.scope == void 0 ? void 0 : val.scope, ["templateKey"]: val.templateKey == void 0 ? void 0 : val.templateKey, ["displayName"]: val.displayName == void 0 ? void 0 : val.displayName, ["hidden"]: val.hidden == void 0 ? void 0 : val.hidden, ["fields"]: val.fields == void 0 ? void 0 : val.fields.map(function (item: MetadataTemplateFieldsField): any { return serializeMetadataTemplateFieldsField(item); - }) as readonly any[], ["copyInstanceOnItemCopy"]: val.copyInstanceOnItemCopy }; + }) as readonly any[], ["copyInstanceOnItemCopy"]: val.copyInstanceOnItemCopy == void 0 ? void 0 : val.copyInstanceOnItemCopy }; } export function deserializeMetadataTemplate(val: any): MetadataTemplate { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: MetadataTemplateTypeField = deserializeMetadataTemplateTypeField(val.type); - const scope: undefined | string = isJson(val.scope, "string") ? val.scope : void 0; - const templateKey: undefined | string = isJson(val.templateKey, "string") ? val.templateKey : void 0; - const displayName: undefined | string = isJson(val.displayName, "string") ? val.displayName : void 0; - const hidden: undefined | boolean = isJson(val.hidden, "boolean") ? val.hidden : void 0; - const fields: undefined | readonly MetadataTemplateFieldsField[] = isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { + const scope: undefined | string = val.scope == void 0 ? void 0 : val.scope; + const templateKey: undefined | string = val.templateKey == void 0 ? void 0 : val.templateKey; + const displayName: undefined | string = val.displayName == void 0 ? void 0 : val.displayName; + const hidden: undefined | boolean = val.hidden == void 0 ? void 0 : val.hidden; + const fields: undefined | readonly MetadataTemplateFieldsField[] = val.fields == void 0 ? void 0 : isJson(val.fields, "array") ? val.fields.map(function (itm: Json): any { return deserializeMetadataTemplateFieldsField(itm); - }) as readonly any[] : void 0; - const copyInstanceOnItemCopy: undefined | boolean = isJson(val.copyInstanceOnItemCopy, "boolean") ? val.copyInstanceOnItemCopy : void 0; + }) as readonly any[] : []; + const copyInstanceOnItemCopy: undefined | boolean = val.copyInstanceOnItemCopy == void 0 ? void 0 : val.copyInstanceOnItemCopy; return { id: id, type: type, scope: scope, templateKey: templateKey, displayName: displayName, hidden: hidden, fields: fields, copyInstanceOnItemCopy: copyInstanceOnItemCopy } satisfies MetadataTemplate; } export function serializeMetadataTemplates(val: MetadataTemplates): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: MetadataTemplate): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: MetadataTemplate): any { return serializeMetadataTemplate(item); }) as readonly any[] }; } export function deserializeMetadataTemplates(val: any): MetadataTemplates { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly MetadataTemplate[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly MetadataTemplate[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeMetadataTemplate(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies MetadataTemplates; } export function serializeRealtimeServer(val: RealtimeServer): Json { - return { ["type"]: val.type, ["url"]: val.url, ["ttl"]: val.ttl, ["max_retries"]: val.maxRetries, ["retry_timeout"]: val.retryTimeout }; + return { ["type"]: val.type == void 0 ? void 0 : val.type, ["url"]: val.url == void 0 ? void 0 : val.url, ["ttl"]: val.ttl == void 0 ? void 0 : val.ttl, ["max_retries"]: val.maxRetries == void 0 ? void 0 : val.maxRetries, ["retry_timeout"]: val.retryTimeout == void 0 ? void 0 : val.retryTimeout }; } export function deserializeRealtimeServer(val: any): RealtimeServer { - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; - const ttl: undefined | number = isJson(val.ttl, "number") ? val.ttl : void 0; - const maxRetries: undefined | number = isJson(val.max_retries, "number") ? val.max_retries : void 0; - const retryTimeout: undefined | number = isJson(val.retry_timeout, "number") ? val.retry_timeout : void 0; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; + const ttl: undefined | number = val.ttl == void 0 ? void 0 : val.ttl; + const maxRetries: undefined | number = val.max_retries == void 0 ? void 0 : val.max_retries; + const retryTimeout: undefined | number = val.retry_timeout == void 0 ? void 0 : val.retry_timeout; return { type: type, url: url, ttl: ttl, maxRetries: maxRetries, retryTimeout: retryTimeout } satisfies RealtimeServer; } export function serializeRealtimeServers(val: RealtimeServers): Json { - return { ["chunk_size"]: val.chunkSize, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: RealtimeServer): any { + return { ["chunk_size"]: val.chunkSize == void 0 ? void 0 : val.chunkSize, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: RealtimeServer): any { return serializeRealtimeServer(item); }) as readonly any[] }; } export function deserializeRealtimeServers(val: any): RealtimeServers { - const chunkSize: undefined | number = isJson(val.chunk_size, "number") ? val.chunk_size : void 0; - const entries: undefined | readonly RealtimeServer[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const chunkSize: undefined | number = val.chunk_size == void 0 ? void 0 : val.chunk_size; + const entries: undefined | readonly RealtimeServer[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeRealtimeServer(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { chunkSize: chunkSize, entries: entries } satisfies RealtimeServers; } export function serializeRetentionPolicyBaseTypeField(val: RetentionPolicyBaseTypeField): Json { @@ -4577,11 +4583,11 @@ export function serializeRetentionPolicyMini(val: RetentionPolicyMini): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"RetentionPolicyMini\""; } - return { ...base, ...{ ["policy_name"]: val.policyName, ["retention_length"]: val.retentionLength, ["disposition_action"]: val.dispositionAction == void 0 ? void 0 : serializeRetentionPolicyMiniDispositionActionField(val.dispositionAction) } }; + return { ...base, ...{ ["policy_name"]: val.policyName == void 0 ? void 0 : val.policyName, ["retention_length"]: val.retentionLength == void 0 ? void 0 : val.retentionLength, ["disposition_action"]: val.dispositionAction == void 0 ? void 0 : serializeRetentionPolicyMiniDispositionActionField(val.dispositionAction) } }; } export function deserializeRetentionPolicyMini(val: any): RetentionPolicyMini { - const policyName: undefined | string = isJson(val.policy_name, "string") ? val.policy_name : void 0; - const retentionLength: undefined | string = isJson(val.retention_length, "string") ? val.retention_length : void 0; + const policyName: undefined | string = val.policy_name == void 0 ? void 0 : val.policy_name; + const retentionLength: undefined | string = val.retention_length == void 0 ? void 0 : val.retention_length; const dispositionAction: undefined | RetentionPolicyMiniDispositionActionField = val.disposition_action == void 0 ? void 0 : deserializeRetentionPolicyMiniDispositionActionField(val.disposition_action); const id: string = val.id; const type: RetentionPolicyBaseTypeField = deserializeRetentionPolicyBaseTypeField(val.type); @@ -4590,14 +4596,14 @@ export function deserializeRetentionPolicyMini(val: any): RetentionPolicyMini { export function serializeRetentionPolicies(val: RetentionPolicies): Json { return { ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: RetentionPolicyMini): any { return serializeRetentionPolicyMini(item); - }) as readonly any[], ["limit"]: val.limit, ["next_marker"]: val.nextMarker }; + }) as readonly any[], ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker }; } export function deserializeRetentionPolicies(val: any): RetentionPolicies { - const entries: undefined | readonly RetentionPolicyMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly RetentionPolicyMini[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeRetentionPolicyMini(itm); - }) as readonly any[] : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | string = isJson(val.next_marker, "string") ? val.next_marker : void 0; + }) as readonly any[] : []; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | string = val.next_marker == void 0 ? void 0 : val.next_marker; return { entries: entries, limit: limit, nextMarker: nextMarker } satisfies RetentionPolicies; } export function serializeFileVersionRetentionTypeField(val: FileVersionRetentionTypeField): Json { @@ -4613,30 +4619,30 @@ export function deserializeFileVersionRetentionTypeField(val: any): FileVersionR throw "".concat("Invalid value: ", val) as string; } export function serializeFileVersionRetention(val: FileVersionRetention): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeFileVersionRetentionTypeField(val.type), ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion), ["file"]: val.file == void 0 ? void 0 : serializeFileMini(val.file), ["applied_at"]: val.appliedAt, ["disposition_at"]: val.dispositionAt, ["winning_retention_policy"]: val.winningRetentionPolicy == void 0 ? void 0 : serializeRetentionPolicyMini(val.winningRetentionPolicy) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeFileVersionRetentionTypeField(val.type), ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion), ["file"]: val.file == void 0 ? void 0 : serializeFileMini(val.file), ["applied_at"]: val.appliedAt == void 0 ? void 0 : val.appliedAt, ["disposition_at"]: val.dispositionAt == void 0 ? void 0 : val.dispositionAt, ["winning_retention_policy"]: val.winningRetentionPolicy == void 0 ? void 0 : serializeRetentionPolicyMini(val.winningRetentionPolicy) }; } export function deserializeFileVersionRetention(val: any): FileVersionRetention { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | FileVersionRetentionTypeField = val.type == void 0 ? void 0 : deserializeFileVersionRetentionTypeField(val.type); const fileVersion: undefined | FileVersionMini = val.file_version == void 0 ? void 0 : deserializeFileVersionMini(val.file_version); const file: undefined | FileMini = val.file == void 0 ? void 0 : deserializeFileMini(val.file); - const appliedAt: undefined | string = isJson(val.applied_at, "string") ? val.applied_at : void 0; - const dispositionAt: undefined | string = isJson(val.disposition_at, "string") ? val.disposition_at : void 0; + const appliedAt: undefined | string = val.applied_at == void 0 ? void 0 : val.applied_at; + const dispositionAt: undefined | string = val.disposition_at == void 0 ? void 0 : val.disposition_at; const winningRetentionPolicy: undefined | RetentionPolicyMini = val.winning_retention_policy == void 0 ? void 0 : deserializeRetentionPolicyMini(val.winning_retention_policy); return { id: id, type: type, fileVersion: fileVersion, file: file, appliedAt: appliedAt, dispositionAt: dispositionAt, winningRetentionPolicy: winningRetentionPolicy } satisfies FileVersionRetention; } export function serializeFileVersionRetentions(val: FileVersionRetentions): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileVersionRetention): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileVersionRetention): any { return serializeFileVersionRetention(item); }) as readonly any[] }; } export function deserializeFileVersionRetentions(val: any): FileVersionRetentions { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly FileVersionRetention[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly FileVersionRetention[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFileVersionRetention(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies FileVersionRetentions; } export function serializeRetentionPolicyAssignmentBaseTypeField(val: RetentionPolicyAssignmentBaseTypeField): Json { @@ -4662,14 +4668,14 @@ export function deserializeRetentionPolicyAssignmentBase(val: any): RetentionPol export function serializeRetentionPolicyAssignments(val: RetentionPolicyAssignments): Json { return { ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: RetentionPolicyAssignmentBase): any { return serializeRetentionPolicyAssignmentBase(item); - }) as readonly any[], ["limit"]: val.limit, ["next_marker"]: val.nextMarker }; + }) as readonly any[], ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker }; } export function deserializeRetentionPolicyAssignments(val: any): RetentionPolicyAssignments { - const entries: undefined | readonly RetentionPolicyAssignmentBase[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly RetentionPolicyAssignmentBase[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeRetentionPolicyAssignmentBase(itm); - }) as readonly any[] : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | string = isJson(val.next_marker, "string") ? val.next_marker : void 0; + }) as readonly any[] : []; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | string = val.next_marker == void 0 ? void 0 : val.next_marker; return { entries: entries, limit: limit, nextMarker: nextMarker } satisfies RetentionPolicyAssignments; } export function serializeShieldInformationBarrierBaseTypeField(val: ShieldInformationBarrierBaseTypeField): Json { @@ -4685,10 +4691,10 @@ export function deserializeShieldInformationBarrierBaseTypeField(val: any): Shie throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrierBase(val: ShieldInformationBarrierBase): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierBaseTypeField(val.type) }; } export function deserializeShieldInformationBarrierBase(val: any): ShieldInformationBarrierBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierBaseTypeField(val.type); return { id: id, type: type } satisfies ShieldInformationBarrierBase; } @@ -4712,10 +4718,10 @@ export function deserializeShieldInformationBarrierReportBaseTypeField(val: any) throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrierReportBase(val: ShieldInformationBarrierReportBase): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierReportBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierReportBaseTypeField(val.type) }; } export function deserializeShieldInformationBarrierReportBase(val: any): ShieldInformationBarrierReportBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierReportBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierReportBaseTypeField(val.type); return { id: id, type: type } satisfies ShieldInformationBarrierReportBase; } @@ -4732,10 +4738,10 @@ export function deserializeShieldInformationBarrierSegmentMemberBaseTypeField(va throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrierSegmentMemberBase(val: ShieldInformationBarrierSegmentMemberBase): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentMemberBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentMemberBaseTypeField(val.type) }; } export function deserializeShieldInformationBarrierSegmentMemberBase(val: any): ShieldInformationBarrierSegmentMemberBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierSegmentMemberBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentMemberBaseTypeField(val.type); return { id: id, type: type } satisfies ShieldInformationBarrierSegmentMemberBase; } @@ -4752,11 +4758,11 @@ export function deserializeShieldInformationBarrierSegmentRestrictionBaseTypeFie throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrierSegmentRestrictionBase(val: ShieldInformationBarrierSegmentRestrictionBase): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentRestrictionBaseTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentRestrictionBaseTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeShieldInformationBarrierSegmentRestrictionBase(val: any): ShieldInformationBarrierSegmentRestrictionBase { const type: undefined | ShieldInformationBarrierSegmentRestrictionBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentRestrictionBaseTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies ShieldInformationBarrierSegmentRestrictionBase; } export function serializeShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentFieldTypeField(val: ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentFieldTypeField): Json { @@ -4772,10 +4778,10 @@ export function deserializeShieldInformationBarrierSegmentRestrictionMiniShieldI throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField(val: ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentFieldTypeField(val.type) }; } export function deserializeShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField(val: any): ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentFieldTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentFieldTypeField(val.type); return { id: id, type: type } satisfies ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField; } @@ -4792,10 +4798,10 @@ export function deserializeShieldInformationBarrierSegmentRestrictionMiniRestric throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField(val: ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentFieldTypeField(val.type) }; } export function deserializeShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField(val: any): ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentFieldTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentFieldTypeField(val.type); return { id: id, type: type } satisfies ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField; } @@ -4810,14 +4816,14 @@ export function deserializeShieldInformationBarrierSegmentRestrictionMini(val: a const shieldInformationBarrierSegment: ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField = deserializeShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField(val.shield_information_barrier_segment); const restrictedSegment: ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField = deserializeShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField(val.restricted_segment); const type: undefined | ShieldInformationBarrierSegmentRestrictionBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentRestrictionBaseTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { shieldInformationBarrierSegment: shieldInformationBarrierSegment, restrictedSegment: restrictedSegment, type: type, id: id } satisfies ShieldInformationBarrierSegmentRestrictionMini; } export function serializeSessionTerminationMessage(val: SessionTerminationMessage): Json { - return { ["message"]: val.message }; + return { ["message"]: val.message == void 0 ? void 0 : val.message }; } export function deserializeSessionTerminationMessage(val: any): SessionTerminationMessage { - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; return { message: message } satisfies SessionTerminationMessage; } export function serializeStoragePolicyMiniTypeField(val: StoragePolicyMiniTypeField): Json { @@ -4833,19 +4839,19 @@ export function deserializeStoragePolicyMiniTypeField(val: any): StoragePolicyMi throw "".concat("Invalid value: ", val) as string; } export function serializeStoragePolicyMini(val: StoragePolicyMini): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeStoragePolicyMiniTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeStoragePolicyMiniTypeField(val.type) }; } export function deserializeStoragePolicyMini(val: any): StoragePolicyMini { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | StoragePolicyMiniTypeField = val.type == void 0 ? void 0 : deserializeStoragePolicyMiniTypeField(val.type); return { id: id, type: type } satisfies StoragePolicyMini; } export function serializeStoragePolicyAssignmentAssignedToField(val: StoragePolicyAssignmentAssignedToField): Json { - return { ["id"]: val.id, ["type"]: val.type }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : val.type }; } export function deserializeStoragePolicyAssignmentAssignedToField(val: any): StoragePolicyAssignmentAssignedToField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; return { id: id, type: type } satisfies StoragePolicyAssignmentAssignedToField; } export function serializeStoragePolicyAssignment(val: StoragePolicyAssignment): Json { @@ -4857,17 +4863,17 @@ export function deserializeStoragePolicyAssignment(val: any): StoragePolicyAssig return { storagePolicy: storagePolicy, assignedTo: assignedTo } satisfies StoragePolicyAssignment; } export function serializeStoragePolicyAssignments(val: StoragePolicyAssignments): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: StoragePolicyAssignment): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: StoragePolicyAssignment): any { return serializeStoragePolicyAssignment(item); }) as readonly any[] }; } export function deserializeStoragePolicyAssignments(val: any): StoragePolicyAssignments { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly StoragePolicyAssignment[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly StoragePolicyAssignment[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeStoragePolicyAssignment(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies StoragePolicyAssignments; } export function serializeStoragePolicy(val: StoragePolicy): Json { @@ -4875,26 +4881,26 @@ export function serializeStoragePolicy(val: StoragePolicy): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"StoragePolicy\""; } - return { ...base, ...{ ["name"]: val.name } }; + return { ...base, ...{ ["name"]: val.name == void 0 ? void 0 : val.name } }; } export function deserializeStoragePolicy(val: any): StoragePolicy { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | StoragePolicyMiniTypeField = val.type == void 0 ? void 0 : deserializeStoragePolicyMiniTypeField(val.type); return { name: name, id: id, type: type } satisfies StoragePolicy; } export function serializeStoragePolicies(val: StoragePolicies): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: StoragePolicy): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: StoragePolicy): any { return serializeStoragePolicy(item); }) as readonly any[] }; } export function deserializeStoragePolicies(val: any): StoragePolicies { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly StoragePolicy[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly StoragePolicy[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeStoragePolicy(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies StoragePolicies; } export function serializeTermsOfServiceBaseTypeField(val: TermsOfServiceBaseTypeField): Json { @@ -4910,10 +4916,10 @@ export function deserializeTermsOfServiceBaseTypeField(val: any): TermsOfService throw "".concat("Invalid value: ", val) as string; } export function serializeTermsOfServiceBase(val: TermsOfServiceBase): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeTermsOfServiceBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeTermsOfServiceBaseTypeField(val.type) }; } export function deserializeTermsOfServiceBase(val: any): TermsOfServiceBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | TermsOfServiceBaseTypeField = val.type == void 0 ? void 0 : deserializeTermsOfServiceBaseTypeField(val.type); return { id: id, type: type } satisfies TermsOfServiceBase; } @@ -4945,12 +4951,12 @@ export function deserializeTermsOfServiceEnterpriseFieldTypeField(val: any): Ter throw "".concat("Invalid value: ", val) as string; } export function serializeTermsOfServiceEnterpriseField(val: TermsOfServiceEnterpriseField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeTermsOfServiceEnterpriseFieldTypeField(val.type), ["name"]: val.name }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeTermsOfServiceEnterpriseFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeTermsOfServiceEnterpriseField(val: any): TermsOfServiceEnterpriseField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | TermsOfServiceEnterpriseFieldTypeField = val.type == void 0 ? void 0 : deserializeTermsOfServiceEnterpriseFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { id: id, type: type, name: name } satisfies TermsOfServiceEnterpriseField; } export function serializeTermsOfServiceTosTypeField(val: TermsOfServiceTosTypeField): Json { @@ -4973,47 +4979,47 @@ export function serializeTermsOfService(val: TermsOfService): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"TermsOfService\""; } - return { ...base, ...{ ["status"]: val.status == void 0 ? void 0 : serializeTermsOfServiceStatusField(val.status), ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeTermsOfServiceEnterpriseField(val.enterprise), ["tos_type"]: val.tosType == void 0 ? void 0 : serializeTermsOfServiceTosTypeField(val.tosType), ["text"]: val.text, ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt } }; + return { ...base, ...{ ["status"]: val.status == void 0 ? void 0 : serializeTermsOfServiceStatusField(val.status), ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeTermsOfServiceEnterpriseField(val.enterprise), ["tos_type"]: val.tosType == void 0 ? void 0 : serializeTermsOfServiceTosTypeField(val.tosType), ["text"]: val.text == void 0 ? void 0 : val.text, ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt } }; } export function deserializeTermsOfService(val: any): TermsOfService { const status: undefined | TermsOfServiceStatusField = val.status == void 0 ? void 0 : deserializeTermsOfServiceStatusField(val.status); const enterprise: undefined | TermsOfServiceEnterpriseField = val.enterprise == void 0 ? void 0 : deserializeTermsOfServiceEnterpriseField(val.enterprise); const tosType: undefined | TermsOfServiceTosTypeField = val.tos_type == void 0 ? void 0 : deserializeTermsOfServiceTosTypeField(val.tos_type); - const text: undefined | string = isJson(val.text, "string") ? val.text : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const text: undefined | string = val.text == void 0 ? void 0 : val.text; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | TermsOfServiceBaseTypeField = val.type == void 0 ? void 0 : deserializeTermsOfServiceBaseTypeField(val.type); return { status: status, enterprise: enterprise, tosType: tosType, text: text, createdAt: createdAt, modifiedAt: modifiedAt, id: id, type: type } satisfies TermsOfService; } export function serializeTermsOfServices(val: TermsOfServices): Json { - return { ["total_count"]: val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: TermsOfService): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: TermsOfService): any { return serializeTermsOfService(item); }) as readonly any[] }; } export function deserializeTermsOfServices(val: any): TermsOfServices { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const entries: undefined | readonly TermsOfService[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const entries: undefined | readonly TermsOfService[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTermsOfService(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TermsOfServices; } export function serializeSignTemplates(val: SignTemplates): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker }; + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker }; } export function deserializeSignTemplates(val: any): SignTemplates { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | string = isJson(val.next_marker, "string") ? val.next_marker : void 0; - const prevMarker: undefined | string = isJson(val.prev_marker, "string") ? val.prev_marker : void 0; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | string = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | string = val.prev_marker == void 0 ? void 0 : val.prev_marker; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker } satisfies SignTemplates; } export function serializeUploadPartMini(val: UploadPartMini): Json { - return { ["part_id"]: val.partId, ["offset"]: val.offset, ["size"]: val.size }; + return { ["part_id"]: val.partId == void 0 ? void 0 : val.partId, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["size"]: val.size == void 0 ? void 0 : val.size }; } export function deserializeUploadPartMini(val: any): UploadPartMini { - const partId: undefined | string = isJson(val.part_id, "string") ? val.part_id : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; + const partId: undefined | string = val.part_id == void 0 ? void 0 : val.part_id; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; return { partId: partId, offset: offset, size: size } satisfies UploadPartMini; } export function serializeUploadPart(val: UploadPart): Json { @@ -5021,13 +5027,13 @@ export function serializeUploadPart(val: UploadPart): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"UploadPart\""; } - return { ...base, ...{ ["sha1"]: val.sha1 } }; + return { ...base, ...{ ["sha1"]: val.sha1 == void 0 ? void 0 : val.sha1 } }; } export function deserializeUploadPart(val: any): UploadPart { - const sha1: undefined | string = isJson(val.sha1, "string") ? val.sha1 : void 0; - const partId: undefined | string = isJson(val.part_id, "string") ? val.part_id : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; + const sha1: undefined | string = val.sha1 == void 0 ? void 0 : val.sha1; + const partId: undefined | string = val.part_id == void 0 ? void 0 : val.part_id; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; return { sha1: sha1, partId: partId, offset: offset, size: size } satisfies UploadPart; } export function serializeUploadPartsOrderFieldDirectionField(val: UploadPartsOrderFieldDirectionField): Json { @@ -5046,30 +5052,30 @@ export function deserializeUploadPartsOrderFieldDirectionField(val: any): Upload throw "".concat("Invalid value: ", val) as string; } export function serializeUploadPartsOrderField(val: UploadPartsOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeUploadPartsOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeUploadPartsOrderFieldDirectionField(val.direction) }; } export function deserializeUploadPartsOrderField(val: any): UploadPartsOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | UploadPartsOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeUploadPartsOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies UploadPartsOrderField; } export function serializeUploadParts(val: UploadParts): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: UploadPartsOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: UploadPartsOrderField): any { return serializeUploadPartsOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: UploadPart): any { return serializeUploadPart(item); }) as readonly any[] }; } export function deserializeUploadParts(val: any): UploadParts { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly UploadPartsOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly UploadPartsOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeUploadPartsOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly UploadPart[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly UploadPart[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeUploadPart(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies UploadParts; } export function serializeUploadedPart(val: UploadedPart): Json { @@ -5092,45 +5098,45 @@ export function deserializeUploadSessionTypeField(val: any): UploadSessionTypeFi throw "".concat("Invalid value: ", val) as string; } export function serializeUploadSessionSessionEndpointsField(val: UploadSessionSessionEndpointsField): Json { - return { ["upload_part"]: val.uploadPart, ["commit"]: val.commit, ["abort"]: val.abort, ["list_parts"]: val.listParts, ["status"]: val.status, ["log_event"]: val.logEvent }; + return { ["upload_part"]: val.uploadPart == void 0 ? void 0 : val.uploadPart, ["commit"]: val.commit == void 0 ? void 0 : val.commit, ["abort"]: val.abort == void 0 ? void 0 : val.abort, ["list_parts"]: val.listParts == void 0 ? void 0 : val.listParts, ["status"]: val.status == void 0 ? void 0 : val.status, ["log_event"]: val.logEvent == void 0 ? void 0 : val.logEvent }; } export function deserializeUploadSessionSessionEndpointsField(val: any): UploadSessionSessionEndpointsField { - const uploadPart: undefined | string = isJson(val.upload_part, "string") ? val.upload_part : void 0; - const commit: undefined | string = isJson(val.commit, "string") ? val.commit : void 0; - const abort: undefined | string = isJson(val.abort, "string") ? val.abort : void 0; - const listParts: undefined | string = isJson(val.list_parts, "string") ? val.list_parts : void 0; - const status: undefined | string = isJson(val.status, "string") ? val.status : void 0; - const logEvent: undefined | string = isJson(val.log_event, "string") ? val.log_event : void 0; + const uploadPart: undefined | string = val.upload_part == void 0 ? void 0 : val.upload_part; + const commit: undefined | string = val.commit == void 0 ? void 0 : val.commit; + const abort: undefined | string = val.abort == void 0 ? void 0 : val.abort; + const listParts: undefined | string = val.list_parts == void 0 ? void 0 : val.list_parts; + const status: undefined | string = val.status == void 0 ? void 0 : val.status; + const logEvent: undefined | string = val.log_event == void 0 ? void 0 : val.log_event; return { uploadPart: uploadPart, commit: commit, abort: abort, listParts: listParts, status: status, logEvent: logEvent } satisfies UploadSessionSessionEndpointsField; } export function serializeUploadSession(val: UploadSession): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeUploadSessionTypeField(val.type), ["session_expires_at"]: val.sessionExpiresAt, ["part_size"]: val.partSize, ["total_parts"]: val.totalParts, ["num_parts_processed"]: val.numPartsProcessed, ["session_endpoints"]: val.sessionEndpoints == void 0 ? void 0 : serializeUploadSessionSessionEndpointsField(val.sessionEndpoints) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeUploadSessionTypeField(val.type), ["session_expires_at"]: val.sessionExpiresAt == void 0 ? void 0 : val.sessionExpiresAt, ["part_size"]: val.partSize == void 0 ? void 0 : val.partSize, ["total_parts"]: val.totalParts == void 0 ? void 0 : val.totalParts, ["num_parts_processed"]: val.numPartsProcessed == void 0 ? void 0 : val.numPartsProcessed, ["session_endpoints"]: val.sessionEndpoints == void 0 ? void 0 : serializeUploadSessionSessionEndpointsField(val.sessionEndpoints) }; } export function deserializeUploadSession(val: any): UploadSession { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | UploadSessionTypeField = val.type == void 0 ? void 0 : deserializeUploadSessionTypeField(val.type); - const sessionExpiresAt: undefined | string = isJson(val.session_expires_at, "string") ? val.session_expires_at : void 0; - const partSize: undefined | number = isJson(val.part_size, "number") ? val.part_size : void 0; - const totalParts: undefined | number = isJson(val.total_parts, "number") ? val.total_parts : void 0; - const numPartsProcessed: undefined | number = isJson(val.num_parts_processed, "number") ? val.num_parts_processed : void 0; + const sessionExpiresAt: undefined | string = val.session_expires_at == void 0 ? void 0 : val.session_expires_at; + const partSize: undefined | number = val.part_size == void 0 ? void 0 : val.part_size; + const totalParts: undefined | number = val.total_parts == void 0 ? void 0 : val.total_parts; + const numPartsProcessed: undefined | number = val.num_parts_processed == void 0 ? void 0 : val.num_parts_processed; const sessionEndpoints: undefined | UploadSessionSessionEndpointsField = val.session_endpoints == void 0 ? void 0 : deserializeUploadSessionSessionEndpointsField(val.session_endpoints); return { id: id, type: type, sessionExpiresAt: sessionExpiresAt, partSize: partSize, totalParts: totalParts, numPartsProcessed: numPartsProcessed, sessionEndpoints: sessionEndpoints } satisfies UploadSession; } export function serializeUploadUrl(val: UploadUrl): Json { - return { ["upload_url"]: val.uploadUrl, ["upload_token"]: val.uploadToken }; + return { ["upload_url"]: val.uploadUrl == void 0 ? void 0 : val.uploadUrl, ["upload_token"]: val.uploadToken == void 0 ? void 0 : val.uploadToken }; } export function deserializeUploadUrl(val: any): UploadUrl { - const uploadUrl: undefined | string = isJson(val.upload_url, "string") ? val.upload_url : void 0; - const uploadToken: undefined | string = isJson(val.upload_token, "string") ? val.upload_token : void 0; + const uploadUrl: undefined | string = val.upload_url == void 0 ? void 0 : val.upload_url; + const uploadToken: undefined | string = val.upload_token == void 0 ? void 0 : val.upload_token; return { uploadUrl: uploadUrl, uploadToken: uploadToken } satisfies UploadUrl; } export function serializeUserAvatarPicUrlsField(val: UserAvatarPicUrlsField): Json { - return { ["small"]: val.small, ["large"]: val.large, ["preview"]: val.preview }; + return { ["small"]: val.small == void 0 ? void 0 : val.small, ["large"]: val.large == void 0 ? void 0 : val.large, ["preview"]: val.preview == void 0 ? void 0 : val.preview }; } export function deserializeUserAvatarPicUrlsField(val: any): UserAvatarPicUrlsField { - const small: undefined | string = isJson(val.small, "string") ? val.small : void 0; - const large: undefined | string = isJson(val.large, "string") ? val.large : void 0; - const preview: undefined | string = isJson(val.preview, "string") ? val.preview : void 0; + const small: undefined | string = val.small == void 0 ? void 0 : val.small; + const large: undefined | string = val.large == void 0 ? void 0 : val.large; + const preview: undefined | string = val.preview == void 0 ? void 0 : val.preview; return { small: small, large: large, preview: preview } satisfies UserAvatarPicUrlsField; } export function serializeUserAvatar(val: UserAvatar): Json { @@ -5153,10 +5159,10 @@ export function deserializeUserBaseTypeField(val: any): UserBaseTypeField { throw "".concat("Invalid value: ", val) as string; } export function serializeUserBase(val: UserBase): Json { - return { ["id"]: val.id, ["type"]: serializeUserBaseTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: serializeUserBaseTypeField(val.type) }; } export function deserializeUserBase(val: any): UserBase { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: UserBaseTypeField = deserializeUserBaseTypeField(val.type); return { id: id, type: type } satisfies UserBase; } @@ -5165,12 +5171,12 @@ export function serializeUserIntegrationMappings(val: UserIntegrationMappings): if (!isJson(base, "object")) { throw "Expecting an object for \"UserIntegrationMappings\""; } - return { ...base, ...{ ["name"]: val.name, ["login"]: val.login } }; + return { ...base, ...{ ["name"]: val.name == void 0 ? void 0 : val.name, ["login"]: val.login == void 0 ? void 0 : val.login } }; } export function deserializeUserIntegrationMappings(val: any): UserIntegrationMappings { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: UserBaseTypeField = deserializeUserBaseTypeField(val.type); return { name: name, login: login, id: id, type: type } satisfies UserIntegrationMappings; } @@ -5179,12 +5185,12 @@ export function serializeUserCollaborations(val: UserCollaborations): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"UserCollaborations\""; } - return { ...base, ...{ ["name"]: val.name, ["login"]: val.login } }; + return { ...base, ...{ ["name"]: val.name == void 0 ? void 0 : val.name, ["login"]: val.login == void 0 ? void 0 : val.login } }; } export function deserializeUserCollaborations(val: any): UserCollaborations { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: UserBaseTypeField = deserializeUserBaseTypeField(val.type); return { name: name, login: login, id: id, type: type } satisfies UserCollaborations; } @@ -5193,12 +5199,12 @@ export function serializeUserMini(val: UserMini): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"UserMini\""; } - return { ...base, ...{ ["name"]: val.name, ["login"]: val.login } }; + return { ...base, ...{ ["name"]: val.name == void 0 ? void 0 : val.name, ["login"]: val.login == void 0 ? void 0 : val.login } }; } export function deserializeUserMini(val: any): UserMini { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: UserBaseTypeField = deserializeUserBaseTypeField(val.type); return { name: name, login: login, id: id, type: type } satisfies UserMini; } @@ -5218,10 +5224,10 @@ export function deserializeEventSourceItemTypeField(val: any): EventSourceItemTy throw "".concat("Invalid value: ", val) as string; } export function serializeEventSourceClassificationField(val: EventSourceClassificationField): Json { - return { ["name"]: val.name }; + return { ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeEventSourceClassificationField(val: any): EventSourceClassificationField { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { name: name } satisfies EventSourceClassificationField; } export function serializeEventSource(val: EventSource): Json { @@ -5258,11 +5264,11 @@ export function deserializeUserStatusField(val: any): UserStatusField { throw "".concat("Invalid value: ", val) as string; } export function serializeUserNotificationEmailField(val: UserNotificationEmailField): Json { - return { ["email"]: val.email, ["is_confirmed"]: val.isConfirmed }; + return { ["email"]: val.email == void 0 ? void 0 : val.email, ["is_confirmed"]: val.isConfirmed == void 0 ? void 0 : val.isConfirmed }; } export function deserializeUserNotificationEmailField(val: any): UserNotificationEmailField { - const email: undefined | string = isJson(val.email, "string") ? val.email : void 0; - const isConfirmed: undefined | boolean = isJson(val.is_confirmed, "boolean") ? val.is_confirmed : void 0; + const email: undefined | string = val.email == void 0 ? void 0 : val.email; + const isConfirmed: undefined | boolean = val.is_confirmed == void 0 ? void 0 : val.is_confirmed; return { email: email, isConfirmed: isConfirmed } satisfies UserNotificationEmailField; } export function serializeUser(val: User): Json { @@ -5270,25 +5276,25 @@ export function serializeUser(val: User): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"User\""; } - return { ...base, ...{ ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["language"]: val.language, ["timezone"]: val.timezone, ["space_amount"]: val.spaceAmount, ["space_used"]: val.spaceUsed, ["max_upload_size"]: val.maxUploadSize, ["status"]: val.status == void 0 ? void 0 : serializeUserStatusField(val.status), ["job_title"]: val.jobTitle, ["phone"]: val.phone, ["address"]: val.address, ["avatar_url"]: val.avatarUrl, ["notification_email"]: val.notificationEmail == void 0 ? void 0 : serializeUserNotificationEmailField(val.notificationEmail) } }; + return { ...base, ...{ ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["language"]: val.language == void 0 ? void 0 : val.language, ["timezone"]: val.timezone == void 0 ? void 0 : val.timezone, ["space_amount"]: val.spaceAmount == void 0 ? void 0 : val.spaceAmount, ["space_used"]: val.spaceUsed == void 0 ? void 0 : val.spaceUsed, ["max_upload_size"]: val.maxUploadSize == void 0 ? void 0 : val.maxUploadSize, ["status"]: val.status == void 0 ? void 0 : serializeUserStatusField(val.status), ["job_title"]: val.jobTitle == void 0 ? void 0 : val.jobTitle, ["phone"]: val.phone == void 0 ? void 0 : val.phone, ["address"]: val.address == void 0 ? void 0 : val.address, ["avatar_url"]: val.avatarUrl == void 0 ? void 0 : val.avatarUrl, ["notification_email"]: val.notificationEmail == void 0 ? void 0 : serializeUserNotificationEmailField(val.notificationEmail) } }; } export function deserializeUser(val: any): User { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const language: undefined | string = isJson(val.language, "string") ? val.language : void 0; - const timezone: undefined | string = isJson(val.timezone, "string") ? val.timezone : void 0; - const spaceAmount: undefined | number = isJson(val.space_amount, "number") ? val.space_amount : void 0; - const spaceUsed: undefined | number = isJson(val.space_used, "number") ? val.space_used : void 0; - const maxUploadSize: undefined | number = isJson(val.max_upload_size, "number") ? val.max_upload_size : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const language: undefined | string = val.language == void 0 ? void 0 : val.language; + const timezone: undefined | string = val.timezone == void 0 ? void 0 : val.timezone; + const spaceAmount: undefined | number = val.space_amount == void 0 ? void 0 : val.space_amount; + const spaceUsed: undefined | number = val.space_used == void 0 ? void 0 : val.space_used; + const maxUploadSize: undefined | number = val.max_upload_size == void 0 ? void 0 : val.max_upload_size; const status: undefined | UserStatusField = val.status == void 0 ? void 0 : deserializeUserStatusField(val.status); - const jobTitle: undefined | string = isJson(val.job_title, "string") ? val.job_title : void 0; - const phone: undefined | string = isJson(val.phone, "string") ? val.phone : void 0; - const address: undefined | string = isJson(val.address, "string") ? val.address : void 0; - const avatarUrl: undefined | string = isJson(val.avatar_url, "string") ? val.avatar_url : void 0; + const jobTitle: undefined | string = val.job_title == void 0 ? void 0 : val.job_title; + const phone: undefined | string = val.phone == void 0 ? void 0 : val.phone; + const address: undefined | string = val.address == void 0 ? void 0 : val.address; + const avatarUrl: undefined | string = val.avatar_url == void 0 ? void 0 : val.avatar_url; const notificationEmail: undefined | UserNotificationEmailField = val.notification_email == void 0 ? void 0 : deserializeUserNotificationEmailField(val.notification_email); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: UserBaseTypeField = deserializeUserBaseTypeField(val.type); return { createdAt: createdAt, modifiedAt: modifiedAt, language: language, timezone: timezone, spaceAmount: spaceAmount, spaceUsed: spaceUsed, maxUploadSize: maxUploadSize, status: status, jobTitle: jobTitle, phone: phone, address: address, avatarUrl: avatarUrl, notificationEmail: notificationEmail, name: name, login: login, id: id, type: type } satisfies User; } @@ -5308,30 +5314,30 @@ export function deserializeUsersOrderFieldDirectionField(val: any): UsersOrderFi throw "".concat("Invalid value: ", val) as string; } export function serializeUsersOrderField(val: UsersOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeUsersOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeUsersOrderFieldDirectionField(val.direction) }; } export function deserializeUsersOrderField(val: any): UsersOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | UsersOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeUsersOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies UsersOrderField; } export function serializeUsers(val: Users): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: UsersOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: UsersOrderField): any { return serializeUsersOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: User): any { return serializeUser(item); }) as readonly any[] }; } export function deserializeUsers(val: any): Users { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly UsersOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly UsersOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeUsersOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly User[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly User[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeUser(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies Users; } export function serializeTrashWebLinkRestoredTypeField(val: TrashWebLinkRestoredTypeField): Json { @@ -5353,9 +5359,9 @@ export function serializeTrashWebLinkRestoredPathCollectionField(val: TrashWebLi } export function deserializeTrashWebLinkRestoredPathCollectionField(val: any): TrashWebLinkRestoredPathCollectionField { const totalCount: number = val.total_count; - const entries: readonly FolderMini[] = val.entries.map(function (itm: Json): any { + const entries: readonly FolderMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFolderMini(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TrashWebLinkRestoredPathCollectionField; } export function serializeTrashWebLinkRestoredItemStatusField(val: TrashWebLinkRestoredItemStatusField): Json { @@ -5377,26 +5383,26 @@ export function deserializeTrashWebLinkRestoredItemStatusField(val: any): TrashW throw "".concat("Invalid value: ", val) as string; } export function serializeTrashWebLinkRestored(val: TrashWebLinkRestored): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeTrashWebLinkRestoredTypeField(val.type), ["id"]: val.id, ["sequence_id"]: val.sequenceId, ["etag"]: val.etag, ["name"]: val.name, ["url"]: val.url, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["description"]: val.description, ["path_collection"]: serializeTrashWebLinkRestoredPathCollectionField(val.pathCollection), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink, ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeTrashWebLinkRestoredItemStatusField(val.itemStatus) }; + return { ["type"]: val.type == void 0 ? void 0 : serializeTrashWebLinkRestoredTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id, ["sequence_id"]: val.sequenceId, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["name"]: val.name == void 0 ? void 0 : val.name, ["url"]: val.url == void 0 ? void 0 : val.url, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["description"]: val.description == void 0 ? void 0 : val.description, ["path_collection"]: serializeTrashWebLinkRestoredPathCollectionField(val.pathCollection), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : val.sharedLink, ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeTrashWebLinkRestoredItemStatusField(val.itemStatus) }; } export function deserializeTrashWebLinkRestored(val: any): TrashWebLinkRestored { const type: undefined | TrashWebLinkRestoredTypeField = val.type == void 0 ? void 0 : deserializeTrashWebLinkRestoredTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const sequenceId: string = val.sequence_id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const pathCollection: TrashWebLinkRestoredPathCollectionField = deserializeTrashWebLinkRestoredPathCollectionField(val.path_collection); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); - const sharedLink: undefined | string = isJson(val.shared_link, "string") ? val.shared_link : void 0; + const sharedLink: undefined | string = val.shared_link == void 0 ? void 0 : val.shared_link; const itemStatus: undefined | TrashWebLinkRestoredItemStatusField = val.item_status == void 0 ? void 0 : deserializeTrashWebLinkRestoredItemStatusField(val.item_status); return { type: type, id: id, sequenceId: sequenceId, etag: etag, name: name, url: url, parent: parent, description: description, pathCollection: pathCollection, createdAt: createdAt, modifiedAt: modifiedAt, trashedAt: trashedAt, purgedAt: purgedAt, createdBy: createdBy, modifiedBy: modifiedBy, ownedBy: ownedBy, sharedLink: sharedLink, itemStatus: itemStatus } satisfies TrashWebLinkRestored; } @@ -5419,9 +5425,9 @@ export function serializeTrashFolderRestoredPathCollectionField(val: TrashFolder } export function deserializeTrashFolderRestoredPathCollectionField(val: any): TrashFolderRestoredPathCollectionField { const totalCount: number = val.total_count; - const entries: readonly FolderMini[] = val.entries.map(function (itm: Json): any { + const entries: readonly FolderMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFolderMini(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TrashFolderRestoredPathCollectionField; } export function serializeTrashFolderRestoredItemStatusField(val: TrashFolderRestoredItemStatusField): Json { @@ -5443,28 +5449,28 @@ export function deserializeTrashFolderRestoredItemStatusField(val: any): TrashFo throw "".concat("Invalid value: ", val) as string; } export function serializeTrashFolderRestored(val: TrashFolderRestored): Json { - return { ["id"]: val.id, ["etag"]: val.etag, ["type"]: val.type == void 0 ? void 0 : serializeTrashFolderRestoredTypeField(val.type), ["sequence_id"]: val.sequenceId, ["name"]: val.name, ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["description"]: val.description, ["size"]: val.size, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeTrashFolderRestoredPathCollectionField(val.pathCollection), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["content_created_at"]: val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt, ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink, ["folder_upload_email"]: val.folderUploadEmail, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeTrashFolderRestoredItemStatusField(val.itemStatus) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["type"]: val.type == void 0 ? void 0 : serializeTrashFolderRestoredTypeField(val.type), ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId, ["name"]: val.name == void 0 ? void 0 : val.name, ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["description"]: val.description == void 0 ? void 0 : val.description, ["size"]: val.size == void 0 ? void 0 : val.size, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeTrashFolderRestoredPathCollectionField(val.pathCollection), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["content_created_at"]: val.contentCreatedAt == void 0 ? void 0 : val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt == void 0 ? void 0 : val.contentModifiedAt, ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : val.sharedLink, ["folder_upload_email"]: val.folderUploadEmail == void 0 ? void 0 : val.folderUploadEmail, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeTrashFolderRestoredItemStatusField(val.itemStatus) }; } export function deserializeTrashFolderRestored(val: any): TrashFolderRestored { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: undefined | TrashFolderRestoredTypeField = val.type == void 0 ? void 0 : deserializeTrashFolderRestoredTypeField(val.type); - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; const pathCollection: undefined | TrashFolderRestoredPathCollectionField = val.path_collection == void 0 ? void 0 : deserializeTrashFolderRestoredPathCollectionField(val.path_collection); const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); - const sharedLink: undefined | string = isJson(val.shared_link, "string") ? val.shared_link : void 0; - const folderUploadEmail: undefined | string = isJson(val.folder_upload_email, "string") ? val.folder_upload_email : void 0; + const sharedLink: undefined | string = val.shared_link == void 0 ? void 0 : val.shared_link; + const folderUploadEmail: undefined | string = val.folder_upload_email == void 0 ? void 0 : val.folder_upload_email; const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); const itemStatus: undefined | TrashFolderRestoredItemStatusField = val.item_status == void 0 ? void 0 : deserializeTrashFolderRestoredItemStatusField(val.item_status); return { id: id, etag: etag, type: type, sequenceId: sequenceId, name: name, createdAt: createdAt, modifiedAt: modifiedAt, description: description, size: size, pathCollection: pathCollection, createdBy: createdBy, modifiedBy: modifiedBy, trashedAt: trashedAt, purgedAt: purgedAt, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt, ownedBy: ownedBy, sharedLink: sharedLink, folderUploadEmail: folderUploadEmail, parent: parent, itemStatus: itemStatus } satisfies TrashFolderRestored; @@ -5488,9 +5494,9 @@ export function serializeTrashFileRestoredPathCollectionField(val: TrashFileRest } export function deserializeTrashFileRestoredPathCollectionField(val: any): TrashFileRestoredPathCollectionField { const totalCount: number = val.total_count; - const entries: readonly FolderMini[] = val.entries.map(function (itm: Json): any { + const entries: readonly FolderMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFolderMini(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TrashFileRestoredPathCollectionField; } export function serializeTrashFileRestoredItemStatusField(val: TrashFileRestoredItemStatusField): Json { @@ -5512,14 +5518,14 @@ export function deserializeTrashFileRestoredItemStatusField(val: any): TrashFile throw "".concat("Invalid value: ", val) as string; } export function serializeTrashFileRestored(val: TrashFileRestored): Json { - return { ["id"]: val.id, ["etag"]: val.etag, ["type"]: serializeTrashFileRestoredTypeField(val.type), ["sequence_id"]: val.sequenceId, ["name"]: val.name, ["sha1"]: val.sha1, ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion), ["description"]: val.description, ["size"]: val.size, ["path_collection"]: serializeTrashFileRestoredPathCollectionField(val.pathCollection), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["content_created_at"]: val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: serializeUserMini(val.modifiedBy), ["owned_by"]: serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: serializeTrashFileRestoredItemStatusField(val.itemStatus) }; + return { ["id"]: val.id, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["type"]: serializeTrashFileRestoredTypeField(val.type), ["sequence_id"]: val.sequenceId, ["name"]: val.name == void 0 ? void 0 : val.name, ["sha1"]: val.sha1, ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion), ["description"]: val.description, ["size"]: val.size, ["path_collection"]: serializeTrashFileRestoredPathCollectionField(val.pathCollection), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["content_created_at"]: val.contentCreatedAt == void 0 ? void 0 : val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt == void 0 ? void 0 : val.contentModifiedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: serializeUserMini(val.modifiedBy), ["owned_by"]: serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : val.sharedLink, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: serializeTrashFileRestoredItemStatusField(val.itemStatus) }; } export function deserializeTrashFileRestored(val: any): TrashFileRestored { const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: TrashFileRestoredTypeField = deserializeTrashFileRestoredTypeField(val.type); const sequenceId: string = val.sequence_id; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const sha1: string = val.sha1; const fileVersion: undefined | FileVersionMini = val.file_version == void 0 ? void 0 : deserializeFileVersionMini(val.file_version); const description: string = val.description; @@ -5527,14 +5533,14 @@ export function deserializeTrashFileRestored(val: any): TrashFileRestored { const pathCollection: TrashFileRestoredPathCollectionField = deserializeTrashFileRestoredPathCollectionField(val.path_collection); const createdAt: string = val.created_at; const modifiedAt: string = val.modified_at; - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: UserMini = deserializeUserMini(val.modified_by); const ownedBy: UserMini = deserializeUserMini(val.owned_by); - const sharedLink: undefined | string = isJson(val.shared_link, "string") ? val.shared_link : void 0; + const sharedLink: undefined | string = val.shared_link == void 0 ? void 0 : val.shared_link; const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); const itemStatus: TrashFileRestoredItemStatusField = deserializeTrashFileRestoredItemStatusField(val.item_status); return { id: id, etag: etag, type: type, sequenceId: sequenceId, name: name, sha1: sha1, fileVersion: fileVersion, description: description, size: size, pathCollection: pathCollection, createdAt: createdAt, modifiedAt: modifiedAt, trashedAt: trashedAt, purgedAt: purgedAt, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt, createdBy: createdBy, modifiedBy: modifiedBy, ownedBy: ownedBy, sharedLink: sharedLink, parent: parent, itemStatus: itemStatus } satisfies TrashFileRestored; @@ -5564,14 +5570,14 @@ export function deserializeTrashWebLinkPathCollectionFieldEntriesFieldTypeField( throw "".concat("Invalid value: ", val) as string; } export function serializeTrashWebLinkPathCollectionFieldEntriesField(val: TrashWebLinkPathCollectionFieldEntriesField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeTrashWebLinkPathCollectionFieldEntriesFieldTypeField(val.type), ["id"]: val.id, ["sequence_id"]: val.sequenceId, ["etag"]: val.etag, ["name"]: val.name }; + return { ["type"]: val.type == void 0 ? void 0 : serializeTrashWebLinkPathCollectionFieldEntriesFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id, ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeTrashWebLinkPathCollectionFieldEntriesField(val: any): TrashWebLinkPathCollectionFieldEntriesField { const type: undefined | TrashWebLinkPathCollectionFieldEntriesFieldTypeField = val.type == void 0 ? void 0 : deserializeTrashWebLinkPathCollectionFieldEntriesFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { type: type, id: id, sequenceId: sequenceId, etag: etag, name: name } satisfies TrashWebLinkPathCollectionFieldEntriesField; } export function serializeTrashWebLinkPathCollectionField(val: TrashWebLinkPathCollectionField): Json { @@ -5581,9 +5587,9 @@ export function serializeTrashWebLinkPathCollectionField(val: TrashWebLinkPathCo } export function deserializeTrashWebLinkPathCollectionField(val: any): TrashWebLinkPathCollectionField { const totalCount: number = val.total_count; - const entries: readonly TrashWebLinkPathCollectionFieldEntriesField[] = val.entries.map(function (itm: Json): any { + const entries: readonly TrashWebLinkPathCollectionFieldEntriesField[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTrashWebLinkPathCollectionFieldEntriesField(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TrashWebLinkPathCollectionField; } export function serializeTrashWebLinkItemStatusField(val: TrashWebLinkItemStatusField): Json { @@ -5605,26 +5611,26 @@ export function deserializeTrashWebLinkItemStatusField(val: any): TrashWebLinkIt throw "".concat("Invalid value: ", val) as string; } export function serializeTrashWebLink(val: TrashWebLink): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeTrashWebLinkTypeField(val.type), ["id"]: val.id, ["sequence_id"]: val.sequenceId, ["etag"]: val.etag, ["name"]: val.name, ["url"]: val.url, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["description"]: val.description, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeTrashWebLinkPathCollectionField(val.pathCollection), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink, ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeTrashWebLinkItemStatusField(val.itemStatus) }; + return { ["type"]: val.type == void 0 ? void 0 : serializeTrashWebLinkTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id, ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["name"]: val.name == void 0 ? void 0 : val.name, ["url"]: val.url == void 0 ? void 0 : val.url, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["description"]: val.description == void 0 ? void 0 : val.description, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeTrashWebLinkPathCollectionField(val.pathCollection), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : val.sharedLink, ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeTrashWebLinkItemStatusField(val.itemStatus) }; } export function deserializeTrashWebLink(val: any): TrashWebLink { const type: undefined | TrashWebLinkTypeField = val.type == void 0 ? void 0 : deserializeTrashWebLinkTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const pathCollection: undefined | TrashWebLinkPathCollectionField = val.path_collection == void 0 ? void 0 : deserializeTrashWebLinkPathCollectionField(val.path_collection); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); - const sharedLink: undefined | string = isJson(val.shared_link, "string") ? val.shared_link : void 0; + const sharedLink: undefined | string = val.shared_link == void 0 ? void 0 : val.shared_link; const itemStatus: undefined | TrashWebLinkItemStatusField = val.item_status == void 0 ? void 0 : deserializeTrashWebLinkItemStatusField(val.item_status); return { type: type, id: id, sequenceId: sequenceId, etag: etag, name: name, url: url, parent: parent, description: description, pathCollection: pathCollection, createdAt: createdAt, modifiedAt: modifiedAt, trashedAt: trashedAt, purgedAt: purgedAt, createdBy: createdBy, modifiedBy: modifiedBy, ownedBy: ownedBy, sharedLink: sharedLink, itemStatus: itemStatus } satisfies TrashWebLink; } @@ -5653,14 +5659,14 @@ export function deserializeTrashFolderPathCollectionFieldEntriesFieldTypeField(v throw "".concat("Invalid value: ", val) as string; } export function serializeTrashFolderPathCollectionFieldEntriesField(val: TrashFolderPathCollectionFieldEntriesField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeTrashFolderPathCollectionFieldEntriesFieldTypeField(val.type), ["id"]: val.id, ["sequence_id"]: val.sequenceId, ["etag"]: val.etag, ["name"]: val.name }; + return { ["type"]: val.type == void 0 ? void 0 : serializeTrashFolderPathCollectionFieldEntriesFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id, ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeTrashFolderPathCollectionFieldEntriesField(val: any): TrashFolderPathCollectionFieldEntriesField { const type: undefined | TrashFolderPathCollectionFieldEntriesFieldTypeField = val.type == void 0 ? void 0 : deserializeTrashFolderPathCollectionFieldEntriesFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { type: type, id: id, sequenceId: sequenceId, etag: etag, name: name } satisfies TrashFolderPathCollectionFieldEntriesField; } export function serializeTrashFolderPathCollectionField(val: TrashFolderPathCollectionField): Json { @@ -5670,9 +5676,9 @@ export function serializeTrashFolderPathCollectionField(val: TrashFolderPathColl } export function deserializeTrashFolderPathCollectionField(val: any): TrashFolderPathCollectionField { const totalCount: number = val.total_count; - const entries: readonly TrashFolderPathCollectionFieldEntriesField[] = val.entries.map(function (itm: Json): any { + const entries: readonly TrashFolderPathCollectionFieldEntriesField[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTrashFolderPathCollectionFieldEntriesField(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TrashFolderPathCollectionField; } export function serializeTrashFolderItemStatusField(val: TrashFolderItemStatusField): Json { @@ -5694,28 +5700,28 @@ export function deserializeTrashFolderItemStatusField(val: any): TrashFolderItem throw "".concat("Invalid value: ", val) as string; } export function serializeTrashFolder(val: TrashFolder): Json { - return { ["id"]: val.id, ["etag"]: val.etag, ["type"]: serializeTrashFolderTypeField(val.type), ["sequence_id"]: val.sequenceId, ["name"]: val.name, ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["description"]: val.description, ["size"]: val.size, ["path_collection"]: serializeTrashFolderPathCollectionField(val.pathCollection), ["created_by"]: serializeUserMini(val.createdBy), ["modified_by"]: serializeUserMini(val.modifiedBy), ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["content_created_at"]: val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt, ["owned_by"]: serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink, ["folder_upload_email"]: val.folderUploadEmail, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: serializeTrashFolderItemStatusField(val.itemStatus) }; + return { ["id"]: val.id, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["type"]: serializeTrashFolderTypeField(val.type), ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId, ["name"]: val.name, ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["description"]: val.description, ["size"]: val.size, ["path_collection"]: serializeTrashFolderPathCollectionField(val.pathCollection), ["created_by"]: serializeUserMini(val.createdBy), ["modified_by"]: serializeUserMini(val.modifiedBy), ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["content_created_at"]: val.contentCreatedAt == void 0 ? void 0 : val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt == void 0 ? void 0 : val.contentModifiedAt, ["owned_by"]: serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : val.sharedLink, ["folder_upload_email"]: val.folderUploadEmail == void 0 ? void 0 : val.folderUploadEmail, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: serializeTrashFolderItemStatusField(val.itemStatus) }; } export function deserializeTrashFolder(val: any): TrashFolder { const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: TrashFolderTypeField = deserializeTrashFolderTypeField(val.type); - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; const name: string = val.name; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; const description: string = val.description; const size: number = val.size; const pathCollection: TrashFolderPathCollectionField = deserializeTrashFolderPathCollectionField(val.path_collection); const createdBy: UserMini = deserializeUserMini(val.created_by); const modifiedBy: UserMini = deserializeUserMini(val.modified_by); - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; const ownedBy: UserMini = deserializeUserMini(val.owned_by); - const sharedLink: undefined | string = isJson(val.shared_link, "string") ? val.shared_link : void 0; - const folderUploadEmail: undefined | string = isJson(val.folder_upload_email, "string") ? val.folder_upload_email : void 0; + const sharedLink: undefined | string = val.shared_link == void 0 ? void 0 : val.shared_link; + const folderUploadEmail: undefined | string = val.folder_upload_email == void 0 ? void 0 : val.folder_upload_email; const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); const itemStatus: TrashFolderItemStatusField = deserializeTrashFolderItemStatusField(val.item_status); return { id: id, etag: etag, type: type, sequenceId: sequenceId, name: name, createdAt: createdAt, modifiedAt: modifiedAt, description: description, size: size, pathCollection: pathCollection, createdBy: createdBy, modifiedBy: modifiedBy, trashedAt: trashedAt, purgedAt: purgedAt, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt, ownedBy: ownedBy, sharedLink: sharedLink, folderUploadEmail: folderUploadEmail, parent: parent, itemStatus: itemStatus } satisfies TrashFolder; @@ -5745,14 +5751,14 @@ export function deserializeTrashFilePathCollectionFieldEntriesFieldTypeField(val throw "".concat("Invalid value: ", val) as string; } export function serializeTrashFilePathCollectionFieldEntriesField(val: TrashFilePathCollectionFieldEntriesField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeTrashFilePathCollectionFieldEntriesFieldTypeField(val.type), ["id"]: val.id, ["sequence_id"]: val.sequenceId, ["etag"]: val.etag, ["name"]: val.name }; + return { ["type"]: val.type == void 0 ? void 0 : serializeTrashFilePathCollectionFieldEntriesFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id, ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeTrashFilePathCollectionFieldEntriesField(val: any): TrashFilePathCollectionFieldEntriesField { const type: undefined | TrashFilePathCollectionFieldEntriesFieldTypeField = val.type == void 0 ? void 0 : deserializeTrashFilePathCollectionFieldEntriesFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { type: type, id: id, sequenceId: sequenceId, etag: etag, name: name } satisfies TrashFilePathCollectionFieldEntriesField; } export function serializeTrashFilePathCollectionField(val: TrashFilePathCollectionField): Json { @@ -5762,9 +5768,9 @@ export function serializeTrashFilePathCollectionField(val: TrashFilePathCollecti } export function deserializeTrashFilePathCollectionField(val: any): TrashFilePathCollectionField { const totalCount: number = val.total_count; - const entries: readonly TrashFilePathCollectionFieldEntriesField[] = val.entries.map(function (itm: Json): any { + const entries: readonly TrashFilePathCollectionFieldEntriesField[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTrashFilePathCollectionFieldEntriesField(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TrashFilePathCollectionField; } export function serializeTrashFileItemStatusField(val: TrashFileItemStatusField): Json { @@ -5786,14 +5792,14 @@ export function deserializeTrashFileItemStatusField(val: any): TrashFileItemStat throw "".concat("Invalid value: ", val) as string; } export function serializeTrashFile(val: TrashFile): Json { - return { ["id"]: val.id, ["etag"]: val.etag, ["type"]: serializeTrashFileTypeField(val.type), ["sequence_id"]: val.sequenceId, ["name"]: val.name, ["sha1"]: val.sha1, ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion), ["description"]: val.description, ["size"]: val.size, ["path_collection"]: serializeTrashFilePathCollectionField(val.pathCollection), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["content_created_at"]: val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: serializeUserMini(val.modifiedBy), ["owned_by"]: serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: serializeTrashFileItemStatusField(val.itemStatus) }; + return { ["id"]: val.id, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["type"]: serializeTrashFileTypeField(val.type), ["sequence_id"]: val.sequenceId, ["name"]: val.name == void 0 ? void 0 : val.name, ["sha1"]: val.sha1, ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion), ["description"]: val.description, ["size"]: val.size, ["path_collection"]: serializeTrashFilePathCollectionField(val.pathCollection), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["content_created_at"]: val.contentCreatedAt == void 0 ? void 0 : val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt == void 0 ? void 0 : val.contentModifiedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: serializeUserMini(val.modifiedBy), ["owned_by"]: serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : val.sharedLink, ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: serializeTrashFileItemStatusField(val.itemStatus) }; } export function deserializeTrashFile(val: any): TrashFile { const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: TrashFileTypeField = deserializeTrashFileTypeField(val.type); const sequenceId: string = val.sequence_id; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const sha1: string = val.sha1; const fileVersion: undefined | FileVersionMini = val.file_version == void 0 ? void 0 : deserializeFileVersionMini(val.file_version); const description: string = val.description; @@ -5801,14 +5807,14 @@ export function deserializeTrashFile(val: any): TrashFile { const pathCollection: TrashFilePathCollectionField = deserializeTrashFilePathCollectionField(val.path_collection); const createdAt: string = val.created_at; const modifiedAt: string = val.modified_at; - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: UserMini = deserializeUserMini(val.modified_by); const ownedBy: UserMini = deserializeUserMini(val.owned_by); - const sharedLink: undefined | string = isJson(val.shared_link, "string") ? val.shared_link : void 0; + const sharedLink: undefined | string = val.shared_link == void 0 ? void 0 : val.shared_link; const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); const itemStatus: TrashFileItemStatusField = deserializeTrashFileItemStatusField(val.item_status); return { id: id, etag: etag, type: type, sequenceId: sequenceId, name: name, sha1: sha1, fileVersion: fileVersion, description: description, size: size, pathCollection: pathCollection, createdAt: createdAt, modifiedAt: modifiedAt, trashedAt: trashedAt, purgedAt: purgedAt, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt, createdBy: createdBy, modifiedBy: modifiedBy, ownedBy: ownedBy, sharedLink: sharedLink, parent: parent, itemStatus: itemStatus } satisfies TrashFile; @@ -5826,28 +5832,28 @@ export function deserializeTermsOfServiceUserStatusTypeField(val: any): TermsOfS throw "".concat("Invalid value: ", val) as string; } export function serializeTermsOfServiceUserStatus(val: TermsOfServiceUserStatus): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeTermsOfServiceUserStatusTypeField(val.type), ["tos"]: val.tos == void 0 ? void 0 : serializeTermsOfServiceBase(val.tos), ["user"]: val.user == void 0 ? void 0 : serializeUserMini(val.user), ["is_accepted"]: val.isAccepted, ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeTermsOfServiceUserStatusTypeField(val.type), ["tos"]: val.tos == void 0 ? void 0 : serializeTermsOfServiceBase(val.tos), ["user"]: val.user == void 0 ? void 0 : serializeUserMini(val.user), ["is_accepted"]: val.isAccepted == void 0 ? void 0 : val.isAccepted, ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt }; } export function deserializeTermsOfServiceUserStatus(val: any): TermsOfServiceUserStatus { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | TermsOfServiceUserStatusTypeField = val.type == void 0 ? void 0 : deserializeTermsOfServiceUserStatusTypeField(val.type); const tos: undefined | TermsOfServiceBase = val.tos == void 0 ? void 0 : deserializeTermsOfServiceBase(val.tos); const user: undefined | UserMini = val.user == void 0 ? void 0 : deserializeUserMini(val.user); - const isAccepted: undefined | boolean = isJson(val.is_accepted, "boolean") ? val.is_accepted : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const isAccepted: undefined | boolean = val.is_accepted == void 0 ? void 0 : val.is_accepted; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; return { id: id, type: type, tos: tos, user: user, isAccepted: isAccepted, createdAt: createdAt, modifiedAt: modifiedAt } satisfies TermsOfServiceUserStatus; } export function serializeTermsOfServiceUserStatuses(val: TermsOfServiceUserStatuses): Json { - return { ["total_count"]: val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: TermsOfServiceUserStatus): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: TermsOfServiceUserStatus): any { return serializeTermsOfServiceUserStatus(item); }) as readonly any[] }; } export function deserializeTermsOfServiceUserStatuses(val: any): TermsOfServiceUserStatuses { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const entries: undefined | readonly TermsOfServiceUserStatus[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const entries: undefined | readonly TermsOfServiceUserStatus[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTermsOfServiceUserStatus(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TermsOfServiceUserStatuses; } export function serializeTaskAssignmentTypeField(val: TaskAssignmentTypeField): Json { @@ -5884,31 +5890,31 @@ export function deserializeTaskAssignmentResolutionStateField(val: any): TaskAss throw "".concat("Invalid value: ", val) as string; } export function serializeTaskAssignment(val: TaskAssignment): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeTaskAssignmentTypeField(val.type), ["item"]: val.item == void 0 ? void 0 : serializeFileMini(val.item), ["assigned_to"]: val.assignedTo == void 0 ? void 0 : serializeUserMini(val.assignedTo), ["message"]: val.message, ["completed_at"]: val.completedAt, ["assigned_at"]: val.assignedAt, ["reminded_at"]: val.remindedAt, ["resolution_state"]: val.resolutionState == void 0 ? void 0 : serializeTaskAssignmentResolutionStateField(val.resolutionState), ["assigned_by"]: val.assignedBy == void 0 ? void 0 : serializeUserMini(val.assignedBy) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeTaskAssignmentTypeField(val.type), ["item"]: val.item == void 0 ? void 0 : serializeFileMini(val.item), ["assigned_to"]: val.assignedTo == void 0 ? void 0 : serializeUserMini(val.assignedTo), ["message"]: val.message == void 0 ? void 0 : val.message, ["completed_at"]: val.completedAt == void 0 ? void 0 : val.completedAt, ["assigned_at"]: val.assignedAt == void 0 ? void 0 : val.assignedAt, ["reminded_at"]: val.remindedAt == void 0 ? void 0 : val.remindedAt, ["resolution_state"]: val.resolutionState == void 0 ? void 0 : serializeTaskAssignmentResolutionStateField(val.resolutionState), ["assigned_by"]: val.assignedBy == void 0 ? void 0 : serializeUserMini(val.assignedBy) }; } export function deserializeTaskAssignment(val: any): TaskAssignment { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | TaskAssignmentTypeField = val.type == void 0 ? void 0 : deserializeTaskAssignmentTypeField(val.type); const item: undefined | FileMini = val.item == void 0 ? void 0 : deserializeFileMini(val.item); const assignedTo: undefined | UserMini = val.assigned_to == void 0 ? void 0 : deserializeUserMini(val.assigned_to); - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; - const completedAt: undefined | string = isJson(val.completed_at, "string") ? val.completed_at : void 0; - const assignedAt: undefined | string = isJson(val.assigned_at, "string") ? val.assigned_at : void 0; - const remindedAt: undefined | string = isJson(val.reminded_at, "string") ? val.reminded_at : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; + const completedAt: undefined | string = val.completed_at == void 0 ? void 0 : val.completed_at; + const assignedAt: undefined | string = val.assigned_at == void 0 ? void 0 : val.assigned_at; + const remindedAt: undefined | string = val.reminded_at == void 0 ? void 0 : val.reminded_at; const resolutionState: undefined | TaskAssignmentResolutionStateField = val.resolution_state == void 0 ? void 0 : deserializeTaskAssignmentResolutionStateField(val.resolution_state); const assignedBy: undefined | UserMini = val.assigned_by == void 0 ? void 0 : deserializeUserMini(val.assigned_by); return { id: id, type: type, item: item, assignedTo: assignedTo, message: message, completedAt: completedAt, assignedAt: assignedAt, remindedAt: remindedAt, resolutionState: resolutionState, assignedBy: assignedBy } satisfies TaskAssignment; } export function serializeTaskAssignments(val: TaskAssignments): Json { - return { ["total_count"]: val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: TaskAssignment): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: TaskAssignment): any { return serializeTaskAssignment(item); }) as readonly any[] }; } export function deserializeTaskAssignments(val: any): TaskAssignments { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const entries: undefined | readonly TaskAssignment[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const entries: undefined | readonly TaskAssignment[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTaskAssignment(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies TaskAssignments; } export function serializeTaskTypeField(val: TaskTypeField): Json { @@ -5954,32 +5960,32 @@ export function deserializeTaskCompletionRuleField(val: any): TaskCompletionRule throw "".concat("Invalid value: ", val) as string; } export function serializeTask(val: Task): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeTaskTypeField(val.type), ["item"]: val.item == void 0 ? void 0 : serializeFileMini(val.item), ["due_at"]: val.dueAt, ["action"]: val.action == void 0 ? void 0 : serializeTaskActionField(val.action), ["message"]: val.message, ["task_assignment_collection"]: val.taskAssignmentCollection == void 0 ? void 0 : serializeTaskAssignments(val.taskAssignmentCollection), ["is_completed"]: val.isCompleted, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["completion_rule"]: val.completionRule == void 0 ? void 0 : serializeTaskCompletionRuleField(val.completionRule) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeTaskTypeField(val.type), ["item"]: val.item == void 0 ? void 0 : serializeFileMini(val.item), ["due_at"]: val.dueAt == void 0 ? void 0 : val.dueAt, ["action"]: val.action == void 0 ? void 0 : serializeTaskActionField(val.action), ["message"]: val.message == void 0 ? void 0 : val.message, ["task_assignment_collection"]: val.taskAssignmentCollection == void 0 ? void 0 : serializeTaskAssignments(val.taskAssignmentCollection), ["is_completed"]: val.isCompleted == void 0 ? void 0 : val.isCompleted, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["completion_rule"]: val.completionRule == void 0 ? void 0 : serializeTaskCompletionRuleField(val.completionRule) }; } export function deserializeTask(val: any): Task { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | TaskTypeField = val.type == void 0 ? void 0 : deserializeTaskTypeField(val.type); const item: undefined | FileMini = val.item == void 0 ? void 0 : deserializeFileMini(val.item); - const dueAt: undefined | string = isJson(val.due_at, "string") ? val.due_at : void 0; + const dueAt: undefined | string = val.due_at == void 0 ? void 0 : val.due_at; const action: undefined | TaskActionField = val.action == void 0 ? void 0 : deserializeTaskActionField(val.action); - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; const taskAssignmentCollection: undefined | TaskAssignments = val.task_assignment_collection == void 0 ? void 0 : deserializeTaskAssignments(val.task_assignment_collection); - const isCompleted: undefined | boolean = isJson(val.is_completed, "boolean") ? val.is_completed : void 0; + const isCompleted: undefined | boolean = val.is_completed == void 0 ? void 0 : val.is_completed; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const completionRule: undefined | TaskCompletionRuleField = val.completion_rule == void 0 ? void 0 : deserializeTaskCompletionRuleField(val.completion_rule); return { id: id, type: type, item: item, dueAt: dueAt, action: action, message: message, taskAssignmentCollection: taskAssignmentCollection, isCompleted: isCompleted, createdBy: createdBy, createdAt: createdAt, completionRule: completionRule } satisfies Task; } export function serializeTasks(val: Tasks): Json { - return { ["total_count"]: val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Task): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Task): any { return serializeTask(item); }) as readonly any[] }; } export function deserializeTasks(val: any): Tasks { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const entries: undefined | readonly Task[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const entries: undefined | readonly Task[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTask(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies Tasks; } export function serializeRetentionPolicyAssignmentTypeField(val: RetentionPolicyAssignmentTypeField): Json { @@ -6013,37 +6019,37 @@ export function deserializeRetentionPolicyAssignmentAssignedToFieldTypeField(val throw "".concat("Invalid value: ", val) as string; } export function serializeRetentionPolicyAssignmentAssignedToField(val: RetentionPolicyAssignmentAssignedToField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeRetentionPolicyAssignmentAssignedToFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeRetentionPolicyAssignmentAssignedToFieldTypeField(val.type) }; } export function deserializeRetentionPolicyAssignmentAssignedToField(val: any): RetentionPolicyAssignmentAssignedToField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | RetentionPolicyAssignmentAssignedToFieldTypeField = val.type == void 0 ? void 0 : deserializeRetentionPolicyAssignmentAssignedToFieldTypeField(val.type); return { id: id, type: type } satisfies RetentionPolicyAssignmentAssignedToField; } export function serializeRetentionPolicyAssignmentFilterFieldsField(val: RetentionPolicyAssignmentFilterFieldsField): Json { - return { ["field"]: val.field, ["value"]: val.value }; + return { ["field"]: val.field == void 0 ? void 0 : val.field, ["value"]: val.value == void 0 ? void 0 : val.value }; } export function deserializeRetentionPolicyAssignmentFilterFieldsField(val: any): RetentionPolicyAssignmentFilterFieldsField { - const field: undefined | string = isJson(val.field, "string") ? val.field : void 0; - const value: undefined | string = isJson(val.value, "string") ? val.value : void 0; + const field: undefined | string = val.field == void 0 ? void 0 : val.field; + const value: undefined | string = val.value == void 0 ? void 0 : val.value; return { field: field, value: value } satisfies RetentionPolicyAssignmentFilterFieldsField; } export function serializeRetentionPolicyAssignment(val: RetentionPolicyAssignment): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeRetentionPolicyAssignmentTypeField(val.type), ["retention_policy"]: val.retentionPolicy == void 0 ? void 0 : serializeRetentionPolicyMini(val.retentionPolicy), ["assigned_to"]: val.assignedTo == void 0 ? void 0 : serializeRetentionPolicyAssignmentAssignedToField(val.assignedTo), ["filter_fields"]: val.filterFields == void 0 ? void 0 : val.filterFields.map(function (item: RetentionPolicyAssignmentFilterFieldsField): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeRetentionPolicyAssignmentTypeField(val.type), ["retention_policy"]: val.retentionPolicy == void 0 ? void 0 : serializeRetentionPolicyMini(val.retentionPolicy), ["assigned_to"]: val.assignedTo == void 0 ? void 0 : serializeRetentionPolicyAssignmentAssignedToField(val.assignedTo), ["filter_fields"]: val.filterFields == void 0 ? void 0 : val.filterFields.map(function (item: RetentionPolicyAssignmentFilterFieldsField): any { return serializeRetentionPolicyAssignmentFilterFieldsField(item); - }) as readonly any[], ["assigned_by"]: val.assignedBy == void 0 ? void 0 : serializeUserMini(val.assignedBy), ["assigned_at"]: val.assignedAt, ["start_date_field"]: val.startDateField }; + }) as readonly any[], ["assigned_by"]: val.assignedBy == void 0 ? void 0 : serializeUserMini(val.assignedBy), ["assigned_at"]: val.assignedAt == void 0 ? void 0 : val.assignedAt, ["start_date_field"]: val.startDateField == void 0 ? void 0 : val.startDateField }; } export function deserializeRetentionPolicyAssignment(val: any): RetentionPolicyAssignment { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | RetentionPolicyAssignmentTypeField = val.type == void 0 ? void 0 : deserializeRetentionPolicyAssignmentTypeField(val.type); const retentionPolicy: undefined | RetentionPolicyMini = val.retention_policy == void 0 ? void 0 : deserializeRetentionPolicyMini(val.retention_policy); const assignedTo: undefined | RetentionPolicyAssignmentAssignedToField = val.assigned_to == void 0 ? void 0 : deserializeRetentionPolicyAssignmentAssignedToField(val.assigned_to); - const filterFields: undefined | readonly RetentionPolicyAssignmentFilterFieldsField[] = isJson(val.filter_fields, "array") ? val.filter_fields.map(function (itm: Json): any { + const filterFields: undefined | readonly RetentionPolicyAssignmentFilterFieldsField[] = val.filter_fields == void 0 ? void 0 : isJson(val.filter_fields, "array") ? val.filter_fields.map(function (itm: Json): any { return deserializeRetentionPolicyAssignmentFilterFieldsField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; const assignedBy: undefined | UserMini = val.assigned_by == void 0 ? void 0 : deserializeUserMini(val.assigned_by); - const assignedAt: undefined | string = isJson(val.assigned_at, "string") ? val.assigned_at : void 0; - const startDateField: undefined | string = isJson(val.start_date_field, "string") ? val.start_date_field : void 0; + const assignedAt: undefined | string = val.assigned_at == void 0 ? void 0 : val.assigned_at; + const startDateField: undefined | string = val.start_date_field == void 0 ? void 0 : val.start_date_field; return { id: id, type: type, retentionPolicy: retentionPolicy, assignedTo: assignedTo, filterFields: filterFields, assignedBy: assignedBy, assignedAt: assignedAt, startDateField: startDateField } satisfies RetentionPolicyAssignment; } export function serializeRetentionPolicyPolicyTypeField(val: RetentionPolicyPolicyTypeField): Json { @@ -6092,12 +6098,12 @@ export function deserializeRetentionPolicyStatusField(val: any): RetentionPolicy throw "".concat("Invalid value: ", val) as string; } export function serializeRetentionPolicyAssignmentCountsField(val: RetentionPolicyAssignmentCountsField): Json { - return { ["enterprise"]: val.enterprise, ["folder"]: val.folder, ["metadata_template"]: val.metadataTemplate }; + return { ["enterprise"]: val.enterprise == void 0 ? void 0 : val.enterprise, ["folder"]: val.folder == void 0 ? void 0 : val.folder, ["metadata_template"]: val.metadataTemplate == void 0 ? void 0 : val.metadataTemplate }; } export function deserializeRetentionPolicyAssignmentCountsField(val: any): RetentionPolicyAssignmentCountsField { - const enterprise: undefined | number = isJson(val.enterprise, "number") ? val.enterprise : void 0; - const folder: undefined | number = isJson(val.folder, "number") ? val.folder : void 0; - const metadataTemplate: undefined | number = isJson(val.metadata_template, "number") ? val.metadata_template : void 0; + const enterprise: undefined | number = val.enterprise == void 0 ? void 0 : val.enterprise; + const folder: undefined | number = val.folder == void 0 ? void 0 : val.folder; + const metadataTemplate: undefined | number = val.metadata_template == void 0 ? void 0 : val.metadata_template; return { enterprise: enterprise, folder: folder, metadataTemplate: metadataTemplate } satisfies RetentionPolicyAssignmentCountsField; } export function serializeRetentionPolicy(val: RetentionPolicy): Json { @@ -6105,26 +6111,26 @@ export function serializeRetentionPolicy(val: RetentionPolicy): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"RetentionPolicy\""; } - return { ...base, ...{ ["description"]: val.description, ["policy_type"]: val.policyType == void 0 ? void 0 : serializeRetentionPolicyPolicyTypeField(val.policyType), ["retention_type"]: val.retentionType == void 0 ? void 0 : serializeRetentionPolicyRetentionTypeField(val.retentionType), ["status"]: val.status == void 0 ? void 0 : serializeRetentionPolicyStatusField(val.status), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["can_owner_extend_retention"]: val.canOwnerExtendRetention, ["are_owners_notified"]: val.areOwnersNotified, ["custom_notification_recipients"]: val.customNotificationRecipients == void 0 ? void 0 : val.customNotificationRecipients.map(function (item: UserMini): any { + return { ...base, ...{ ["description"]: val.description == void 0 ? void 0 : val.description, ["policy_type"]: val.policyType == void 0 ? void 0 : serializeRetentionPolicyPolicyTypeField(val.policyType), ["retention_type"]: val.retentionType == void 0 ? void 0 : serializeRetentionPolicyRetentionTypeField(val.retentionType), ["status"]: val.status == void 0 ? void 0 : serializeRetentionPolicyStatusField(val.status), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["can_owner_extend_retention"]: val.canOwnerExtendRetention == void 0 ? void 0 : val.canOwnerExtendRetention, ["are_owners_notified"]: val.areOwnersNotified == void 0 ? void 0 : val.areOwnersNotified, ["custom_notification_recipients"]: val.customNotificationRecipients == void 0 ? void 0 : val.customNotificationRecipients.map(function (item: UserMini): any { return serializeUserMini(item); }) as readonly any[], ["assignment_counts"]: val.assignmentCounts == void 0 ? void 0 : serializeRetentionPolicyAssignmentCountsField(val.assignmentCounts) } }; } export function deserializeRetentionPolicy(val: any): RetentionPolicy { - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const policyType: undefined | RetentionPolicyPolicyTypeField = val.policy_type == void 0 ? void 0 : deserializeRetentionPolicyPolicyTypeField(val.policy_type); const retentionType: undefined | RetentionPolicyRetentionTypeField = val.retention_type == void 0 ? void 0 : deserializeRetentionPolicyRetentionTypeField(val.retention_type); const status: undefined | RetentionPolicyStatusField = val.status == void 0 ? void 0 : deserializeRetentionPolicyStatusField(val.status); const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const canOwnerExtendRetention: undefined | boolean = isJson(val.can_owner_extend_retention, "boolean") ? val.can_owner_extend_retention : void 0; - const areOwnersNotified: undefined | boolean = isJson(val.are_owners_notified, "boolean") ? val.are_owners_notified : void 0; - const customNotificationRecipients: undefined | readonly UserMini[] = isJson(val.custom_notification_recipients, "array") ? val.custom_notification_recipients.map(function (itm: Json): any { + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const canOwnerExtendRetention: undefined | boolean = val.can_owner_extend_retention == void 0 ? void 0 : val.can_owner_extend_retention; + const areOwnersNotified: undefined | boolean = val.are_owners_notified == void 0 ? void 0 : val.are_owners_notified; + const customNotificationRecipients: undefined | readonly UserMini[] = val.custom_notification_recipients == void 0 ? void 0 : isJson(val.custom_notification_recipients, "array") ? val.custom_notification_recipients.map(function (itm: Json): any { return deserializeUserMini(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; const assignmentCounts: undefined | RetentionPolicyAssignmentCountsField = val.assignment_counts == void 0 ? void 0 : deserializeRetentionPolicyAssignmentCountsField(val.assignment_counts); - const policyName: undefined | string = isJson(val.policy_name, "string") ? val.policy_name : void 0; - const retentionLength: undefined | string = isJson(val.retention_length, "string") ? val.retention_length : void 0; + const policyName: undefined | string = val.policy_name == void 0 ? void 0 : val.policy_name; + const retentionLength: undefined | string = val.retention_length == void 0 ? void 0 : val.retention_length; const dispositionAction: undefined | RetentionPolicyMiniDispositionActionField = val.disposition_action == void 0 ? void 0 : deserializeRetentionPolicyMiniDispositionActionField(val.disposition_action); const id: string = val.id; const type: RetentionPolicyBaseTypeField = deserializeRetentionPolicyBaseTypeField(val.type); @@ -6152,13 +6158,13 @@ export function deserializeLegalHoldPolicyStatusField(val: any): LegalHoldPolicy throw "".concat("Invalid value: ", val) as string; } export function serializeLegalHoldPolicyAssignmentCountsField(val: LegalHoldPolicyAssignmentCountsField): Json { - return { ["user"]: val.user, ["folder"]: val.folder, ["file"]: val.file, ["file_version"]: val.fileVersion }; + return { ["user"]: val.user == void 0 ? void 0 : val.user, ["folder"]: val.folder == void 0 ? void 0 : val.folder, ["file"]: val.file == void 0 ? void 0 : val.file, ["file_version"]: val.fileVersion == void 0 ? void 0 : val.fileVersion }; } export function deserializeLegalHoldPolicyAssignmentCountsField(val: any): LegalHoldPolicyAssignmentCountsField { - const user: undefined | number = isJson(val.user, "number") ? val.user : void 0; - const folder: undefined | number = isJson(val.folder, "number") ? val.folder : void 0; - const file: undefined | number = isJson(val.file, "number") ? val.file : void 0; - const fileVersion: undefined | number = isJson(val.file_version, "number") ? val.file_version : void 0; + const user: undefined | number = val.user == void 0 ? void 0 : val.user; + const folder: undefined | number = val.folder == void 0 ? void 0 : val.folder; + const file: undefined | number = val.file == void 0 ? void 0 : val.file; + const fileVersion: undefined | number = val.file_version == void 0 ? void 0 : val.file_version; return { user: user, folder: folder, file: file, fileVersion: fileVersion } satisfies LegalHoldPolicyAssignmentCountsField; } export function serializeLegalHoldPolicy(val: LegalHoldPolicy): Json { @@ -6166,36 +6172,36 @@ export function serializeLegalHoldPolicy(val: LegalHoldPolicy): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"LegalHoldPolicy\""; } - return { ...base, ...{ ["policy_name"]: val.policyName, ["description"]: val.description, ["status"]: val.status == void 0 ? void 0 : serializeLegalHoldPolicyStatusField(val.status), ["assignment_counts"]: val.assignmentCounts == void 0 ? void 0 : serializeLegalHoldPolicyAssignmentCountsField(val.assignmentCounts), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["deleted_at"]: val.deletedAt, ["filter_started_at"]: val.filterStartedAt, ["filter_ended_at"]: val.filterEndedAt, ["release_notes"]: val.releaseNotes } }; + return { ...base, ...{ ["policy_name"]: val.policyName == void 0 ? void 0 : val.policyName, ["description"]: val.description == void 0 ? void 0 : val.description, ["status"]: val.status == void 0 ? void 0 : serializeLegalHoldPolicyStatusField(val.status), ["assignment_counts"]: val.assignmentCounts == void 0 ? void 0 : serializeLegalHoldPolicyAssignmentCountsField(val.assignmentCounts), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["deleted_at"]: val.deletedAt == void 0 ? void 0 : val.deletedAt, ["filter_started_at"]: val.filterStartedAt == void 0 ? void 0 : val.filterStartedAt, ["filter_ended_at"]: val.filterEndedAt == void 0 ? void 0 : val.filterEndedAt, ["release_notes"]: val.releaseNotes == void 0 ? void 0 : val.releaseNotes } }; } export function deserializeLegalHoldPolicy(val: any): LegalHoldPolicy { - const policyName: undefined | string = isJson(val.policy_name, "string") ? val.policy_name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const policyName: undefined | string = val.policy_name == void 0 ? void 0 : val.policy_name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const status: undefined | LegalHoldPolicyStatusField = val.status == void 0 ? void 0 : deserializeLegalHoldPolicyStatusField(val.status); const assignmentCounts: undefined | LegalHoldPolicyAssignmentCountsField = val.assignment_counts == void 0 ? void 0 : deserializeLegalHoldPolicyAssignmentCountsField(val.assignment_counts); const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const deletedAt: undefined | string = isJson(val.deleted_at, "string") ? val.deleted_at : void 0; - const filterStartedAt: undefined | string = isJson(val.filter_started_at, "string") ? val.filter_started_at : void 0; - const filterEndedAt: undefined | string = isJson(val.filter_ended_at, "string") ? val.filter_ended_at : void 0; - const releaseNotes: undefined | string = isJson(val.release_notes, "string") ? val.release_notes : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const deletedAt: undefined | string = val.deleted_at == void 0 ? void 0 : val.deleted_at; + const filterStartedAt: undefined | string = val.filter_started_at == void 0 ? void 0 : val.filter_started_at; + const filterEndedAt: undefined | string = val.filter_ended_at == void 0 ? void 0 : val.filter_ended_at; + const releaseNotes: undefined | string = val.release_notes == void 0 ? void 0 : val.release_notes; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | LegalHoldPolicyMiniTypeField = val.type == void 0 ? void 0 : deserializeLegalHoldPolicyMiniTypeField(val.type); return { policyName: policyName, description: description, status: status, assignmentCounts: assignmentCounts, createdBy: createdBy, createdAt: createdAt, modifiedAt: modifiedAt, deletedAt: deletedAt, filterStartedAt: filterStartedAt, filterEndedAt: filterEndedAt, releaseNotes: releaseNotes, id: id, type: type } satisfies LegalHoldPolicy; } export function serializeLegalHoldPolicies(val: LegalHoldPolicies): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: LegalHoldPolicy): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: LegalHoldPolicy): any { return serializeLegalHoldPolicy(item); }) as readonly any[] }; } export function deserializeLegalHoldPolicies(val: any): LegalHoldPolicies { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly LegalHoldPolicy[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly LegalHoldPolicy[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeLegalHoldPolicy(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies LegalHoldPolicies; } export function serializeInviteTypeField(val: InviteTypeField): Json { @@ -6223,26 +6229,26 @@ export function deserializeInviteInvitedToFieldTypeField(val: any): InviteInvite throw "".concat("Invalid value: ", val) as string; } export function serializeInviteInvitedToField(val: InviteInvitedToField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeInviteInvitedToFieldTypeField(val.type), ["name"]: val.name }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeInviteInvitedToFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeInviteInvitedToField(val: any): InviteInvitedToField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | InviteInvitedToFieldTypeField = val.type == void 0 ? void 0 : deserializeInviteInvitedToFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { id: id, type: type, name: name } satisfies InviteInvitedToField; } export function serializeInvite(val: Invite): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeInviteTypeField(val.type), ["invited_to"]: val.invitedTo == void 0 ? void 0 : serializeInviteInvitedToField(val.invitedTo), ["actionable_by"]: val.actionableBy == void 0 ? void 0 : serializeUserMini(val.actionableBy), ["invited_by"]: val.invitedBy == void 0 ? void 0 : serializeUserMini(val.invitedBy), ["status"]: val.status, ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeInviteTypeField(val.type), ["invited_to"]: val.invitedTo == void 0 ? void 0 : serializeInviteInvitedToField(val.invitedTo), ["actionable_by"]: val.actionableBy == void 0 ? void 0 : serializeUserMini(val.actionableBy), ["invited_by"]: val.invitedBy == void 0 ? void 0 : serializeUserMini(val.invitedBy), ["status"]: val.status == void 0 ? void 0 : val.status, ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt }; } export function deserializeInvite(val: any): Invite { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | InviteTypeField = val.type == void 0 ? void 0 : deserializeInviteTypeField(val.type); const invitedTo: undefined | InviteInvitedToField = val.invited_to == void 0 ? void 0 : deserializeInviteInvitedToField(val.invited_to); const actionableBy: undefined | UserMini = val.actionable_by == void 0 ? void 0 : deserializeUserMini(val.actionable_by); const invitedBy: undefined | UserMini = val.invited_by == void 0 ? void 0 : deserializeUserMini(val.invited_by); - const status: undefined | string = isJson(val.status, "string") ? val.status : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const status: undefined | string = val.status == void 0 ? void 0 : val.status; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; return { id: id, type: type, invitedTo: invitedTo, actionableBy: actionableBy, invitedBy: invitedBy, status: status, createdAt: createdAt, modifiedAt: modifiedAt } satisfies Invite; } export function serializeGroupMembershipTypeField(val: GroupMembershipTypeField): Json { @@ -6273,16 +6279,16 @@ export function deserializeGroupMembershipRoleField(val: any): GroupMembershipRo throw "".concat("Invalid value: ", val) as string; } export function serializeGroupMembership(val: GroupMembership): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeGroupMembershipTypeField(val.type), ["user"]: val.user == void 0 ? void 0 : serializeUserMini(val.user), ["group"]: val.group == void 0 ? void 0 : serializeGroupMini(val.group), ["role"]: val.role == void 0 ? void 0 : serializeGroupMembershipRoleField(val.role), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeGroupMembershipTypeField(val.type), ["user"]: val.user == void 0 ? void 0 : serializeUserMini(val.user), ["group"]: val.group == void 0 ? void 0 : serializeGroupMini(val.group), ["role"]: val.role == void 0 ? void 0 : serializeGroupMembershipRoleField(val.role), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt }; } export function deserializeGroupMembership(val: any): GroupMembership { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | GroupMembershipTypeField = val.type == void 0 ? void 0 : deserializeGroupMembershipTypeField(val.type); const user: undefined | UserMini = val.user == void 0 ? void 0 : deserializeUserMini(val.user); const group: undefined | GroupMini = val.group == void 0 ? void 0 : deserializeGroupMini(val.group); const role: undefined | GroupMembershipRoleField = val.role == void 0 ? void 0 : deserializeGroupMembershipRoleField(val.role); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; return { id: id, type: type, user: user, group: group, role: role, createdAt: createdAt, modifiedAt: modifiedAt } satisfies GroupMembership; } export function serializeGroupMembershipsOrderFieldDirectionField(val: GroupMembershipsOrderFieldDirectionField): Json { @@ -6301,30 +6307,30 @@ export function deserializeGroupMembershipsOrderFieldDirectionField(val: any): G throw "".concat("Invalid value: ", val) as string; } export function serializeGroupMembershipsOrderField(val: GroupMembershipsOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeGroupMembershipsOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeGroupMembershipsOrderFieldDirectionField(val.direction) }; } export function deserializeGroupMembershipsOrderField(val: any): GroupMembershipsOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | GroupMembershipsOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeGroupMembershipsOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies GroupMembershipsOrderField; } export function serializeGroupMemberships(val: GroupMemberships): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: GroupMembershipsOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: GroupMembershipsOrderField): any { return serializeGroupMembershipsOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: GroupMembership): any { return serializeGroupMembership(item); }) as readonly any[] }; } export function deserializeGroupMemberships(val: any): GroupMemberships { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly GroupMembershipsOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly GroupMembershipsOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeGroupMembershipsOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly GroupMembership[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly GroupMembership[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeGroupMembership(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies GroupMemberships; } export function serializeFileVersion(val: FileVersion): Json { @@ -6332,21 +6338,21 @@ export function serializeFileVersion(val: FileVersion): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"FileVersion\""; } - return { ...base, ...{ ["name"]: val.name, ["size"]: val.size, ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["trashed_at"]: val.trashedAt, ["trashed_by"]: val.trashedBy == void 0 ? void 0 : serializeUserMini(val.trashedBy), ["restored_at"]: val.restoredAt, ["restored_by"]: val.restoredBy == void 0 ? void 0 : serializeUserMini(val.restoredBy), ["purged_at"]: val.purgedAt, ["uploader_display_name"]: val.uploaderDisplayName } }; + return { ...base, ...{ ["name"]: val.name == void 0 ? void 0 : val.name, ["size"]: val.size == void 0 ? void 0 : val.size, ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["trashed_by"]: val.trashedBy == void 0 ? void 0 : serializeUserMini(val.trashedBy), ["restored_at"]: val.restoredAt == void 0 ? void 0 : val.restoredAt, ["restored_by"]: val.restoredBy == void 0 ? void 0 : serializeUserMini(val.restoredBy), ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["uploader_display_name"]: val.uploaderDisplayName == void 0 ? void 0 : val.uploaderDisplayName } }; } export function deserializeFileVersion(val: any): FileVersion { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; const trashedBy: undefined | UserMini = val.trashed_by == void 0 ? void 0 : deserializeUserMini(val.trashed_by); - const restoredAt: undefined | string = isJson(val.restored_at, "string") ? val.restored_at : void 0; + const restoredAt: undefined | string = val.restored_at == void 0 ? void 0 : val.restored_at; const restoredBy: undefined | UserMini = val.restored_by == void 0 ? void 0 : deserializeUserMini(val.restored_by); - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const uploaderDisplayName: undefined | string = isJson(val.uploader_display_name, "string") ? val.uploader_display_name : void 0; - const sha1: undefined | string = isJson(val.sha1, "string") ? val.sha1 : void 0; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const uploaderDisplayName: undefined | string = val.uploader_display_name == void 0 ? void 0 : val.uploader_display_name; + const sha1: undefined | string = val.sha1 == void 0 ? void 0 : val.sha1; const id: string = val.id; const type: FileVersionBaseTypeField = deserializeFileVersionBaseTypeField(val.type); return { name: name, size: size, createdAt: createdAt, modifiedAt: modifiedAt, modifiedBy: modifiedBy, trashedAt: trashedAt, trashedBy: trashedBy, restoredAt: restoredAt, restoredBy: restoredBy, purgedAt: purgedAt, uploaderDisplayName: uploaderDisplayName, sha1: sha1, id: id, type: type } satisfies FileVersion; @@ -6367,30 +6373,30 @@ export function deserializeFileVersionsOrderFieldDirectionField(val: any): FileV throw "".concat("Invalid value: ", val) as string; } export function serializeFileVersionsOrderField(val: FileVersionsOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeFileVersionsOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeFileVersionsOrderFieldDirectionField(val.direction) }; } export function deserializeFileVersionsOrderField(val: any): FileVersionsOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | FileVersionsOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeFileVersionsOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies FileVersionsOrderField; } export function serializeFileVersions(val: FileVersions): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: FileVersionsOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: FileVersionsOrderField): any { return serializeFileVersionsOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileVersion): any { return serializeFileVersion(item); }) as readonly any[] }; } export function deserializeFileVersions(val: any): FileVersions { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly FileVersionsOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly FileVersionsOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeFileVersionsOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly FileVersion[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly FileVersion[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFileVersion(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies FileVersions; } export function serializeFileVersionFull(val: FileVersionFull): Json { @@ -6398,22 +6404,22 @@ export function serializeFileVersionFull(val: FileVersionFull): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"FileVersionFull\""; } - return { ...base, ...{ ["version_number"]: val.versionNumber } }; + return { ...base, ...{ ["version_number"]: val.versionNumber == void 0 ? void 0 : val.versionNumber } }; } export function deserializeFileVersionFull(val: any): FileVersionFull { - const versionNumber: undefined | string = isJson(val.version_number, "string") ? val.version_number : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const versionNumber: undefined | string = val.version_number == void 0 ? void 0 : val.version_number; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; const trashedBy: undefined | UserMini = val.trashed_by == void 0 ? void 0 : deserializeUserMini(val.trashed_by); - const restoredAt: undefined | string = isJson(val.restored_at, "string") ? val.restored_at : void 0; + const restoredAt: undefined | string = val.restored_at == void 0 ? void 0 : val.restored_at; const restoredBy: undefined | UserMini = val.restored_by == void 0 ? void 0 : deserializeUserMini(val.restored_by); - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const uploaderDisplayName: undefined | string = isJson(val.uploader_display_name, "string") ? val.uploader_display_name : void 0; - const sha1: undefined | string = isJson(val.sha1, "string") ? val.sha1 : void 0; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const uploaderDisplayName: undefined | string = val.uploader_display_name == void 0 ? void 0 : val.uploader_display_name; + const sha1: undefined | string = val.sha1 == void 0 ? void 0 : val.sha1; const id: string = val.id; const type: FileVersionBaseTypeField = deserializeFileVersionBaseTypeField(val.type); return { versionNumber: versionNumber, name: name, size: size, createdAt: createdAt, modifiedAt: modifiedAt, modifiedBy: modifiedBy, trashedAt: trashedAt, trashedBy: trashedBy, restoredAt: restoredAt, restoredBy: restoredBy, purgedAt: purgedAt, uploaderDisplayName: uploaderDisplayName, sha1: sha1, id: id, type: type } satisfies FileVersionFull; @@ -6446,20 +6452,20 @@ export function deserializeFileRequestStatusField(val: any): FileRequestStatusFi throw "".concat("Invalid value: ", val) as string; } export function serializeFileRequest(val: FileRequest): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeFileRequestTypeField(val.type), ["title"]: val.title, ["description"]: val.description, ["status"]: val.status == void 0 ? void 0 : serializeFileRequestStatusField(val.status), ["is_email_required"]: val.isEmailRequired, ["is_description_required"]: val.isDescriptionRequired, ["expires_at"]: val.expiresAt, ["folder"]: serializeFolderMini(val.folder), ["url"]: val.url, ["etag"]: val.etag, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserMini(val.updatedBy), ["updated_at"]: val.updatedAt }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeFileRequestTypeField(val.type), ["title"]: val.title == void 0 ? void 0 : val.title, ["description"]: val.description == void 0 ? void 0 : val.description, ["status"]: val.status == void 0 ? void 0 : serializeFileRequestStatusField(val.status), ["is_email_required"]: val.isEmailRequired == void 0 ? void 0 : val.isEmailRequired, ["is_description_required"]: val.isDescriptionRequired == void 0 ? void 0 : val.isDescriptionRequired, ["expires_at"]: val.expiresAt == void 0 ? void 0 : val.expiresAt, ["folder"]: serializeFolderMini(val.folder), ["url"]: val.url == void 0 ? void 0 : val.url, ["etag"]: val.etag == void 0 ? void 0 : val.etag, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserMini(val.updatedBy), ["updated_at"]: val.updatedAt }; } export function deserializeFileRequest(val: any): FileRequest { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | FileRequestTypeField = val.type == void 0 ? void 0 : deserializeFileRequestTypeField(val.type); - const title: undefined | string = isJson(val.title, "string") ? val.title : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const title: undefined | string = val.title == void 0 ? void 0 : val.title; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const status: undefined | FileRequestStatusField = val.status == void 0 ? void 0 : deserializeFileRequestStatusField(val.status); - const isEmailRequired: undefined | boolean = isJson(val.is_email_required, "boolean") ? val.is_email_required : void 0; - const isDescriptionRequired: undefined | boolean = isJson(val.is_description_required, "boolean") ? val.is_description_required : void 0; - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; + const isEmailRequired: undefined | boolean = val.is_email_required == void 0 ? void 0 : val.is_email_required; + const isDescriptionRequired: undefined | boolean = val.is_description_required == void 0 ? void 0 : val.is_description_required; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; const folder: FolderMini = deserializeFolderMini(val.folder); - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const createdAt: string = val.created_at; const updatedBy: undefined | UserMini = val.updated_by == void 0 ? void 0 : deserializeUserMini(val.updated_by); @@ -6473,9 +6479,9 @@ export function serializeFilePathCollectionField(val: FilePathCollectionField): } export function deserializeFilePathCollectionField(val: any): FilePathCollectionField { const totalCount: number = val.total_count; - const entries: readonly FolderMini[] = val.entries.map(function (itm: Json): any { + const entries: readonly FolderMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFolderMini(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies FilePathCollectionField; } export function serializeFileSharedLinkFieldAccessField(val: FileSharedLinkFieldAccessField): Json { @@ -6545,17 +6551,17 @@ export function deserializeFileSharedLinkFieldPermissionsField(val: any): FileSh return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies FileSharedLinkFieldPermissionsField; } export function serializeFileSharedLinkField(val: FileSharedLinkField): Json { - return { ["url"]: val.url, ["download_url"]: val.downloadUrl, ["vanity_url"]: val.vanityUrl, ["vanity_name"]: val.vanityName, ["access"]: val.access == void 0 ? void 0 : serializeFileSharedLinkFieldAccessField(val.access), ["effective_access"]: serializeFileSharedLinkFieldEffectiveAccessField(val.effectiveAccess), ["effective_permission"]: serializeFileSharedLinkFieldEffectivePermissionField(val.effectivePermission), ["unshared_at"]: val.unsharedAt, ["is_password_enabled"]: val.isPasswordEnabled, ["permissions"]: val.permissions == void 0 ? void 0 : serializeFileSharedLinkFieldPermissionsField(val.permissions), ["download_count"]: val.downloadCount, ["preview_count"]: val.previewCount }; + return { ["url"]: val.url, ["download_url"]: val.downloadUrl == void 0 ? void 0 : val.downloadUrl, ["vanity_url"]: val.vanityUrl == void 0 ? void 0 : val.vanityUrl, ["vanity_name"]: val.vanityName == void 0 ? void 0 : val.vanityName, ["access"]: val.access == void 0 ? void 0 : serializeFileSharedLinkFieldAccessField(val.access), ["effective_access"]: serializeFileSharedLinkFieldEffectiveAccessField(val.effectiveAccess), ["effective_permission"]: serializeFileSharedLinkFieldEffectivePermissionField(val.effectivePermission), ["unshared_at"]: val.unsharedAt == void 0 ? void 0 : val.unsharedAt, ["is_password_enabled"]: val.isPasswordEnabled, ["permissions"]: val.permissions == void 0 ? void 0 : serializeFileSharedLinkFieldPermissionsField(val.permissions), ["download_count"]: val.downloadCount, ["preview_count"]: val.previewCount }; } export function deserializeFileSharedLinkField(val: any): FileSharedLinkField { const url: string = val.url; - const downloadUrl: undefined | string = isJson(val.download_url, "string") ? val.download_url : void 0; - const vanityUrl: undefined | string = isJson(val.vanity_url, "string") ? val.vanity_url : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; + const downloadUrl: undefined | string = val.download_url == void 0 ? void 0 : val.download_url; + const vanityUrl: undefined | string = val.vanity_url == void 0 ? void 0 : val.vanity_url; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; const access: undefined | FileSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeFileSharedLinkFieldAccessField(val.access); const effectiveAccess: FileSharedLinkFieldEffectiveAccessField = deserializeFileSharedLinkFieldEffectiveAccessField(val.effective_access); const effectivePermission: FileSharedLinkFieldEffectivePermissionField = deserializeFileSharedLinkFieldEffectivePermissionField(val.effective_permission); - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const isPasswordEnabled: boolean = val.is_password_enabled; const permissions: undefined | FileSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeFileSharedLinkFieldPermissionsField(val.permissions); const downloadCount: number = val.download_count; @@ -6585,35 +6591,35 @@ export function serializeFile(val: File): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"File\""; } - return { ...base, ...{ ["description"]: val.description, ["size"]: val.size, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeFilePathCollectionField(val.pathCollection), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["content_created_at"]: val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeFileSharedLinkField(val.sharedLink), ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeFileItemStatusField(val.itemStatus) } }; + return { ...base, ...{ ["description"]: val.description == void 0 ? void 0 : val.description, ["size"]: val.size == void 0 ? void 0 : val.size, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeFilePathCollectionField(val.pathCollection), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["content_created_at"]: val.contentCreatedAt == void 0 ? void 0 : val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt == void 0 ? void 0 : val.contentModifiedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeFileSharedLinkField(val.sharedLink), ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeFileItemStatusField(val.itemStatus) } }; } export function deserializeFile(val: any): File { - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; const pathCollection: undefined | FilePathCollectionField = val.path_collection == void 0 ? void 0 : deserializeFilePathCollectionField(val.path_collection); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); const sharedLink: undefined | FileSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeFileSharedLinkField(val.shared_link); const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); const itemStatus: undefined | FileItemStatusField = val.item_status == void 0 ? void 0 : deserializeFileItemStatusField(val.item_status); - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const sha1: undefined | string = isJson(val.sha1, "string") ? val.sha1 : void 0; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const sha1: undefined | string = val.sha1 == void 0 ? void 0 : val.sha1; const fileVersion: undefined | FileVersionMini = val.file_version == void 0 ? void 0 : deserializeFileVersionMini(val.file_version); const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FileBaseTypeField = deserializeFileBaseTypeField(val.type); return { description: description, size: size, pathCollection: pathCollection, createdAt: createdAt, modifiedAt: modifiedAt, trashedAt: trashedAt, purgedAt: purgedAt, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt, createdBy: createdBy, modifiedBy: modifiedBy, ownedBy: ownedBy, sharedLink: sharedLink, parent: parent, itemStatus: itemStatus, sequenceId: sequenceId, name: name, sha1: sha1, fileVersion: fileVersion, id: id, etag: etag, type: type } satisfies File; } export function serializeFileFullPermissionsField(val: FileFullPermissionsField): Json { - return { ["can_delete"]: val.canDelete, ["can_download"]: val.canDownload, ["can_invite_collaborator"]: val.canInviteCollaborator, ["can_rename"]: val.canRename, ["can_set_share_access"]: val.canSetShareAccess, ["can_share"]: val.canShare, ["can_annotate"]: val.canAnnotate, ["can_comment"]: val.canComment, ["can_preview"]: val.canPreview, ["can_upload"]: val.canUpload, ["can_view_annotations_all"]: val.canViewAnnotationsAll, ["can_view_annotations_self"]: val.canViewAnnotationsSelf }; + return { ["can_delete"]: val.canDelete, ["can_download"]: val.canDownload, ["can_invite_collaborator"]: val.canInviteCollaborator, ["can_rename"]: val.canRename, ["can_set_share_access"]: val.canSetShareAccess, ["can_share"]: val.canShare, ["can_annotate"]: val.canAnnotate == void 0 ? void 0 : val.canAnnotate, ["can_comment"]: val.canComment == void 0 ? void 0 : val.canComment, ["can_preview"]: val.canPreview == void 0 ? void 0 : val.canPreview, ["can_upload"]: val.canUpload == void 0 ? void 0 : val.canUpload, ["can_view_annotations_all"]: val.canViewAnnotationsAll == void 0 ? void 0 : val.canViewAnnotationsAll, ["can_view_annotations_self"]: val.canViewAnnotationsSelf == void 0 ? void 0 : val.canViewAnnotationsSelf }; } export function deserializeFileFullPermissionsField(val: any): FileFullPermissionsField { const canDelete: boolean = val.can_delete; @@ -6622,12 +6628,12 @@ export function deserializeFileFullPermissionsField(val: any): FileFullPermissio const canRename: boolean = val.can_rename; const canSetShareAccess: boolean = val.can_set_share_access; const canShare: boolean = val.can_share; - const canAnnotate: undefined | boolean = isJson(val.can_annotate, "boolean") ? val.can_annotate : void 0; - const canComment: undefined | boolean = isJson(val.can_comment, "boolean") ? val.can_comment : void 0; - const canPreview: undefined | boolean = isJson(val.can_preview, "boolean") ? val.can_preview : void 0; - const canUpload: undefined | boolean = isJson(val.can_upload, "boolean") ? val.can_upload : void 0; - const canViewAnnotationsAll: undefined | boolean = isJson(val.can_view_annotations_all, "boolean") ? val.can_view_annotations_all : void 0; - const canViewAnnotationsSelf: undefined | boolean = isJson(val.can_view_annotations_self, "boolean") ? val.can_view_annotations_self : void 0; + const canAnnotate: undefined | boolean = val.can_annotate == void 0 ? void 0 : val.can_annotate; + const canComment: undefined | boolean = val.can_comment == void 0 ? void 0 : val.can_comment; + const canPreview: undefined | boolean = val.can_preview == void 0 ? void 0 : val.can_preview; + const canUpload: undefined | boolean = val.can_upload == void 0 ? void 0 : val.can_upload; + const canViewAnnotationsAll: undefined | boolean = val.can_view_annotations_all == void 0 ? void 0 : val.can_view_annotations_all; + const canViewAnnotationsSelf: undefined | boolean = val.can_view_annotations_self == void 0 ? void 0 : val.can_view_annotations_self; return { canDelete: canDelete, canDownload: canDownload, canInviteCollaborator: canInviteCollaborator, canRename: canRename, canSetShareAccess: canSetShareAccess, canShare: canShare, canAnnotate: canAnnotate, canComment: canComment, canPreview: canPreview, canUpload: canUpload, canViewAnnotationsAll: canViewAnnotationsAll, canViewAnnotationsSelf: canViewAnnotationsSelf } satisfies FileFullPermissionsField; } export function serializeFileFullLockFieldTypeField(val: FileFullLockFieldTypeField): Json { @@ -6664,15 +6670,15 @@ export function deserializeFileFullLockFieldAppTypeField(val: any): FileFullLock throw "".concat("Invalid value: ", val) as string; } export function serializeFileFullLockField(val: FileFullLockField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeFileFullLockFieldTypeField(val.type), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["expired_at"]: val.expiredAt, ["is_download_prevented"]: val.isDownloadPrevented, ["app_type"]: val.appType == void 0 ? void 0 : serializeFileFullLockFieldAppTypeField(val.appType) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeFileFullLockFieldTypeField(val.type), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["expired_at"]: val.expiredAt == void 0 ? void 0 : val.expiredAt, ["is_download_prevented"]: val.isDownloadPrevented == void 0 ? void 0 : val.isDownloadPrevented, ["app_type"]: val.appType == void 0 ? void 0 : serializeFileFullLockFieldAppTypeField(val.appType) }; } export function deserializeFileFullLockField(val: any): FileFullLockField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | FileFullLockFieldTypeField = val.type == void 0 ? void 0 : deserializeFileFullLockFieldTypeField(val.type); const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const expiredAt: undefined | string = isJson(val.expired_at, "string") ? val.expired_at : void 0; - const isDownloadPrevented: undefined | boolean = isJson(val.is_download_prevented, "boolean") ? val.is_download_prevented : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const expiredAt: undefined | string = val.expired_at == void 0 ? void 0 : val.expired_at; + const isDownloadPrevented: undefined | boolean = val.is_download_prevented == void 0 ? void 0 : val.is_download_prevented; const appType: undefined | FileFullLockFieldAppTypeField = val.app_type == void 0 ? void 0 : deserializeFileFullLockFieldAppTypeField(val.app_type); return { id: id, type: type, createdBy: createdBy, createdAt: createdAt, expiredAt: expiredAt, isDownloadPrevented: isDownloadPrevented, appType: appType } satisfies FileFullLockField; } @@ -6689,25 +6695,25 @@ export function deserializeFileFullExpiringEmbedLinkFieldTokenTypeField(val: any throw "".concat("Invalid value: ", val) as string; } export function serializeFileFullExpiringEmbedLinkField(val: FileFullExpiringEmbedLinkField): Json { - return { ["access_token"]: val.accessToken, ["expires_in"]: val.expiresIn, ["token_type"]: val.tokenType == void 0 ? void 0 : serializeFileFullExpiringEmbedLinkFieldTokenTypeField(val.tokenType), ["restricted_to"]: val.restrictedTo == void 0 ? void 0 : val.restrictedTo.map(function (item: FileScope): any { + return { ["access_token"]: val.accessToken == void 0 ? void 0 : val.accessToken, ["expires_in"]: val.expiresIn == void 0 ? void 0 : val.expiresIn, ["token_type"]: val.tokenType == void 0 ? void 0 : serializeFileFullExpiringEmbedLinkFieldTokenTypeField(val.tokenType), ["restricted_to"]: val.restrictedTo == void 0 ? void 0 : val.restrictedTo.map(function (item: FileScope): any { return serializeFileScope(item); - }) as readonly any[], ["url"]: val.url }; + }) as readonly any[], ["url"]: val.url == void 0 ? void 0 : val.url }; } export function deserializeFileFullExpiringEmbedLinkField(val: any): FileFullExpiringEmbedLinkField { - const accessToken: undefined | string = isJson(val.access_token, "string") ? val.access_token : void 0; - const expiresIn: undefined | number = isJson(val.expires_in, "number") ? val.expires_in : void 0; + const accessToken: undefined | string = val.access_token == void 0 ? void 0 : val.access_token; + const expiresIn: undefined | number = val.expires_in == void 0 ? void 0 : val.expires_in; const tokenType: undefined | FileFullExpiringEmbedLinkFieldTokenTypeField = val.token_type == void 0 ? void 0 : deserializeFileFullExpiringEmbedLinkFieldTokenTypeField(val.token_type); - const restrictedTo: undefined | readonly FileScope[] = isJson(val.restricted_to, "array") ? val.restricted_to.map(function (itm: Json): any { + const restrictedTo: undefined | readonly FileScope[] = val.restricted_to == void 0 ? void 0 : isJson(val.restricted_to, "array") ? val.restricted_to.map(function (itm: Json): any { return deserializeFileScope(itm); - }) as readonly any[] : void 0; - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; + }) as readonly any[] : []; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; return { accessToken: accessToken, expiresIn: expiresIn, tokenType: tokenType, restrictedTo: restrictedTo, url: url } satisfies FileFullExpiringEmbedLinkField; } export function serializeFileFullWatermarkInfoField(val: FileFullWatermarkInfoField): Json { - return { ["is_watermarked"]: val.isWatermarked }; + return { ["is_watermarked"]: val.isWatermarked == void 0 ? void 0 : val.isWatermarked }; } export function deserializeFileFullWatermarkInfoField(val: any): FileFullWatermarkInfoField { - const isWatermarked: undefined | boolean = isJson(val.is_watermarked, "boolean") ? val.is_watermarked : void 0; + const isWatermarked: undefined | boolean = val.is_watermarked == void 0 ? void 0 : val.is_watermarked; return { isWatermarked: isWatermarked } satisfies FileFullWatermarkInfoField; } export function serializeFileFullAllowedInviteeRolesField(val: FileFullAllowedInviteeRolesField): Json { @@ -6741,32 +6747,37 @@ export function deserializeFileFullAllowedInviteeRolesField(val: any): FileFullA throw "".concat("Invalid value: ", val) as string; } export function serializeFileFullMetadataField(val: FileFullMetadataField): Json { - return {}; + return { ...{}, ...val.extraData }; } export function deserializeFileFullMetadataField(val: any): FileFullMetadataField { - return {} satisfies FileFullMetadataField; + const extraData: undefined | { + readonly [key: string]: { + readonly [key: string]: Metadata; + }; + } = val == void 0 ? void 0 : val; + return { extraData: extraData } satisfies FileFullMetadataField; } export function serializeFileFullRepresentationsFieldEntriesFieldContentField(val: FileFullRepresentationsFieldEntriesFieldContentField): Json { - return { ["url_template"]: val.urlTemplate }; + return { ["url_template"]: val.urlTemplate == void 0 ? void 0 : val.urlTemplate }; } export function deserializeFileFullRepresentationsFieldEntriesFieldContentField(val: any): FileFullRepresentationsFieldEntriesFieldContentField { - const urlTemplate: undefined | string = isJson(val.url_template, "string") ? val.url_template : void 0; + const urlTemplate: undefined | string = val.url_template == void 0 ? void 0 : val.url_template; return { urlTemplate: urlTemplate } satisfies FileFullRepresentationsFieldEntriesFieldContentField; } export function serializeFileFullRepresentationsFieldEntriesFieldInfoField(val: FileFullRepresentationsFieldEntriesFieldInfoField): Json { - return { ["url"]: val.url }; + return { ["url"]: val.url == void 0 ? void 0 : val.url }; } export function deserializeFileFullRepresentationsFieldEntriesFieldInfoField(val: any): FileFullRepresentationsFieldEntriesFieldInfoField { - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; return { url: url } satisfies FileFullRepresentationsFieldEntriesFieldInfoField; } export function serializeFileFullRepresentationsFieldEntriesFieldPropertiesField(val: FileFullRepresentationsFieldEntriesFieldPropertiesField): Json { - return { ["dimensions"]: val.dimensions, ["paged"]: val.paged, ["thumb"]: val.thumb }; + return { ["dimensions"]: val.dimensions == void 0 ? void 0 : val.dimensions, ["paged"]: val.paged == void 0 ? void 0 : val.paged, ["thumb"]: val.thumb == void 0 ? void 0 : val.thumb }; } export function deserializeFileFullRepresentationsFieldEntriesFieldPropertiesField(val: any): FileFullRepresentationsFieldEntriesFieldPropertiesField { - const dimensions: undefined | string = isJson(val.dimensions, "string") ? val.dimensions : void 0; - const paged: undefined | boolean = isJson(val.paged, "boolean") ? val.paged : void 0; - const thumb: undefined | boolean = isJson(val.thumb, "boolean") ? val.thumb : void 0; + const dimensions: undefined | string = val.dimensions == void 0 ? void 0 : val.dimensions; + const paged: undefined | boolean = val.paged == void 0 ? void 0 : val.paged; + const thumb: undefined | boolean = val.thumb == void 0 ? void 0 : val.thumb; return { dimensions: dimensions, paged: paged, thumb: thumb } satisfies FileFullRepresentationsFieldEntriesFieldPropertiesField; } export function serializeFileFullRepresentationsFieldEntriesFieldStatusFieldStateField(val: FileFullRepresentationsFieldEntriesFieldStatusFieldStateField): Json { @@ -6798,13 +6809,13 @@ export function deserializeFileFullRepresentationsFieldEntriesFieldStatusField(v return { state: state } satisfies FileFullRepresentationsFieldEntriesFieldStatusField; } export function serializeFileFullRepresentationsFieldEntriesField(val: FileFullRepresentationsFieldEntriesField): Json { - return { ["content"]: val.content == void 0 ? void 0 : serializeFileFullRepresentationsFieldEntriesFieldContentField(val.content), ["info"]: val.info == void 0 ? void 0 : serializeFileFullRepresentationsFieldEntriesFieldInfoField(val.info), ["properties"]: val.properties == void 0 ? void 0 : serializeFileFullRepresentationsFieldEntriesFieldPropertiesField(val.properties), ["representation"]: val.representation, ["status"]: val.status == void 0 ? void 0 : serializeFileFullRepresentationsFieldEntriesFieldStatusField(val.status) }; + return { ["content"]: val.content == void 0 ? void 0 : serializeFileFullRepresentationsFieldEntriesFieldContentField(val.content), ["info"]: val.info == void 0 ? void 0 : serializeFileFullRepresentationsFieldEntriesFieldInfoField(val.info), ["properties"]: val.properties == void 0 ? void 0 : serializeFileFullRepresentationsFieldEntriesFieldPropertiesField(val.properties), ["representation"]: val.representation == void 0 ? void 0 : val.representation, ["status"]: val.status == void 0 ? void 0 : serializeFileFullRepresentationsFieldEntriesFieldStatusField(val.status) }; } export function deserializeFileFullRepresentationsFieldEntriesField(val: any): FileFullRepresentationsFieldEntriesField { const content: undefined | FileFullRepresentationsFieldEntriesFieldContentField = val.content == void 0 ? void 0 : deserializeFileFullRepresentationsFieldEntriesFieldContentField(val.content); const info: undefined | FileFullRepresentationsFieldEntriesFieldInfoField = val.info == void 0 ? void 0 : deserializeFileFullRepresentationsFieldEntriesFieldInfoField(val.info); const properties: undefined | FileFullRepresentationsFieldEntriesFieldPropertiesField = val.properties == void 0 ? void 0 : deserializeFileFullRepresentationsFieldEntriesFieldPropertiesField(val.properties); - const representation: undefined | string = isJson(val.representation, "string") ? val.representation : void 0; + const representation: undefined | string = val.representation == void 0 ? void 0 : val.representation; const status: undefined | FileFullRepresentationsFieldEntriesFieldStatusField = val.status == void 0 ? void 0 : deserializeFileFullRepresentationsFieldEntriesFieldStatusField(val.status); return { content: content, info: info, properties: properties, representation: representation, status: status } satisfies FileFullRepresentationsFieldEntriesField; } @@ -6814,18 +6825,18 @@ export function serializeFileFullRepresentationsField(val: FileFullRepresentatio }) as readonly any[] }; } export function deserializeFileFullRepresentationsField(val: any): FileFullRepresentationsField { - const entries: undefined | readonly FileFullRepresentationsFieldEntriesField[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly FileFullRepresentationsFieldEntriesField[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFileFullRepresentationsFieldEntriesField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { entries: entries } satisfies FileFullRepresentationsField; } export function serializeFileFullClassificationField(val: FileFullClassificationField): Json { - return { ["name"]: val.name, ["definition"]: val.definition, ["color"]: val.color }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["definition"]: val.definition == void 0 ? void 0 : val.definition, ["color"]: val.color == void 0 ? void 0 : val.color }; } export function deserializeFileFullClassificationField(val: any): FileFullClassificationField { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const definition: undefined | string = isJson(val.definition, "string") ? val.definition : void 0; - const color: undefined | string = isJson(val.color, "string") ? val.color : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const definition: undefined | string = val.definition == void 0 ? void 0 : val.definition; + const color: undefined | string = val.color == void 0 ? void 0 : val.color; return { name: name, definition: definition, color: color } satisfies FileFullClassificationField; } export function serializeFileFullSharedLinkPermissionOptionsField(val: FileFullSharedLinkPermissionOptionsField): Json { @@ -6851,75 +6862,75 @@ export function serializeFileFull(val: FileFull): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"FileFull\""; } - return { ...base, ...{ ["version_number"]: val.versionNumber, ["comment_count"]: val.commentCount, ["permissions"]: val.permissions == void 0 ? void 0 : serializeFileFullPermissionsField(val.permissions), ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): undefined { - return void 0; - }) as readonly any[], ["lock"]: val.lock == void 0 ? void 0 : serializeFileFullLockField(val.lock), ["extension"]: val.extension, ["is_package"]: val.isPackage, ["expiring_embed_link"]: val.expiringEmbedLink == void 0 ? void 0 : serializeFileFullExpiringEmbedLinkField(val.expiringEmbedLink), ["watermark_info"]: val.watermarkInfo == void 0 ? void 0 : serializeFileFullWatermarkInfoField(val.watermarkInfo), ["is_accessible_via_shared_link"]: val.isAccessibleViaSharedLink, ["allowed_invitee_roles"]: val.allowedInviteeRoles == void 0 ? void 0 : val.allowedInviteeRoles.map(function (item: FileFullAllowedInviteeRolesField): any { + return { ...base, ...{ ["version_number"]: val.versionNumber == void 0 ? void 0 : val.versionNumber, ["comment_count"]: val.commentCount == void 0 ? void 0 : val.commentCount, ["permissions"]: val.permissions == void 0 ? void 0 : serializeFileFullPermissionsField(val.permissions), ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): string { + return item; + }) as readonly any[], ["lock"]: val.lock == void 0 ? void 0 : serializeFileFullLockField(val.lock), ["extension"]: val.extension == void 0 ? void 0 : val.extension, ["is_package"]: val.isPackage == void 0 ? void 0 : val.isPackage, ["expiring_embed_link"]: val.expiringEmbedLink == void 0 ? void 0 : serializeFileFullExpiringEmbedLinkField(val.expiringEmbedLink), ["watermark_info"]: val.watermarkInfo == void 0 ? void 0 : serializeFileFullWatermarkInfoField(val.watermarkInfo), ["is_accessible_via_shared_link"]: val.isAccessibleViaSharedLink == void 0 ? void 0 : val.isAccessibleViaSharedLink, ["allowed_invitee_roles"]: val.allowedInviteeRoles == void 0 ? void 0 : val.allowedInviteeRoles.map(function (item: FileFullAllowedInviteeRolesField): any { return serializeFileFullAllowedInviteeRolesField(item); - }) as readonly any[], ["is_externally_owned"]: val.isExternallyOwned, ["has_collaborations"]: val.hasCollaborations, ["metadata"]: val.metadata == void 0 ? void 0 : serializeFileFullMetadataField(val.metadata), ["expires_at"]: val.expiresAt, ["representations"]: val.representations == void 0 ? void 0 : serializeFileFullRepresentationsField(val.representations), ["classification"]: val.classification == void 0 ? void 0 : serializeFileFullClassificationField(val.classification), ["uploader_display_name"]: val.uploaderDisplayName, ["disposition_at"]: val.dispositionAt, ["shared_link_permission_options"]: val.sharedLinkPermissionOptions == void 0 ? void 0 : val.sharedLinkPermissionOptions.map(function (item: FileFullSharedLinkPermissionOptionsField): any { + }) as readonly any[], ["is_externally_owned"]: val.isExternallyOwned == void 0 ? void 0 : val.isExternallyOwned, ["has_collaborations"]: val.hasCollaborations == void 0 ? void 0 : val.hasCollaborations, ["metadata"]: val.metadata == void 0 ? void 0 : serializeFileFullMetadataField(val.metadata), ["expires_at"]: val.expiresAt == void 0 ? void 0 : val.expiresAt, ["representations"]: val.representations == void 0 ? void 0 : serializeFileFullRepresentationsField(val.representations), ["classification"]: val.classification == void 0 ? void 0 : serializeFileFullClassificationField(val.classification), ["uploader_display_name"]: val.uploaderDisplayName == void 0 ? void 0 : val.uploaderDisplayName, ["disposition_at"]: val.dispositionAt == void 0 ? void 0 : val.dispositionAt, ["shared_link_permission_options"]: val.sharedLinkPermissionOptions == void 0 ? void 0 : val.sharedLinkPermissionOptions.map(function (item: FileFullSharedLinkPermissionOptionsField): any { return serializeFileFullSharedLinkPermissionOptionsField(item); }) as readonly any[] } }; } export function deserializeFileFull(val: any): FileFull { - const versionNumber: undefined | string = isJson(val.version_number, "string") ? val.version_number : void 0; - const commentCount: undefined | number = isJson(val.comment_count, "number") ? val.comment_count : void 0; + const versionNumber: undefined | string = val.version_number == void 0 ? void 0 : val.version_number; + const commentCount: undefined | number = val.comment_count == void 0 ? void 0 : val.comment_count; const permissions: undefined | FileFullPermissionsField = val.permissions == void 0 ? void 0 : deserializeFileFullPermissionsField(val.permissions); - const tags: undefined | readonly string[] = isJson(val.tags, "array") ? val.tags.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; + const tags: undefined | readonly string[] = val.tags == void 0 ? void 0 : isJson(val.tags, "array") ? val.tags.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; const lock: undefined | FileFullLockField = val.lock == void 0 ? void 0 : deserializeFileFullLockField(val.lock); - const extension: undefined | string = isJson(val.extension, "string") ? val.extension : void 0; - const isPackage: undefined | boolean = isJson(val.is_package, "boolean") ? val.is_package : void 0; + const extension: undefined | string = val.extension == void 0 ? void 0 : val.extension; + const isPackage: undefined | boolean = val.is_package == void 0 ? void 0 : val.is_package; const expiringEmbedLink: undefined | FileFullExpiringEmbedLinkField = val.expiring_embed_link == void 0 ? void 0 : deserializeFileFullExpiringEmbedLinkField(val.expiring_embed_link); const watermarkInfo: undefined | FileFullWatermarkInfoField = val.watermark_info == void 0 ? void 0 : deserializeFileFullWatermarkInfoField(val.watermark_info); - const isAccessibleViaSharedLink: undefined | boolean = isJson(val.is_accessible_via_shared_link, "boolean") ? val.is_accessible_via_shared_link : void 0; - const allowedInviteeRoles: undefined | readonly FileFullAllowedInviteeRolesField[] = isJson(val.allowed_invitee_roles, "array") ? val.allowed_invitee_roles.map(function (itm: Json): any { + const isAccessibleViaSharedLink: undefined | boolean = val.is_accessible_via_shared_link == void 0 ? void 0 : val.is_accessible_via_shared_link; + const allowedInviteeRoles: undefined | readonly FileFullAllowedInviteeRolesField[] = val.allowed_invitee_roles == void 0 ? void 0 : isJson(val.allowed_invitee_roles, "array") ? val.allowed_invitee_roles.map(function (itm: Json): any { return deserializeFileFullAllowedInviteeRolesField(itm); - }) as readonly any[] : void 0; - const isExternallyOwned: undefined | boolean = isJson(val.is_externally_owned, "boolean") ? val.is_externally_owned : void 0; - const hasCollaborations: undefined | boolean = isJson(val.has_collaborations, "boolean") ? val.has_collaborations : void 0; + }) as readonly any[] : []; + const isExternallyOwned: undefined | boolean = val.is_externally_owned == void 0 ? void 0 : val.is_externally_owned; + const hasCollaborations: undefined | boolean = val.has_collaborations == void 0 ? void 0 : val.has_collaborations; const metadata: undefined | FileFullMetadataField = val.metadata == void 0 ? void 0 : deserializeFileFullMetadataField(val.metadata); - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; const representations: undefined | FileFullRepresentationsField = val.representations == void 0 ? void 0 : deserializeFileFullRepresentationsField(val.representations); const classification: undefined | FileFullClassificationField = val.classification == void 0 ? void 0 : deserializeFileFullClassificationField(val.classification); - const uploaderDisplayName: undefined | string = isJson(val.uploader_display_name, "string") ? val.uploader_display_name : void 0; - const dispositionAt: undefined | string = isJson(val.disposition_at, "string") ? val.disposition_at : void 0; - const sharedLinkPermissionOptions: undefined | readonly FileFullSharedLinkPermissionOptionsField[] = isJson(val.shared_link_permission_options, "array") ? val.shared_link_permission_options.map(function (itm: Json): any { + const uploaderDisplayName: undefined | string = val.uploader_display_name == void 0 ? void 0 : val.uploader_display_name; + const dispositionAt: undefined | string = val.disposition_at == void 0 ? void 0 : val.disposition_at; + const sharedLinkPermissionOptions: undefined | readonly FileFullSharedLinkPermissionOptionsField[] = val.shared_link_permission_options == void 0 ? void 0 : isJson(val.shared_link_permission_options, "array") ? val.shared_link_permission_options.map(function (itm: Json): any { return deserializeFileFullSharedLinkPermissionOptionsField(itm); - }) as readonly any[] : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; + }) as readonly any[] : []; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; const pathCollection: undefined | FilePathCollectionField = val.path_collection == void 0 ? void 0 : deserializeFilePathCollectionField(val.path_collection); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); const sharedLink: undefined | FileSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeFileSharedLinkField(val.shared_link); const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); const itemStatus: undefined | FileItemStatusField = val.item_status == void 0 ? void 0 : deserializeFileItemStatusField(val.item_status); - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const sha1: undefined | string = isJson(val.sha1, "string") ? val.sha1 : void 0; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const sha1: undefined | string = val.sha1 == void 0 ? void 0 : val.sha1; const fileVersion: undefined | FileVersionMini = val.file_version == void 0 ? void 0 : deserializeFileVersionMini(val.file_version); const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FileBaseTypeField = deserializeFileBaseTypeField(val.type); return { versionNumber: versionNumber, commentCount: commentCount, permissions: permissions, tags: tags, lock: lock, extension: extension, isPackage: isPackage, expiringEmbedLink: expiringEmbedLink, watermarkInfo: watermarkInfo, isAccessibleViaSharedLink: isAccessibleViaSharedLink, allowedInviteeRoles: allowedInviteeRoles, isExternallyOwned: isExternallyOwned, hasCollaborations: hasCollaborations, metadata: metadata, expiresAt: expiresAt, representations: representations, classification: classification, uploaderDisplayName: uploaderDisplayName, dispositionAt: dispositionAt, sharedLinkPermissionOptions: sharedLinkPermissionOptions, description: description, size: size, pathCollection: pathCollection, createdAt: createdAt, modifiedAt: modifiedAt, trashedAt: trashedAt, purgedAt: purgedAt, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt, createdBy: createdBy, modifiedBy: modifiedBy, ownedBy: ownedBy, sharedLink: sharedLink, parent: parent, itemStatus: itemStatus, sequenceId: sequenceId, name: name, sha1: sha1, fileVersion: fileVersion, id: id, etag: etag, type: type } satisfies FileFull; } export function serializeFiles(val: Files): Json { - return { ["total_count"]: val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: File): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: File): any { return serializeFile(item); }) as readonly any[] }; } export function deserializeFiles(val: any): Files { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const entries: undefined | readonly File[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const entries: undefined | readonly File[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFile(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies Files; } export function serializeDevicePinnerTypeField(val: DevicePinnerTypeField): Json { @@ -6935,13 +6946,13 @@ export function deserializeDevicePinnerTypeField(val: any): DevicePinnerTypeFiel throw "".concat("Invalid value: ", val) as string; } export function serializeDevicePinner(val: DevicePinner): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeDevicePinnerTypeField(val.type), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["product_name"]: val.productName }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeDevicePinnerTypeField(val.type), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["product_name"]: val.productName == void 0 ? void 0 : val.productName }; } export function deserializeDevicePinner(val: any): DevicePinner { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | DevicePinnerTypeField = val.type == void 0 ? void 0 : deserializeDevicePinnerTypeField(val.type); const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); - const productName: undefined | string = isJson(val.product_name, "string") ? val.product_name : void 0; + const productName: undefined | string = val.product_name == void 0 ? void 0 : val.product_name; return { id: id, type: type, ownedBy: ownedBy, productName: productName } satisfies DevicePinner; } export function serializeDevicePinnersOrderFieldByField(val: DevicePinnersOrderFieldByField): Json { @@ -6982,27 +6993,27 @@ export function deserializeDevicePinnersOrderField(val: any): DevicePinnersOrder export function serializeDevicePinners(val: DevicePinners): Json { return { ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: DevicePinner): any { return serializeDevicePinner(item); - }) as readonly any[], ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: DevicePinnersOrderField): any { + }) as readonly any[], ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: DevicePinnersOrderField): any { return serializeDevicePinnersOrderField(item); }) as readonly any[] }; } export function deserializeDevicePinners(val: any): DevicePinners { - const entries: undefined | readonly DevicePinner[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly DevicePinner[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeDevicePinner(itm); - }) as readonly any[] : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const order: undefined | readonly DevicePinnersOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + }) as readonly any[] : []; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const order: undefined | readonly DevicePinnersOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeDevicePinnersOrderField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { entries: entries, limit: limit, nextMarker: nextMarker, order: order } satisfies DevicePinners; } export function serializeCommentItemField(val: CommentItemField): Json { - return { ["id"]: val.id, ["type"]: val.type }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : val.type }; } export function deserializeCommentItemField(val: any): CommentItemField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; return { id: id, type: type } satisfies CommentItemField; } export function serializeComment(val: Comment): Json { @@ -7010,16 +7021,16 @@ export function serializeComment(val: Comment): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"Comment\""; } - return { ...base, ...{ ["is_reply_comment"]: val.isReplyComment, ["message"]: val.message, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["item"]: val.item == void 0 ? void 0 : serializeCommentItemField(val.item) } }; + return { ...base, ...{ ["is_reply_comment"]: val.isReplyComment == void 0 ? void 0 : val.isReplyComment, ["message"]: val.message == void 0 ? void 0 : val.message, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["item"]: val.item == void 0 ? void 0 : serializeCommentItemField(val.item) } }; } export function deserializeComment(val: any): Comment { - const isReplyComment: undefined | boolean = isJson(val.is_reply_comment, "boolean") ? val.is_reply_comment : void 0; - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const isReplyComment: undefined | boolean = val.is_reply_comment == void 0 ? void 0 : val.is_reply_comment; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; const item: undefined | CommentItemField = val.item == void 0 ? void 0 : deserializeCommentItemField(val.item); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CommentBaseTypeField = val.type == void 0 ? void 0 : deserializeCommentBaseTypeField(val.type); return { isReplyComment: isReplyComment, message: message, createdBy: createdBy, createdAt: createdAt, modifiedAt: modifiedAt, item: item, id: id, type: type } satisfies Comment; } @@ -7028,17 +7039,17 @@ export function serializeCommentFull(val: CommentFull): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"CommentFull\""; } - return { ...base, ...{ ["tagged_message"]: val.taggedMessage } }; + return { ...base, ...{ ["tagged_message"]: val.taggedMessage == void 0 ? void 0 : val.taggedMessage } }; } export function deserializeCommentFull(val: any): CommentFull { - const taggedMessage: undefined | string = isJson(val.tagged_message, "string") ? val.tagged_message : void 0; - const isReplyComment: undefined | boolean = isJson(val.is_reply_comment, "boolean") ? val.is_reply_comment : void 0; - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const taggedMessage: undefined | string = val.tagged_message == void 0 ? void 0 : val.tagged_message; + const isReplyComment: undefined | boolean = val.is_reply_comment == void 0 ? void 0 : val.is_reply_comment; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; const item: undefined | CommentItemField = val.item == void 0 ? void 0 : deserializeCommentItemField(val.item); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CommentBaseTypeField = val.type == void 0 ? void 0 : deserializeCommentBaseTypeField(val.type); return { taggedMessage: taggedMessage, isReplyComment: isReplyComment, message: message, createdBy: createdBy, createdAt: createdAt, modifiedAt: modifiedAt, item: item, id: id, type: type } satisfies CommentFull; } @@ -7058,30 +7069,30 @@ export function deserializeCommentsOrderFieldDirectionField(val: any): CommentsO throw "".concat("Invalid value: ", val) as string; } export function serializeCommentsOrderField(val: CommentsOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeCommentsOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeCommentsOrderFieldDirectionField(val.direction) }; } export function deserializeCommentsOrderField(val: any): CommentsOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | CommentsOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeCommentsOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies CommentsOrderField; } export function serializeComments(val: Comments): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: CommentsOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: CommentsOrderField): any { return serializeCommentsOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Comment): any { return serializeComment(item); }) as readonly any[] }; } export function deserializeComments(val: any): Comments { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly CommentsOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly CommentsOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeCommentsOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly Comment[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly Comment[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeComment(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies Comments; } export function serializeShieldInformationBarrierSegmentRestriction(val: ShieldInformationBarrierSegmentRestriction): Json { @@ -7089,18 +7100,18 @@ export function serializeShieldInformationBarrierSegmentRestriction(val: ShieldI if (!isJson(base, "object")) { throw "Expecting an object for \"ShieldInformationBarrierSegmentRestriction\""; } - return { ...base, ...{ ["shield_information_barrier"]: val.shieldInformationBarrier == void 0 ? void 0 : serializeShieldInformationBarrierBase(val.shieldInformationBarrier), ["created_at"]: val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserBase(val.updatedBy) } }; + return { ...base, ...{ ["shield_information_barrier"]: val.shieldInformationBarrier == void 0 ? void 0 : serializeShieldInformationBarrierBase(val.shieldInformationBarrier), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt == void 0 ? void 0 : val.updatedAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserBase(val.updatedBy) } }; } export function deserializeShieldInformationBarrierSegmentRestriction(val: any): ShieldInformationBarrierSegmentRestriction { const shieldInformationBarrier: undefined | ShieldInformationBarrierBase = val.shield_information_barrier == void 0 ? void 0 : deserializeShieldInformationBarrierBase(val.shield_information_barrier); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); - const updatedAt: undefined | string = isJson(val.updated_at, "string") ? val.updated_at : void 0; + const updatedAt: undefined | string = val.updated_at == void 0 ? void 0 : val.updated_at; const updatedBy: undefined | UserBase = val.updated_by == void 0 ? void 0 : deserializeUserBase(val.updated_by); const shieldInformationBarrierSegment: ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField = deserializeShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField(val.shield_information_barrier_segment); const restrictedSegment: ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField = deserializeShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField(val.restricted_segment); const type: undefined | ShieldInformationBarrierSegmentRestrictionBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentRestrictionBaseTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { shieldInformationBarrier: shieldInformationBarrier, createdAt: createdAt, createdBy: createdBy, updatedAt: updatedAt, updatedBy: updatedBy, shieldInformationBarrierSegment: shieldInformationBarrierSegment, restrictedSegment: restrictedSegment, type: type, id: id } satisfies ShieldInformationBarrierSegmentRestriction; } export function serializeShieldInformationBarrierSegmentMemberMini(val: ShieldInformationBarrierSegmentMemberMini): Json { @@ -7112,7 +7123,7 @@ export function serializeShieldInformationBarrierSegmentMemberMini(val: ShieldIn } export function deserializeShieldInformationBarrierSegmentMemberMini(val: any): ShieldInformationBarrierSegmentMemberMini { const user: undefined | UserBase = val.user == void 0 ? void 0 : deserializeUserBase(val.user); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierSegmentMemberBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentMemberBaseTypeField(val.type); return { user: user, id: id, type: type } satisfies ShieldInformationBarrierSegmentMemberMini; } @@ -7129,10 +7140,10 @@ export function deserializeShieldInformationBarrierSegmentMemberShieldInformatio throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField(val: ShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentFieldTypeField(val.type) }; } export function deserializeShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField(val: any): ShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentFieldTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentFieldTypeField(val.type); return { id: id, type: type } satisfies ShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField; } @@ -7141,17 +7152,17 @@ export function serializeShieldInformationBarrierSegmentMember(val: ShieldInform if (!isJson(base, "object")) { throw "Expecting an object for \"ShieldInformationBarrierSegmentMember\""; } - return { ...base, ...{ ["shield_information_barrier"]: val.shieldInformationBarrier == void 0 ? void 0 : serializeShieldInformationBarrierBase(val.shieldInformationBarrier), ["shield_information_barrier_segment"]: val.shieldInformationBarrierSegment == void 0 ? void 0 : serializeShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField(val.shieldInformationBarrierSegment), ["created_at"]: val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserBase(val.updatedBy) } }; + return { ...base, ...{ ["shield_information_barrier"]: val.shieldInformationBarrier == void 0 ? void 0 : serializeShieldInformationBarrierBase(val.shieldInformationBarrier), ["shield_information_barrier_segment"]: val.shieldInformationBarrierSegment == void 0 ? void 0 : serializeShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField(val.shieldInformationBarrierSegment), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt == void 0 ? void 0 : val.updatedAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserBase(val.updatedBy) } }; } export function deserializeShieldInformationBarrierSegmentMember(val: any): ShieldInformationBarrierSegmentMember { const shieldInformationBarrier: undefined | ShieldInformationBarrierBase = val.shield_information_barrier == void 0 ? void 0 : deserializeShieldInformationBarrierBase(val.shield_information_barrier); const shieldInformationBarrierSegment: undefined | ShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField = val.shield_information_barrier_segment == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentField(val.shield_information_barrier_segment); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); - const updatedAt: undefined | string = isJson(val.updated_at, "string") ? val.updated_at : void 0; + const updatedAt: undefined | string = val.updated_at == void 0 ? void 0 : val.updated_at; const updatedBy: undefined | UserBase = val.updated_by == void 0 ? void 0 : deserializeUserBase(val.updated_by); const user: undefined | UserBase = val.user == void 0 ? void 0 : deserializeUserBase(val.user); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierSegmentMemberBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentMemberBaseTypeField(val.type); return { shieldInformationBarrier: shieldInformationBarrier, shieldInformationBarrierSegment: shieldInformationBarrierSegment, createdAt: createdAt, createdBy: createdBy, updatedAt: updatedAt, updatedBy: updatedBy, user: user, id: id, type: type } satisfies ShieldInformationBarrierSegmentMember; } @@ -7168,71 +7179,20 @@ export function deserializeShieldInformationBarrierSegmentTypeField(val: any): S throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrierSegment(val: ShieldInformationBarrierSegment): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentTypeField(val.type), ["shield_information_barrier"]: val.shieldInformationBarrier == void 0 ? void 0 : serializeShieldInformationBarrierBase(val.shieldInformationBarrier), ["name"]: val.name, ["description"]: val.description, ["created_at"]: val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserBase(val.updatedBy) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierSegmentTypeField(val.type), ["shield_information_barrier"]: val.shieldInformationBarrier == void 0 ? void 0 : serializeShieldInformationBarrierBase(val.shieldInformationBarrier), ["name"]: val.name == void 0 ? void 0 : val.name, ["description"]: val.description == void 0 ? void 0 : val.description, ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt == void 0 ? void 0 : val.updatedAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserBase(val.updatedBy) }; } export function deserializeShieldInformationBarrierSegment(val: any): ShieldInformationBarrierSegment { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierSegmentTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierSegmentTypeField(val.type); const shieldInformationBarrier: undefined | ShieldInformationBarrierBase = val.shield_information_barrier == void 0 ? void 0 : deserializeShieldInformationBarrierBase(val.shield_information_barrier); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); - const updatedAt: undefined | string = isJson(val.updated_at, "string") ? val.updated_at : void 0; + const updatedAt: undefined | string = val.updated_at == void 0 ? void 0 : val.updated_at; const updatedBy: undefined | UserBase = val.updated_by == void 0 ? void 0 : deserializeUserBase(val.updated_by); return { id: id, type: type, shieldInformationBarrier: shieldInformationBarrier, name: name, description: description, createdAt: createdAt, createdBy: createdBy, updatedAt: updatedAt, updatedBy: updatedBy } satisfies ShieldInformationBarrierSegment; } -export function serializeShieldInformationBarrierReportShieldInformationBarrierField(val: ShieldInformationBarrierReportShieldInformationBarrierField): Json { - return {}; -} -export function deserializeShieldInformationBarrierReportShieldInformationBarrierField(val: any): ShieldInformationBarrierReportShieldInformationBarrierField { - return {} satisfies ShieldInformationBarrierReportShieldInformationBarrierField; -} -export function serializeShieldInformationBarrierReportStatusField(val: ShieldInformationBarrierReportStatusField): Json { - return val; -} -export function deserializeShieldInformationBarrierReportStatusField(val: any): ShieldInformationBarrierReportStatusField { - if (!isJson(val, "string")) { - throw "Expecting a string for \"ShieldInformationBarrierReportStatusField\""; - } - if (val == "pending") { - return "pending"; - } - if (val == "error") { - return "error"; - } - if (val == "done") { - return "done"; - } - if (val == "cancelled") { - return "cancelled"; - } - throw "".concat("Invalid value: ", val) as string; -} -export function serializeShieldInformationBarrierReportDetailsField(val: ShieldInformationBarrierReportDetailsField): Json { - return {}; -} -export function deserializeShieldInformationBarrierReportDetailsField(val: any): ShieldInformationBarrierReportDetailsField { - return {} satisfies ShieldInformationBarrierReportDetailsField; -} -export function serializeShieldInformationBarrierReport(val: ShieldInformationBarrierReport): Json { - const base: any = serializeShieldInformationBarrierReportBase(val); - if (!isJson(base, "object")) { - throw "Expecting an object for \"ShieldInformationBarrierReport\""; - } - return { ...base, ...{ ["shield_information_barrier"]: val.shieldInformationBarrier == void 0 ? void 0 : serializeShieldInformationBarrierReportShieldInformationBarrierField(val.shieldInformationBarrier), ["status"]: val.status == void 0 ? void 0 : serializeShieldInformationBarrierReportStatusField(val.status), ["details"]: val.details == void 0 ? void 0 : serializeShieldInformationBarrierReportDetailsField(val.details), ["created_at"]: val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt } }; -} -export function deserializeShieldInformationBarrierReport(val: any): ShieldInformationBarrierReport { - const shieldInformationBarrier: undefined | ShieldInformationBarrierReportShieldInformationBarrierField = val.shield_information_barrier == void 0 ? void 0 : deserializeShieldInformationBarrierReportShieldInformationBarrierField(val.shield_information_barrier); - const status: undefined | ShieldInformationBarrierReportStatusField = val.status == void 0 ? void 0 : deserializeShieldInformationBarrierReportStatusField(val.status); - const details: undefined | ShieldInformationBarrierReportDetailsField = val.details == void 0 ? void 0 : deserializeShieldInformationBarrierReportDetailsField(val.details); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); - const updatedAt: undefined | string = isJson(val.updated_at, "string") ? val.updated_at : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const type: undefined | ShieldInformationBarrierReportBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierReportBaseTypeField(val.type); - return { shieldInformationBarrier: shieldInformationBarrier, status: status, details: details, createdAt: createdAt, createdBy: createdBy, updatedAt: updatedAt, id: id, type: type } satisfies ShieldInformationBarrierReport; -} export function serializeShieldInformationBarrierTypeField(val: ShieldInformationBarrierTypeField): Json { return val; } @@ -7270,18 +7230,18 @@ export function deserializeShieldInformationBarrierStatusField(val: any): Shield throw "".concat("Invalid value: ", val) as string; } export function serializeShieldInformationBarrier(val: ShieldInformationBarrier): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierTypeField(val.type), ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeEnterpriseBase(val.enterprise), ["status"]: val.status == void 0 ? void 0 : serializeShieldInformationBarrierStatusField(val.status), ["created_at"]: val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserBase(val.updatedBy), ["enabled_at"]: val.enabledAt, ["enabled_by"]: val.enabledBy == void 0 ? void 0 : serializeUserBase(val.enabledBy) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeShieldInformationBarrierTypeField(val.type), ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeEnterpriseBase(val.enterprise), ["status"]: val.status == void 0 ? void 0 : serializeShieldInformationBarrierStatusField(val.status), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt == void 0 ? void 0 : val.updatedAt, ["updated_by"]: val.updatedBy == void 0 ? void 0 : serializeUserBase(val.updatedBy), ["enabled_at"]: val.enabledAt == void 0 ? void 0 : val.enabledAt, ["enabled_by"]: val.enabledBy == void 0 ? void 0 : serializeUserBase(val.enabledBy) }; } export function deserializeShieldInformationBarrier(val: any): ShieldInformationBarrier { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ShieldInformationBarrierTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierTypeField(val.type); const enterprise: undefined | EnterpriseBase = val.enterprise == void 0 ? void 0 : deserializeEnterpriseBase(val.enterprise); const status: undefined | ShieldInformationBarrierStatusField = val.status == void 0 ? void 0 : deserializeShieldInformationBarrierStatusField(val.status); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); - const updatedAt: undefined | string = isJson(val.updated_at, "string") ? val.updated_at : void 0; + const updatedAt: undefined | string = val.updated_at == void 0 ? void 0 : val.updated_at; const updatedBy: undefined | UserBase = val.updated_by == void 0 ? void 0 : deserializeUserBase(val.updated_by); - const enabledAt: undefined | string = isJson(val.enabled_at, "string") ? val.enabled_at : void 0; + const enabledAt: undefined | string = val.enabled_at == void 0 ? void 0 : val.enabled_at; const enabledBy: undefined | UserBase = val.enabled_by == void 0 ? void 0 : deserializeUserBase(val.enabled_by); return { id: id, type: type, enterprise: enterprise, status: status, createdAt: createdAt, createdBy: createdBy, updatedAt: updatedAt, updatedBy: updatedBy, enabledAt: enabledAt, enabledBy: enabledBy } satisfies ShieldInformationBarrier; } @@ -7294,38 +7254,38 @@ export function deserializeFolderLockLockedOperationsField(val: any): FolderLock return { move: move, delete: _delete } satisfies FolderLockLockedOperationsField; } export function serializeFolderLock(val: FolderLock): Json { - return { ["folder"]: val.folder == void 0 ? void 0 : serializeFolderMini(val.folder), ["id"]: val.id, ["type"]: val.type, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["created_at"]: val.createdAt, ["locked_operations"]: val.lockedOperations == void 0 ? void 0 : serializeFolderLockLockedOperationsField(val.lockedOperations), ["lock_type"]: val.lockType }; + return { ["folder"]: val.folder == void 0 ? void 0 : serializeFolderMini(val.folder), ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : val.type, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["locked_operations"]: val.lockedOperations == void 0 ? void 0 : serializeFolderLockLockedOperationsField(val.lockedOperations), ["lock_type"]: val.lockType == void 0 ? void 0 : val.lockType }; } export function deserializeFolderLock(val: any): FolderLock { const folder: undefined | FolderMini = val.folder == void 0 ? void 0 : deserializeFolderMini(val.folder); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const lockedOperations: undefined | FolderLockLockedOperationsField = val.locked_operations == void 0 ? void 0 : deserializeFolderLockLockedOperationsField(val.locked_operations); - const lockType: undefined | string = isJson(val.lock_type, "string") ? val.lock_type : void 0; + const lockType: undefined | string = val.lock_type == void 0 ? void 0 : val.lock_type; return { folder: folder, id: id, type: type, createdBy: createdBy, createdAt: createdAt, lockedOperations: lockedOperations, lockType: lockType } satisfies FolderLock; } export function serializeFolderLocks(val: FolderLocks): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FolderLock): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FolderLock): any { return serializeFolderLock(item); }) as readonly any[] }; } export function deserializeFolderLocks(val: any): FolderLocks { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly FolderLock[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly FolderLock[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFolderLock(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies FolderLocks; } export function serializeWatermarkWatermarkField(val: WatermarkWatermarkField): Json { - return { ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt }; + return { ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt }; } export function deserializeWatermarkWatermarkField(val: any): WatermarkWatermarkField { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; return { createdAt: createdAt, modifiedAt: modifiedAt } satisfies WatermarkWatermarkField; } export function serializeWatermark(val: Watermark): Json { @@ -7363,34 +7323,34 @@ export function deserializeWebhookMiniTargetFieldTypeField(val: any): WebhookMin throw "".concat("Invalid value: ", val) as string; } export function serializeWebhookMiniTargetField(val: WebhookMiniTargetField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeWebhookMiniTargetFieldTypeField(val.type) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeWebhookMiniTargetFieldTypeField(val.type) }; } export function deserializeWebhookMiniTargetField(val: any): WebhookMiniTargetField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WebhookMiniTargetFieldTypeField = val.type == void 0 ? void 0 : deserializeWebhookMiniTargetFieldTypeField(val.type); return { id: id, type: type } satisfies WebhookMiniTargetField; } export function serializeWebhookMini(val: WebhookMini): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeWebhookMiniTypeField(val.type), ["target"]: val.target == void 0 ? void 0 : serializeWebhookMiniTargetField(val.target) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeWebhookMiniTypeField(val.type), ["target"]: val.target == void 0 ? void 0 : serializeWebhookMiniTargetField(val.target) }; } export function deserializeWebhookMini(val: any): WebhookMini { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WebhookMiniTypeField = val.type == void 0 ? void 0 : deserializeWebhookMiniTypeField(val.type); const target: undefined | WebhookMiniTargetField = val.target == void 0 ? void 0 : deserializeWebhookMiniTargetField(val.target); return { id: id, type: type, target: target } satisfies WebhookMini; } export function serializeWebhooks(val: Webhooks): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: WebhookMini): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: WebhookMini): any { return serializeWebhookMini(item); }) as readonly any[] }; } export function deserializeWebhooks(val: any): Webhooks { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly WebhookMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly WebhookMini[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeWebhookMini(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies Webhooks; } export function serializeWebhookTriggersField(val: WebhookTriggersField): Json { @@ -7527,18 +7487,18 @@ export function serializeWebhook(val: Webhook): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"Webhook\""; } - return { ...base, ...{ ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["address"]: val.address, ["triggers"]: val.triggers == void 0 ? void 0 : val.triggers.map(function (item: WebhookTriggersField): any { + return { ...base, ...{ ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["address"]: val.address == void 0 ? void 0 : val.address, ["triggers"]: val.triggers == void 0 ? void 0 : val.triggers.map(function (item: WebhookTriggersField): any { return serializeWebhookTriggersField(item); }) as readonly any[] } }; } export function deserializeWebhook(val: any): Webhook { const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const address: undefined | string = isJson(val.address, "string") ? val.address : void 0; - const triggers: undefined | readonly WebhookTriggersField[] = isJson(val.triggers, "array") ? val.triggers.map(function (itm: Json): any { + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const address: undefined | string = val.address == void 0 ? void 0 : val.address; + const triggers: undefined | readonly WebhookTriggersField[] = val.triggers == void 0 ? void 0 : isJson(val.triggers, "array") ? val.triggers.map(function (itm: Json): any { return deserializeWebhookTriggersField(itm); - }) as readonly any[] : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + }) as readonly any[] : []; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WebhookMiniTypeField = val.type == void 0 ? void 0 : deserializeWebhookMiniTypeField(val.type); const target: undefined | WebhookMiniTargetField = val.target == void 0 ? void 0 : deserializeWebhookMiniTargetField(val.target); return { createdBy: createdBy, createdAt: createdAt, address: address, triggers: triggers, id: id, type: type, target: target } satisfies Webhook; @@ -7556,12 +7516,12 @@ export function deserializeWebLinkBaseTypeField(val: any): WebLinkBaseTypeField throw "".concat("Invalid value: ", val) as string; } export function serializeWebLinkBase(val: WebLinkBase): Json { - return { ["id"]: val.id, ["type"]: serializeWebLinkBaseTypeField(val.type), ["etag"]: val.etag }; + return { ["id"]: val.id, ["type"]: serializeWebLinkBaseTypeField(val.type), ["etag"]: val.etag == void 0 ? void 0 : val.etag }; } export function deserializeWebLinkBase(val: any): WebLinkBase { const id: string = val.id; const type: WebLinkBaseTypeField = deserializeWebLinkBaseTypeField(val.type); - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; return { id: id, type: type, etag: etag } satisfies WebLinkBase; } export function serializeWebLinkMini(val: WebLinkMini): Json { @@ -7569,15 +7529,15 @@ export function serializeWebLinkMini(val: WebLinkMini): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"WebLinkMini\""; } - return { ...base, ...{ ["url"]: val.url, ["sequence_id"]: val.sequenceId, ["name"]: val.name } }; + return { ...base, ...{ ["url"]: val.url == void 0 ? void 0 : val.url, ["sequence_id"]: val.sequenceId == void 0 ? void 0 : val.sequenceId, ["name"]: val.name == void 0 ? void 0 : val.name } }; } export function deserializeWebLinkMini(val: any): WebLinkMini { - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const id: string = val.id; const type: WebLinkBaseTypeField = deserializeWebLinkBaseTypeField(val.type); - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; return { url: url, sequenceId: sequenceId, name: name, id: id, type: type, etag: etag } satisfies WebLinkMini; } export function serializeFileMiniOrFolderMiniOrWebLinkMini(val: FileMiniOrFolderMiniOrWebLinkMini): Json { @@ -7623,30 +7583,30 @@ export function deserializeItemsOrderFieldDirectionField(val: any): ItemsOrderFi throw "".concat("Invalid value: ", val) as string; } export function serializeItemsOrderField(val: ItemsOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeItemsOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeItemsOrderFieldDirectionField(val.direction) }; } export function deserializeItemsOrderField(val: any): ItemsOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | ItemsOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeItemsOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies ItemsOrderField; } export function serializeItems(val: Items): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: ItemsOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: ItemsOrderField): any { return serializeItemsOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileMiniOrFolderMiniOrWebLinkMini): any { return serializeFileMiniOrFolderMiniOrWebLinkMini(item); }) as readonly any[] }; } export function deserializeItems(val: any): Items { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly ItemsOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly ItemsOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeItemsOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly FileMiniOrFolderMiniOrWebLinkMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly FileMiniOrFolderMiniOrWebLinkMini[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFileMiniOrFolderMiniOrWebLinkMini(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies Items; } export function serializeFolderPathCollectionField(val: FolderPathCollectionField): Json { @@ -7656,9 +7616,9 @@ export function serializeFolderPathCollectionField(val: FolderPathCollectionFiel } export function deserializeFolderPathCollectionField(val: any): FolderPathCollectionField { const totalCount: number = val.total_count; - const entries: readonly FolderMini[] = val.entries.map(function (itm: Json): any { + const entries: readonly FolderMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFolderMini(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies FolderPathCollectionField; } export function serializeFolderSharedLinkFieldAccessField(val: FolderSharedLinkFieldAccessField): Json { @@ -7728,17 +7688,17 @@ export function deserializeFolderSharedLinkFieldPermissionsField(val: any): Fold return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies FolderSharedLinkFieldPermissionsField; } export function serializeFolderSharedLinkField(val: FolderSharedLinkField): Json { - return { ["url"]: val.url, ["download_url"]: val.downloadUrl, ["vanity_url"]: val.vanityUrl, ["vanity_name"]: val.vanityName, ["access"]: val.access == void 0 ? void 0 : serializeFolderSharedLinkFieldAccessField(val.access), ["effective_access"]: serializeFolderSharedLinkFieldEffectiveAccessField(val.effectiveAccess), ["effective_permission"]: serializeFolderSharedLinkFieldEffectivePermissionField(val.effectivePermission), ["unshared_at"]: val.unsharedAt, ["is_password_enabled"]: val.isPasswordEnabled, ["permissions"]: val.permissions == void 0 ? void 0 : serializeFolderSharedLinkFieldPermissionsField(val.permissions), ["download_count"]: val.downloadCount, ["preview_count"]: val.previewCount }; + return { ["url"]: val.url, ["download_url"]: val.downloadUrl == void 0 ? void 0 : val.downloadUrl, ["vanity_url"]: val.vanityUrl == void 0 ? void 0 : val.vanityUrl, ["vanity_name"]: val.vanityName == void 0 ? void 0 : val.vanityName, ["access"]: val.access == void 0 ? void 0 : serializeFolderSharedLinkFieldAccessField(val.access), ["effective_access"]: serializeFolderSharedLinkFieldEffectiveAccessField(val.effectiveAccess), ["effective_permission"]: serializeFolderSharedLinkFieldEffectivePermissionField(val.effectivePermission), ["unshared_at"]: val.unsharedAt == void 0 ? void 0 : val.unsharedAt, ["is_password_enabled"]: val.isPasswordEnabled, ["permissions"]: val.permissions == void 0 ? void 0 : serializeFolderSharedLinkFieldPermissionsField(val.permissions), ["download_count"]: val.downloadCount, ["preview_count"]: val.previewCount }; } export function deserializeFolderSharedLinkField(val: any): FolderSharedLinkField { const url: string = val.url; - const downloadUrl: undefined | string = isJson(val.download_url, "string") ? val.download_url : void 0; - const vanityUrl: undefined | string = isJson(val.vanity_url, "string") ? val.vanity_url : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; + const downloadUrl: undefined | string = val.download_url == void 0 ? void 0 : val.download_url; + const vanityUrl: undefined | string = val.vanity_url == void 0 ? void 0 : val.vanity_url; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; const access: undefined | FolderSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeFolderSharedLinkFieldAccessField(val.access); const effectiveAccess: FolderSharedLinkFieldEffectiveAccessField = deserializeFolderSharedLinkFieldEffectiveAccessField(val.effective_access); const effectivePermission: FolderSharedLinkFieldEffectivePermissionField = deserializeFolderSharedLinkFieldEffectivePermissionField(val.effective_permission); - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const isPasswordEnabled: boolean = val.is_password_enabled; const permissions: undefined | FolderSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeFolderSharedLinkFieldPermissionsField(val.permissions); const downloadCount: number = val.download_count; @@ -7761,11 +7721,11 @@ export function deserializeFolderFolderUploadEmailFieldAccessField(val: any): Fo throw "".concat("Invalid value: ", val) as string; } export function serializeFolderFolderUploadEmailField(val: FolderFolderUploadEmailField): Json { - return { ["access"]: val.access == void 0 ? void 0 : serializeFolderFolderUploadEmailFieldAccessField(val.access), ["email"]: val.email }; + return { ["access"]: val.access == void 0 ? void 0 : serializeFolderFolderUploadEmailFieldAccessField(val.access), ["email"]: val.email == void 0 ? void 0 : val.email }; } export function deserializeFolderFolderUploadEmailField(val: any): FolderFolderUploadEmailField { const access: undefined | FolderFolderUploadEmailFieldAccessField = val.access == void 0 ? void 0 : deserializeFolderFolderUploadEmailFieldAccessField(val.access); - const email: undefined | string = isJson(val.email, "string") ? val.email : void 0; + const email: undefined | string = val.email == void 0 ? void 0 : val.email; return { access: access, email: email } satisfies FolderFolderUploadEmailField; } export function serializeFolderItemStatusField(val: FolderItemStatusField): Json { @@ -7791,30 +7751,30 @@ export function serializeFolder(val: Folder): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"Folder\""; } - return { ...base, ...{ ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["description"]: val.description, ["size"]: val.size, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeFolderPathCollectionField(val.pathCollection), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["content_created_at"]: val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt, ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeFolderSharedLinkField(val.sharedLink), ["folder_upload_email"]: val.folderUploadEmail == void 0 ? void 0 : serializeFolderFolderUploadEmailField(val.folderUploadEmail), ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeFolderItemStatusField(val.itemStatus), ["item_collection"]: val.itemCollection == void 0 ? void 0 : serializeItems(val.itemCollection) } }; + return { ...base, ...{ ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["description"]: val.description == void 0 ? void 0 : val.description, ["size"]: val.size == void 0 ? void 0 : val.size, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeFolderPathCollectionField(val.pathCollection), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["content_created_at"]: val.contentCreatedAt == void 0 ? void 0 : val.contentCreatedAt, ["content_modified_at"]: val.contentModifiedAt == void 0 ? void 0 : val.contentModifiedAt, ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeFolderSharedLinkField(val.sharedLink), ["folder_upload_email"]: val.folderUploadEmail == void 0 ? void 0 : serializeFolderFolderUploadEmailField(val.folderUploadEmail), ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeFolderItemStatusField(val.itemStatus), ["item_collection"]: val.itemCollection == void 0 ? void 0 : serializeItems(val.itemCollection) } }; } export function deserializeFolder(val: any): Folder { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; const pathCollection: undefined | FolderPathCollectionField = val.path_collection == void 0 ? void 0 : deserializeFolderPathCollectionField(val.path_collection); const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); const sharedLink: undefined | FolderSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeFolderSharedLinkField(val.shared_link); const folderUploadEmail: undefined | FolderFolderUploadEmailField = val.folder_upload_email == void 0 ? void 0 : deserializeFolderFolderUploadEmailField(val.folder_upload_email); const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); const itemStatus: undefined | FolderItemStatusField = val.item_status == void 0 ? void 0 : deserializeFolderItemStatusField(val.item_status); const itemCollection: undefined | Items = val.item_collection == void 0 ? void 0 : deserializeItems(val.item_collection); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FolderBaseTypeField = deserializeFolderBaseTypeField(val.type); return { createdAt: createdAt, modifiedAt: modifiedAt, description: description, size: size, pathCollection: pathCollection, createdBy: createdBy, modifiedBy: modifiedBy, trashedAt: trashedAt, purgedAt: purgedAt, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt, ownedBy: ownedBy, sharedLink: sharedLink, folderUploadEmail: folderUploadEmail, parent: parent, itemStatus: itemStatus, itemCollection: itemCollection, name: name, sequenceId: sequenceId, id: id, etag: etag, type: type } satisfies Folder; } @@ -8239,31 +8199,31 @@ export function deserializeEventAdditionalDetailsField(val: any): EventAdditiona return {} satisfies EventAdditionalDetailsField; } export function serializeEvent(val: Event): Json { - return { ["type"]: val.type, ["created_at"]: val.createdAt, ["recorded_at"]: val.recordedAt, ["event_id"]: val.eventId, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["event_type"]: val.eventType == void 0 ? void 0 : serializeEventEventTypeField(val.eventType), ["session_id"]: val.sessionId, ["source"]: val.source == void 0 ? void 0 : serializeEventSourceOrFileOrFolderOrUser(val.source), ["additional_details"]: val.additionalDetails == void 0 ? void 0 : serializeEventAdditionalDetailsField(val.additionalDetails) }; + return { ["type"]: val.type == void 0 ? void 0 : val.type, ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["recorded_at"]: val.recordedAt == void 0 ? void 0 : val.recordedAt, ["event_id"]: val.eventId == void 0 ? void 0 : val.eventId, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["event_type"]: val.eventType == void 0 ? void 0 : serializeEventEventTypeField(val.eventType), ["session_id"]: val.sessionId == void 0 ? void 0 : val.sessionId, ["source"]: val.source == void 0 ? void 0 : serializeEventSourceOrFileOrFolderOrUser(val.source), ["additional_details"]: val.additionalDetails == void 0 ? void 0 : serializeEventAdditionalDetailsField(val.additionalDetails) }; } export function deserializeEvent(val: any): Event { - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const recordedAt: undefined | string = isJson(val.recorded_at, "string") ? val.recorded_at : void 0; - const eventId: undefined | string = isJson(val.event_id, "string") ? val.event_id : void 0; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const recordedAt: undefined | string = val.recorded_at == void 0 ? void 0 : val.recorded_at; + const eventId: undefined | string = val.event_id == void 0 ? void 0 : val.event_id; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const eventType: undefined | EventEventTypeField = val.event_type == void 0 ? void 0 : deserializeEventEventTypeField(val.event_type); - const sessionId: undefined | string = isJson(val.session_id, "string") ? val.session_id : void 0; + const sessionId: undefined | string = val.session_id == void 0 ? void 0 : val.session_id; const source: undefined | EventSourceOrFileOrFolderOrUser = val.source == void 0 ? void 0 : deserializeEventSourceOrFileOrFolderOrUser(val.source); const additionalDetails: undefined | EventAdditionalDetailsField = val.additional_details == void 0 ? void 0 : deserializeEventAdditionalDetailsField(val.additional_details); return { type: type, createdAt: createdAt, recordedAt: recordedAt, eventId: eventId, createdBy: createdBy, eventType: eventType, sessionId: sessionId, source: source, additionalDetails: additionalDetails } satisfies Event; } export function serializeEvents(val: Events): Json { - return { ["chunk_size"]: val.chunkSize, ["next_stream_position"]: val.nextStreamPosition, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Event): any { + return { ["chunk_size"]: val.chunkSize == void 0 ? void 0 : val.chunkSize, ["next_stream_position"]: val.nextStreamPosition == void 0 ? void 0 : val.nextStreamPosition, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Event): any { return serializeEvent(item); }) as readonly any[] }; } export function deserializeEvents(val: any): Events { - const chunkSize: undefined | number = isJson(val.chunk_size, "number") ? val.chunk_size : void 0; - const nextStreamPosition: undefined | string = isJson(val.next_stream_position, "string") ? val.next_stream_position : void 0; - const entries: undefined | readonly Event[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const chunkSize: undefined | number = val.chunk_size == void 0 ? void 0 : val.chunk_size; + const nextStreamPosition: undefined | string = val.next_stream_position == void 0 ? void 0 : val.next_stream_position; + const entries: undefined | readonly Event[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeEvent(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { chunkSize: chunkSize, nextStreamPosition: nextStreamPosition, entries: entries } satisfies Events; } export function serializeFileOrFolder(val: FileOrFolder): Json { @@ -8290,14 +8250,14 @@ export function deserializeFileOrFolder(val: any): FileOrFolder { export function serializeMetadataQueryResults(val: MetadataQueryResults): Json { return { ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileOrFolder): any { return serializeFileOrFolder(item); - }) as readonly any[], ["limit"]: val.limit, ["next_marker"]: val.nextMarker }; + }) as readonly any[], ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker }; } export function deserializeMetadataQueryResults(val: any): MetadataQueryResults { - const entries: undefined | readonly FileOrFolder[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly FileOrFolder[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFileOrFolder(itm); - }) as readonly any[] : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | string = isJson(val.next_marker, "string") ? val.next_marker : void 0; + }) as readonly any[] : []; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | string = val.next_marker == void 0 ? void 0 : val.next_marker; return { entries: entries, limit: limit, nextMarker: nextMarker } satisfies MetadataQueryResults; } export function serializeWebhookInvocationTypeField(val: WebhookInvocationTypeField): Json { @@ -8442,14 +8402,14 @@ export function deserializeWebhookInvocationTriggerField(val: any): WebhookInvoc throw "".concat("Invalid value: ", val) as string; } export function serializeWebhookInvocation(val: WebhookInvocation): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeWebhookInvocationTypeField(val.type), ["webhook"]: val.webhook == void 0 ? void 0 : serializeWebhook(val.webhook), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt, ["trigger"]: val.trigger == void 0 ? void 0 : serializeWebhookInvocationTriggerField(val.trigger), ["source"]: val.source == void 0 ? void 0 : serializeFileOrFolder(val.source) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeWebhookInvocationTypeField(val.type), ["webhook"]: val.webhook == void 0 ? void 0 : serializeWebhook(val.webhook), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["trigger"]: val.trigger == void 0 ? void 0 : serializeWebhookInvocationTriggerField(val.trigger), ["source"]: val.source == void 0 ? void 0 : serializeFileOrFolder(val.source) }; } export function deserializeWebhookInvocation(val: any): WebhookInvocation { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WebhookInvocationTypeField = val.type == void 0 ? void 0 : deserializeWebhookInvocationTypeField(val.type); const webhook: undefined | Webhook = val.webhook == void 0 ? void 0 : deserializeWebhook(val.webhook); const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const trigger: undefined | WebhookInvocationTriggerField = val.trigger == void 0 ? void 0 : deserializeWebhookInvocationTriggerField(val.trigger); const source: undefined | FileOrFolder = val.source == void 0 ? void 0 : deserializeFileOrFolder(val.source); return { id: id, type: type, webhook: webhook, createdBy: createdBy, createdAt: createdAt, trigger: trigger, source: source } satisfies WebhookInvocation; @@ -8479,13 +8439,13 @@ export function deserializeSkillInvocationSkillFieldTypeField(val: any): SkillIn throw "".concat("Invalid value: ", val) as string; } export function serializeSkillInvocationSkillField(val: SkillInvocationSkillField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeSkillInvocationSkillFieldTypeField(val.type), ["name"]: val.name, ["api_key"]: val.apiKey }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeSkillInvocationSkillFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name, ["api_key"]: val.apiKey == void 0 ? void 0 : val.apiKey }; } export function deserializeSkillInvocationSkillField(val: any): SkillInvocationSkillField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | SkillInvocationSkillFieldTypeField = val.type == void 0 ? void 0 : deserializeSkillInvocationSkillFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const apiKey: undefined | string = isJson(val.api_key, "string") ? val.api_key : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const apiKey: undefined | string = val.api_key == void 0 ? void 0 : val.api_key; return { id: id, type: type, name: name, apiKey: apiKey } satisfies SkillInvocationSkillField; } export function serializeSkillInvocationTokenFieldReadFieldTokenTypeField(val: SkillInvocationTokenFieldReadFieldTokenTypeField): Json { @@ -8501,13 +8461,13 @@ export function deserializeSkillInvocationTokenFieldReadFieldTokenTypeField(val: throw "".concat("Invalid value: ", val) as string; } export function serializeSkillInvocationTokenFieldReadField(val: SkillInvocationTokenFieldReadField): Json { - return { ["access_token"]: val.accessToken, ["expires_in"]: val.expiresIn, ["token_type"]: val.tokenType == void 0 ? void 0 : serializeSkillInvocationTokenFieldReadFieldTokenTypeField(val.tokenType), ["restricted_to"]: val.restrictedTo }; + return { ["access_token"]: val.accessToken == void 0 ? void 0 : val.accessToken, ["expires_in"]: val.expiresIn == void 0 ? void 0 : val.expiresIn, ["token_type"]: val.tokenType == void 0 ? void 0 : serializeSkillInvocationTokenFieldReadFieldTokenTypeField(val.tokenType), ["restricted_to"]: val.restrictedTo == void 0 ? void 0 : val.restrictedTo }; } export function deserializeSkillInvocationTokenFieldReadField(val: any): SkillInvocationTokenFieldReadField { - const accessToken: undefined | string = isJson(val.access_token, "string") ? val.access_token : void 0; - const expiresIn: undefined | number = isJson(val.expires_in, "number") ? val.expires_in : void 0; + const accessToken: undefined | string = val.access_token == void 0 ? void 0 : val.access_token; + const expiresIn: undefined | number = val.expires_in == void 0 ? void 0 : val.expires_in; const tokenType: undefined | SkillInvocationTokenFieldReadFieldTokenTypeField = val.token_type == void 0 ? void 0 : deserializeSkillInvocationTokenFieldReadFieldTokenTypeField(val.token_type); - const restrictedTo: undefined | string = isJson(val.restricted_to, "string") ? val.restricted_to : void 0; + const restrictedTo: undefined | string = val.restricted_to == void 0 ? void 0 : val.restricted_to; return { accessToken: accessToken, expiresIn: expiresIn, tokenType: tokenType, restrictedTo: restrictedTo } satisfies SkillInvocationTokenFieldReadField; } export function serializeSkillInvocationTokenFieldWriteFieldTokenTypeField(val: SkillInvocationTokenFieldWriteFieldTokenTypeField): Json { @@ -8523,13 +8483,13 @@ export function deserializeSkillInvocationTokenFieldWriteFieldTokenTypeField(val throw "".concat("Invalid value: ", val) as string; } export function serializeSkillInvocationTokenFieldWriteField(val: SkillInvocationTokenFieldWriteField): Json { - return { ["access_token"]: val.accessToken, ["expires_in"]: val.expiresIn, ["token_type"]: val.tokenType == void 0 ? void 0 : serializeSkillInvocationTokenFieldWriteFieldTokenTypeField(val.tokenType), ["restricted_to"]: val.restrictedTo }; + return { ["access_token"]: val.accessToken == void 0 ? void 0 : val.accessToken, ["expires_in"]: val.expiresIn == void 0 ? void 0 : val.expiresIn, ["token_type"]: val.tokenType == void 0 ? void 0 : serializeSkillInvocationTokenFieldWriteFieldTokenTypeField(val.tokenType), ["restricted_to"]: val.restrictedTo == void 0 ? void 0 : val.restrictedTo }; } export function deserializeSkillInvocationTokenFieldWriteField(val: any): SkillInvocationTokenFieldWriteField { - const accessToken: undefined | string = isJson(val.access_token, "string") ? val.access_token : void 0; - const expiresIn: undefined | number = isJson(val.expires_in, "number") ? val.expires_in : void 0; + const accessToken: undefined | string = val.access_token == void 0 ? void 0 : val.access_token; + const expiresIn: undefined | number = val.expires_in == void 0 ? void 0 : val.expires_in; const tokenType: undefined | SkillInvocationTokenFieldWriteFieldTokenTypeField = val.token_type == void 0 ? void 0 : deserializeSkillInvocationTokenFieldWriteFieldTokenTypeField(val.token_type); - const restrictedTo: undefined | string = isJson(val.restricted_to, "string") ? val.restricted_to : void 0; + const restrictedTo: undefined | string = val.restricted_to == void 0 ? void 0 : val.restricted_to; return { accessToken: accessToken, expiresIn: expiresIn, tokenType: tokenType, restrictedTo: restrictedTo } satisfies SkillInvocationTokenFieldWriteField; } export function serializeSkillInvocationTokenField(val: SkillInvocationTokenField): Json { @@ -8565,13 +8525,13 @@ export function deserializeSkillInvocationStatusFieldStateField(val: any): Skill throw "".concat("Invalid value: ", val) as string; } export function serializeSkillInvocationStatusField(val: SkillInvocationStatusField): Json { - return { ["state"]: val.state == void 0 ? void 0 : serializeSkillInvocationStatusFieldStateField(val.state), ["message"]: val.message, ["error_code"]: val.errorCode, ["additional_info"]: val.additionalInfo }; + return { ["state"]: val.state == void 0 ? void 0 : serializeSkillInvocationStatusFieldStateField(val.state), ["message"]: val.message == void 0 ? void 0 : val.message, ["error_code"]: val.errorCode == void 0 ? void 0 : val.errorCode, ["additional_info"]: val.additionalInfo == void 0 ? void 0 : val.additionalInfo }; } export function deserializeSkillInvocationStatusField(val: any): SkillInvocationStatusField { const state: undefined | SkillInvocationStatusFieldStateField = val.state == void 0 ? void 0 : deserializeSkillInvocationStatusFieldStateField(val.state); - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; - const errorCode: undefined | string = isJson(val.error_code, "string") ? val.error_code : void 0; - const additionalInfo: undefined | string = isJson(val.additional_info, "string") ? val.additional_info : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; + const errorCode: undefined | string = val.error_code == void 0 ? void 0 : val.error_code; + const additionalInfo: undefined | string = val.additional_info == void 0 ? void 0 : val.additional_info; return { state: state, message: message, errorCode: errorCode, additionalInfo: additionalInfo } satisfies SkillInvocationStatusField; } export function serializeSkillInvocationEnterpriseFieldTypeField(val: SkillInvocationEnterpriseFieldTypeField): Json { @@ -8587,25 +8547,25 @@ export function deserializeSkillInvocationEnterpriseFieldTypeField(val: any): Sk throw "".concat("Invalid value: ", val) as string; } export function serializeSkillInvocationEnterpriseField(val: SkillInvocationEnterpriseField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeSkillInvocationEnterpriseFieldTypeField(val.type), ["name"]: val.name }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeSkillInvocationEnterpriseFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeSkillInvocationEnterpriseField(val: any): SkillInvocationEnterpriseField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | SkillInvocationEnterpriseFieldTypeField = val.type == void 0 ? void 0 : deserializeSkillInvocationEnterpriseFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { id: id, type: type, name: name } satisfies SkillInvocationEnterpriseField; } export function serializeSkillInvocation(val: SkillInvocation): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeSkillInvocationTypeField(val.type), ["id"]: val.id, ["skill"]: val.skill == void 0 ? void 0 : serializeSkillInvocationSkillField(val.skill), ["token"]: val.token == void 0 ? void 0 : serializeSkillInvocationTokenField(val.token), ["status"]: val.status == void 0 ? void 0 : serializeSkillInvocationStatusField(val.status), ["created_at"]: val.createdAt, ["trigger"]: val.trigger, ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeSkillInvocationEnterpriseField(val.enterprise), ["source"]: val.source == void 0 ? void 0 : serializeFileOrFolder(val.source), ["event"]: val.event == void 0 ? void 0 : serializeEvent(val.event) }; + return { ["type"]: val.type == void 0 ? void 0 : serializeSkillInvocationTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id, ["skill"]: val.skill == void 0 ? void 0 : serializeSkillInvocationSkillField(val.skill), ["token"]: val.token == void 0 ? void 0 : serializeSkillInvocationTokenField(val.token), ["status"]: val.status == void 0 ? void 0 : serializeSkillInvocationStatusField(val.status), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["trigger"]: val.trigger == void 0 ? void 0 : val.trigger, ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeSkillInvocationEnterpriseField(val.enterprise), ["source"]: val.source == void 0 ? void 0 : serializeFileOrFolder(val.source), ["event"]: val.event == void 0 ? void 0 : serializeEvent(val.event) }; } export function deserializeSkillInvocation(val: any): SkillInvocation { const type: undefined | SkillInvocationTypeField = val.type == void 0 ? void 0 : deserializeSkillInvocationTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const skill: undefined | SkillInvocationSkillField = val.skill == void 0 ? void 0 : deserializeSkillInvocationSkillField(val.skill); const token: undefined | SkillInvocationTokenField = val.token == void 0 ? void 0 : deserializeSkillInvocationTokenField(val.token); const status: undefined | SkillInvocationStatusField = val.status == void 0 ? void 0 : deserializeSkillInvocationStatusField(val.status); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const trigger: undefined | string = isJson(val.trigger, "string") ? val.trigger : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const trigger: undefined | string = val.trigger == void 0 ? void 0 : val.trigger; const enterprise: undefined | SkillInvocationEnterpriseField = val.enterprise == void 0 ? void 0 : deserializeSkillInvocationEnterpriseField(val.enterprise); const source: undefined | FileOrFolder = val.source == void 0 ? void 0 : deserializeFileOrFolder(val.source); const event: undefined | Event = val.event == void 0 ? void 0 : deserializeEvent(val.event); @@ -8630,7 +8590,7 @@ export function deserializeFolderFullSyncStateField(val: any): FolderFullSyncSta throw "".concat("Invalid value: ", val) as string; } export function serializeFolderFullPermissionsField(val: FolderFullPermissionsField): Json { - return { ["can_delete"]: val.canDelete, ["can_download"]: val.canDownload, ["can_invite_collaborator"]: val.canInviteCollaborator, ["can_rename"]: val.canRename, ["can_set_share_access"]: val.canSetShareAccess, ["can_share"]: val.canShare, ["can_upload"]: val.canUpload }; + return { ["can_delete"]: val.canDelete, ["can_download"]: val.canDownload, ["can_invite_collaborator"]: val.canInviteCollaborator, ["can_rename"]: val.canRename, ["can_set_share_access"]: val.canSetShareAccess, ["can_share"]: val.canShare, ["can_upload"]: val.canUpload == void 0 ? void 0 : val.canUpload }; } export function deserializeFolderFullPermissionsField(val: any): FolderFullPermissionsField { const canDelete: boolean = val.can_delete; @@ -8639,14 +8599,19 @@ export function deserializeFolderFullPermissionsField(val: any): FolderFullPermi const canRename: boolean = val.can_rename; const canSetShareAccess: boolean = val.can_set_share_access; const canShare: boolean = val.can_share; - const canUpload: undefined | boolean = isJson(val.can_upload, "boolean") ? val.can_upload : void 0; + const canUpload: undefined | boolean = val.can_upload == void 0 ? void 0 : val.can_upload; return { canDelete: canDelete, canDownload: canDownload, canInviteCollaborator: canInviteCollaborator, canRename: canRename, canSetShareAccess: canSetShareAccess, canShare: canShare, canUpload: canUpload } satisfies FolderFullPermissionsField; } export function serializeFolderFullMetadataField(val: FolderFullMetadataField): Json { - return {}; + return { ...{}, ...val.extraData }; } export function deserializeFolderFullMetadataField(val: any): FolderFullMetadataField { - return {} satisfies FolderFullMetadataField; + const extraData: undefined | { + readonly [key: string]: { + readonly [key: string]: Metadata; + }; + } = val == void 0 ? void 0 : val; + return { extraData: extraData } satisfies FolderFullMetadataField; } export function serializeFolderFullAllowedSharedLinkAccessLevelsField(val: FolderFullAllowedSharedLinkAccessLevelsField): Json { return val; @@ -8697,19 +8662,19 @@ export function deserializeFolderFullAllowedInviteeRolesField(val: any): FolderF throw "".concat("Invalid value: ", val) as string; } export function serializeFolderFullWatermarkInfoField(val: FolderFullWatermarkInfoField): Json { - return { ["is_watermarked"]: val.isWatermarked }; + return { ["is_watermarked"]: val.isWatermarked == void 0 ? void 0 : val.isWatermarked }; } export function deserializeFolderFullWatermarkInfoField(val: any): FolderFullWatermarkInfoField { - const isWatermarked: undefined | boolean = isJson(val.is_watermarked, "boolean") ? val.is_watermarked : void 0; + const isWatermarked: undefined | boolean = val.is_watermarked == void 0 ? void 0 : val.is_watermarked; return { isWatermarked: isWatermarked } satisfies FolderFullWatermarkInfoField; } export function serializeFolderFullClassificationField(val: FolderFullClassificationField): Json { - return { ["name"]: val.name, ["definition"]: val.definition, ["color"]: val.color }; + return { ["name"]: val.name == void 0 ? void 0 : val.name, ["definition"]: val.definition == void 0 ? void 0 : val.definition, ["color"]: val.color == void 0 ? void 0 : val.color }; } export function deserializeFolderFullClassificationField(val: any): FolderFullClassificationField { - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const definition: undefined | string = isJson(val.definition, "string") ? val.definition : void 0; - const color: undefined | string = isJson(val.color, "string") ? val.color : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const definition: undefined | string = val.definition == void 0 ? void 0 : val.definition; + const color: undefined | string = val.color == void 0 ? void 0 : val.color; return { name: name, definition: definition, color: color } satisfies FolderFullClassificationField; } export function serializeFolderFull(val: FolderFull): Json { @@ -8717,56 +8682,56 @@ export function serializeFolderFull(val: FolderFull): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"FolderFull\""; } - return { ...base, ...{ ["sync_state"]: val.syncState == void 0 ? void 0 : serializeFolderFullSyncStateField(val.syncState), ["has_collaborations"]: val.hasCollaborations, ["permissions"]: val.permissions == void 0 ? void 0 : serializeFolderFullPermissionsField(val.permissions), ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): undefined { - return void 0; - }) as readonly any[], ["can_non_owners_invite"]: val.canNonOwnersInvite, ["is_externally_owned"]: val.isExternallyOwned, ["metadata"]: val.metadata == void 0 ? void 0 : serializeFolderFullMetadataField(val.metadata), ["is_collaboration_restricted_to_enterprise"]: val.isCollaborationRestrictedToEnterprise, ["allowed_shared_link_access_levels"]: val.allowedSharedLinkAccessLevels == void 0 ? void 0 : val.allowedSharedLinkAccessLevels.map(function (item: FolderFullAllowedSharedLinkAccessLevelsField): any { + return { ...base, ...{ ["sync_state"]: val.syncState == void 0 ? void 0 : serializeFolderFullSyncStateField(val.syncState), ["has_collaborations"]: val.hasCollaborations == void 0 ? void 0 : val.hasCollaborations, ["permissions"]: val.permissions == void 0 ? void 0 : serializeFolderFullPermissionsField(val.permissions), ["tags"]: val.tags == void 0 ? void 0 : val.tags.map(function (item: string): string { + return item; + }) as readonly any[], ["can_non_owners_invite"]: val.canNonOwnersInvite == void 0 ? void 0 : val.canNonOwnersInvite, ["is_externally_owned"]: val.isExternallyOwned == void 0 ? void 0 : val.isExternallyOwned, ["metadata"]: val.metadata == void 0 ? void 0 : serializeFolderFullMetadataField(val.metadata), ["is_collaboration_restricted_to_enterprise"]: val.isCollaborationRestrictedToEnterprise == void 0 ? void 0 : val.isCollaborationRestrictedToEnterprise, ["allowed_shared_link_access_levels"]: val.allowedSharedLinkAccessLevels == void 0 ? void 0 : val.allowedSharedLinkAccessLevels.map(function (item: FolderFullAllowedSharedLinkAccessLevelsField): any { return serializeFolderFullAllowedSharedLinkAccessLevelsField(item); }) as readonly any[], ["allowed_invitee_roles"]: val.allowedInviteeRoles == void 0 ? void 0 : val.allowedInviteeRoles.map(function (item: FolderFullAllowedInviteeRolesField): any { return serializeFolderFullAllowedInviteeRolesField(item); - }) as readonly any[], ["watermark_info"]: val.watermarkInfo == void 0 ? void 0 : serializeFolderFullWatermarkInfoField(val.watermarkInfo), ["is_accessible_via_shared_link"]: val.isAccessibleViaSharedLink, ["can_non_owners_view_collaborators"]: val.canNonOwnersViewCollaborators, ["classification"]: val.classification == void 0 ? void 0 : serializeFolderFullClassificationField(val.classification) } }; + }) as readonly any[], ["watermark_info"]: val.watermarkInfo == void 0 ? void 0 : serializeFolderFullWatermarkInfoField(val.watermarkInfo), ["is_accessible_via_shared_link"]: val.isAccessibleViaSharedLink == void 0 ? void 0 : val.isAccessibleViaSharedLink, ["can_non_owners_view_collaborators"]: val.canNonOwnersViewCollaborators == void 0 ? void 0 : val.canNonOwnersViewCollaborators, ["classification"]: val.classification == void 0 ? void 0 : serializeFolderFullClassificationField(val.classification) } }; } export function deserializeFolderFull(val: any): FolderFull { const syncState: undefined | FolderFullSyncStateField = val.sync_state == void 0 ? void 0 : deserializeFolderFullSyncStateField(val.sync_state); - const hasCollaborations: undefined | boolean = isJson(val.has_collaborations, "boolean") ? val.has_collaborations : void 0; + const hasCollaborations: undefined | boolean = val.has_collaborations == void 0 ? void 0 : val.has_collaborations; const permissions: undefined | FolderFullPermissionsField = val.permissions == void 0 ? void 0 : deserializeFolderFullPermissionsField(val.permissions); - const tags: undefined | readonly string[] = isJson(val.tags, "array") ? val.tags.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; - const canNonOwnersInvite: undefined | boolean = isJson(val.can_non_owners_invite, "boolean") ? val.can_non_owners_invite : void 0; - const isExternallyOwned: undefined | boolean = isJson(val.is_externally_owned, "boolean") ? val.is_externally_owned : void 0; + const tags: undefined | readonly string[] = val.tags == void 0 ? void 0 : isJson(val.tags, "array") ? val.tags.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; + const canNonOwnersInvite: undefined | boolean = val.can_non_owners_invite == void 0 ? void 0 : val.can_non_owners_invite; + const isExternallyOwned: undefined | boolean = val.is_externally_owned == void 0 ? void 0 : val.is_externally_owned; const metadata: undefined | FolderFullMetadataField = val.metadata == void 0 ? void 0 : deserializeFolderFullMetadataField(val.metadata); - const isCollaborationRestrictedToEnterprise: undefined | boolean = isJson(val.is_collaboration_restricted_to_enterprise, "boolean") ? val.is_collaboration_restricted_to_enterprise : void 0; - const allowedSharedLinkAccessLevels: undefined | readonly FolderFullAllowedSharedLinkAccessLevelsField[] = isJson(val.allowed_shared_link_access_levels, "array") ? val.allowed_shared_link_access_levels.map(function (itm: Json): any { + const isCollaborationRestrictedToEnterprise: undefined | boolean = val.is_collaboration_restricted_to_enterprise == void 0 ? void 0 : val.is_collaboration_restricted_to_enterprise; + const allowedSharedLinkAccessLevels: undefined | readonly FolderFullAllowedSharedLinkAccessLevelsField[] = val.allowed_shared_link_access_levels == void 0 ? void 0 : isJson(val.allowed_shared_link_access_levels, "array") ? val.allowed_shared_link_access_levels.map(function (itm: Json): any { return deserializeFolderFullAllowedSharedLinkAccessLevelsField(itm); - }) as readonly any[] : void 0; - const allowedInviteeRoles: undefined | readonly FolderFullAllowedInviteeRolesField[] = isJson(val.allowed_invitee_roles, "array") ? val.allowed_invitee_roles.map(function (itm: Json): any { + }) as readonly any[] : []; + const allowedInviteeRoles: undefined | readonly FolderFullAllowedInviteeRolesField[] = val.allowed_invitee_roles == void 0 ? void 0 : isJson(val.allowed_invitee_roles, "array") ? val.allowed_invitee_roles.map(function (itm: Json): any { return deserializeFolderFullAllowedInviteeRolesField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; const watermarkInfo: undefined | FolderFullWatermarkInfoField = val.watermark_info == void 0 ? void 0 : deserializeFolderFullWatermarkInfoField(val.watermark_info); - const isAccessibleViaSharedLink: undefined | boolean = isJson(val.is_accessible_via_shared_link, "boolean") ? val.is_accessible_via_shared_link : void 0; - const canNonOwnersViewCollaborators: undefined | boolean = isJson(val.can_non_owners_view_collaborators, "boolean") ? val.can_non_owners_view_collaborators : void 0; + const isAccessibleViaSharedLink: undefined | boolean = val.is_accessible_via_shared_link == void 0 ? void 0 : val.is_accessible_via_shared_link; + const canNonOwnersViewCollaborators: undefined | boolean = val.can_non_owners_view_collaborators == void 0 ? void 0 : val.can_non_owners_view_collaborators; const classification: undefined | FolderFullClassificationField = val.classification == void 0 ? void 0 : deserializeFolderFullClassificationField(val.classification); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const size: undefined | number = isJson(val.size, "number") ? val.size : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const size: undefined | number = val.size == void 0 ? void 0 : val.size; const pathCollection: undefined | FolderPathCollectionField = val.path_collection == void 0 ? void 0 : deserializeFolderPathCollectionField(val.path_collection); const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; - const contentCreatedAt: undefined | string = isJson(val.content_created_at, "string") ? val.content_created_at : void 0; - const contentModifiedAt: undefined | string = isJson(val.content_modified_at, "string") ? val.content_modified_at : void 0; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; + const contentCreatedAt: undefined | string = val.content_created_at == void 0 ? void 0 : val.content_created_at; + const contentModifiedAt: undefined | string = val.content_modified_at == void 0 ? void 0 : val.content_modified_at; const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); const sharedLink: undefined | FolderSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeFolderSharedLinkField(val.shared_link); const folderUploadEmail: undefined | FolderFolderUploadEmailField = val.folder_upload_email == void 0 ? void 0 : deserializeFolderFolderUploadEmailField(val.folder_upload_email); const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); const itemStatus: undefined | FolderItemStatusField = val.item_status == void 0 ? void 0 : deserializeFolderItemStatusField(val.item_status); const itemCollection: undefined | Items = val.item_collection == void 0 ? void 0 : deserializeItems(val.item_collection); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; const id: string = val.id; - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; const type: FolderBaseTypeField = deserializeFolderBaseTypeField(val.type); return { syncState: syncState, hasCollaborations: hasCollaborations, permissions: permissions, tags: tags, canNonOwnersInvite: canNonOwnersInvite, isExternallyOwned: isExternallyOwned, metadata: metadata, isCollaborationRestrictedToEnterprise: isCollaborationRestrictedToEnterprise, allowedSharedLinkAccessLevels: allowedSharedLinkAccessLevels, allowedInviteeRoles: allowedInviteeRoles, watermarkInfo: watermarkInfo, isAccessibleViaSharedLink: isAccessibleViaSharedLink, canNonOwnersViewCollaborators: canNonOwnersViewCollaborators, classification: classification, createdAt: createdAt, modifiedAt: modifiedAt, description: description, size: size, pathCollection: pathCollection, createdBy: createdBy, modifiedBy: modifiedBy, trashedAt: trashedAt, purgedAt: purgedAt, contentCreatedAt: contentCreatedAt, contentModifiedAt: contentModifiedAt, ownedBy: ownedBy, sharedLink: sharedLink, folderUploadEmail: folderUploadEmail, parent: parent, itemStatus: itemStatus, itemCollection: itemCollection, name: name, sequenceId: sequenceId, id: id, etag: etag, type: type } satisfies FolderFull; } @@ -8777,9 +8742,9 @@ export function serializeWebLinkPathCollectionField(val: WebLinkPathCollectionFi } export function deserializeWebLinkPathCollectionField(val: any): WebLinkPathCollectionField { const totalCount: number = val.total_count; - const entries: readonly FolderMini[] = val.entries.map(function (itm: Json): any { + const entries: readonly FolderMini[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFolderMini(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { totalCount: totalCount, entries: entries } satisfies WebLinkPathCollectionField; } export function serializeWebLinkSharedLinkFieldAccessField(val: WebLinkSharedLinkFieldAccessField): Json { @@ -8849,17 +8814,17 @@ export function deserializeWebLinkSharedLinkFieldPermissionsField(val: any): Web return { canDownload: canDownload, canPreview: canPreview, canEdit: canEdit } satisfies WebLinkSharedLinkFieldPermissionsField; } export function serializeWebLinkSharedLinkField(val: WebLinkSharedLinkField): Json { - return { ["url"]: val.url, ["download_url"]: val.downloadUrl, ["vanity_url"]: val.vanityUrl, ["vanity_name"]: val.vanityName, ["access"]: val.access == void 0 ? void 0 : serializeWebLinkSharedLinkFieldAccessField(val.access), ["effective_access"]: serializeWebLinkSharedLinkFieldEffectiveAccessField(val.effectiveAccess), ["effective_permission"]: serializeWebLinkSharedLinkFieldEffectivePermissionField(val.effectivePermission), ["unshared_at"]: val.unsharedAt, ["is_password_enabled"]: val.isPasswordEnabled, ["permissions"]: val.permissions == void 0 ? void 0 : serializeWebLinkSharedLinkFieldPermissionsField(val.permissions), ["download_count"]: val.downloadCount, ["preview_count"]: val.previewCount }; + return { ["url"]: val.url, ["download_url"]: val.downloadUrl == void 0 ? void 0 : val.downloadUrl, ["vanity_url"]: val.vanityUrl == void 0 ? void 0 : val.vanityUrl, ["vanity_name"]: val.vanityName == void 0 ? void 0 : val.vanityName, ["access"]: val.access == void 0 ? void 0 : serializeWebLinkSharedLinkFieldAccessField(val.access), ["effective_access"]: serializeWebLinkSharedLinkFieldEffectiveAccessField(val.effectiveAccess), ["effective_permission"]: serializeWebLinkSharedLinkFieldEffectivePermissionField(val.effectivePermission), ["unshared_at"]: val.unsharedAt == void 0 ? void 0 : val.unsharedAt, ["is_password_enabled"]: val.isPasswordEnabled, ["permissions"]: val.permissions == void 0 ? void 0 : serializeWebLinkSharedLinkFieldPermissionsField(val.permissions), ["download_count"]: val.downloadCount, ["preview_count"]: val.previewCount }; } export function deserializeWebLinkSharedLinkField(val: any): WebLinkSharedLinkField { const url: string = val.url; - const downloadUrl: undefined | string = isJson(val.download_url, "string") ? val.download_url : void 0; - const vanityUrl: undefined | string = isJson(val.vanity_url, "string") ? val.vanity_url : void 0; - const vanityName: undefined | string = isJson(val.vanity_name, "string") ? val.vanity_name : void 0; + const downloadUrl: undefined | string = val.download_url == void 0 ? void 0 : val.download_url; + const vanityUrl: undefined | string = val.vanity_url == void 0 ? void 0 : val.vanity_url; + const vanityName: undefined | string = val.vanity_name == void 0 ? void 0 : val.vanity_name; const access: undefined | WebLinkSharedLinkFieldAccessField = val.access == void 0 ? void 0 : deserializeWebLinkSharedLinkFieldAccessField(val.access); const effectiveAccess: WebLinkSharedLinkFieldEffectiveAccessField = deserializeWebLinkSharedLinkFieldEffectiveAccessField(val.effective_access); const effectivePermission: WebLinkSharedLinkFieldEffectivePermissionField = deserializeWebLinkSharedLinkFieldEffectivePermissionField(val.effective_permission); - const unsharedAt: undefined | string = isJson(val.unshared_at, "string") ? val.unshared_at : void 0; + const unsharedAt: undefined | string = val.unshared_at == void 0 ? void 0 : val.unshared_at; const isPasswordEnabled: boolean = val.is_password_enabled; const permissions: undefined | WebLinkSharedLinkFieldPermissionsField = val.permissions == void 0 ? void 0 : deserializeWebLinkSharedLinkFieldPermissionsField(val.permissions); const downloadCount: number = val.download_count; @@ -8889,27 +8854,27 @@ export function serializeWebLink(val: WebLink): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"WebLink\""; } - return { ...base, ...{ ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["description"]: val.description, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeWebLinkPathCollectionField(val.pathCollection), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["trashed_at"]: val.trashedAt, ["purged_at"]: val.purgedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeWebLinkSharedLinkField(val.sharedLink), ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeWebLinkItemStatusField(val.itemStatus) } }; + return { ...base, ...{ ["parent"]: val.parent == void 0 ? void 0 : serializeFolderMini(val.parent), ["description"]: val.description == void 0 ? void 0 : val.description, ["path_collection"]: val.pathCollection == void 0 ? void 0 : serializeWebLinkPathCollectionField(val.pathCollection), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["trashed_at"]: val.trashedAt == void 0 ? void 0 : val.trashedAt, ["purged_at"]: val.purgedAt == void 0 ? void 0 : val.purgedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserMini(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserMini(val.modifiedBy), ["owned_by"]: val.ownedBy == void 0 ? void 0 : serializeUserMini(val.ownedBy), ["shared_link"]: val.sharedLink == void 0 ? void 0 : serializeWebLinkSharedLinkField(val.sharedLink), ["item_status"]: val.itemStatus == void 0 ? void 0 : serializeWebLinkItemStatusField(val.itemStatus) } }; } export function deserializeWebLink(val: any): WebLink { const parent: undefined | FolderMini = val.parent == void 0 ? void 0 : deserializeFolderMini(val.parent); - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; const pathCollection: undefined | WebLinkPathCollectionField = val.path_collection == void 0 ? void 0 : deserializeWebLinkPathCollectionField(val.path_collection); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const trashedAt: undefined | string = isJson(val.trashed_at, "string") ? val.trashed_at : void 0; - const purgedAt: undefined | string = isJson(val.purged_at, "string") ? val.purged_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const trashedAt: undefined | string = val.trashed_at == void 0 ? void 0 : val.trashed_at; + const purgedAt: undefined | string = val.purged_at == void 0 ? void 0 : val.purged_at; const createdBy: undefined | UserMini = val.created_by == void 0 ? void 0 : deserializeUserMini(val.created_by); const modifiedBy: undefined | UserMini = val.modified_by == void 0 ? void 0 : deserializeUserMini(val.modified_by); const ownedBy: undefined | UserMini = val.owned_by == void 0 ? void 0 : deserializeUserMini(val.owned_by); const sharedLink: undefined | WebLinkSharedLinkField = val.shared_link == void 0 ? void 0 : deserializeWebLinkSharedLinkField(val.shared_link); const itemStatus: undefined | WebLinkItemStatusField = val.item_status == void 0 ? void 0 : deserializeWebLinkItemStatusField(val.item_status); - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; - const sequenceId: undefined | string = isJson(val.sequence_id, "string") ? val.sequence_id : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; + const sequenceId: undefined | string = val.sequence_id == void 0 ? void 0 : val.sequence_id; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const id: string = val.id; const type: WebLinkBaseTypeField = deserializeWebLinkBaseTypeField(val.type); - const etag: undefined | string = isJson(val.etag, "string") ? val.etag : void 0; + const etag: undefined | string = val.etag == void 0 ? void 0 : val.etag; return { parent: parent, description: description, pathCollection: pathCollection, createdAt: createdAt, modifiedAt: modifiedAt, trashedAt: trashedAt, purgedAt: purgedAt, createdBy: createdBy, modifiedBy: modifiedBy, ownedBy: ownedBy, sharedLink: sharedLink, itemStatus: itemStatus, url: url, sequenceId: sequenceId, name: name, id: id, type: type, etag: etag } satisfies WebLink; } export function serializeFileOrFolderOrWebLink(val: FileOrFolderOrWebLink): Json { @@ -8940,12 +8905,12 @@ export function deserializeFileOrFolderOrWebLink(val: any): FileOrFolderOrWebLin throw "unknown type"; } export function serializeSearchResultWithSharedLink(val: SearchResultWithSharedLink): Json { - return { ["accessible_via_shared_link"]: val.accessibleViaSharedLink, ["item"]: val.item == void 0 ? void 0 : serializeFileOrFolderOrWebLink(val.item), ["type"]: val.type }; + return { ["accessible_via_shared_link"]: val.accessibleViaSharedLink == void 0 ? void 0 : val.accessibleViaSharedLink, ["item"]: val.item == void 0 ? void 0 : serializeFileOrFolderOrWebLink(val.item), ["type"]: val.type == void 0 ? void 0 : val.type }; } export function deserializeSearchResultWithSharedLink(val: any): SearchResultWithSharedLink { - const accessibleViaSharedLink: undefined | string = isJson(val.accessible_via_shared_link, "string") ? val.accessible_via_shared_link : void 0; + const accessibleViaSharedLink: undefined | string = val.accessible_via_shared_link == void 0 ? void 0 : val.accessible_via_shared_link; const item: undefined | FileOrFolderOrWebLink = val.item == void 0 ? void 0 : deserializeFileOrFolderOrWebLink(val.item); - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; return { accessibleViaSharedLink: accessibleViaSharedLink, item: item, type: type } satisfies SearchResultWithSharedLink; } export function serializeSearchResultsWithSharedLinksTypeField(val: SearchResultsWithSharedLinksTypeField): Json { @@ -8961,18 +8926,18 @@ export function deserializeSearchResultsWithSharedLinksTypeField(val: any): Sear throw "".concat("Invalid value: ", val) as string; } export function serializeSearchResultsWithSharedLinks(val: SearchResultsWithSharedLinks): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["type"]: val.type == void 0 ? void 0 : serializeSearchResultsWithSharedLinksTypeField(val.type), ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: SearchResultWithSharedLink): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["type"]: val.type == void 0 ? void 0 : serializeSearchResultsWithSharedLinksTypeField(val.type), ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: SearchResultWithSharedLink): any { return serializeSearchResultWithSharedLink(item); }) as readonly any[] }; } export function deserializeSearchResultsWithSharedLinks(val: any): SearchResultsWithSharedLinks { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; const type: undefined | SearchResultsWithSharedLinksTypeField = val.type == void 0 ? void 0 : deserializeSearchResultsWithSharedLinksTypeField(val.type); - const entries: undefined | readonly SearchResultWithSharedLink[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly SearchResultWithSharedLink[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeSearchResultWithSharedLink(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, type: type, entries: entries } satisfies SearchResultsWithSharedLinks; } export function serializeSearchResultsTypeField(val: SearchResultsTypeField): Json { @@ -8988,18 +8953,18 @@ export function deserializeSearchResultsTypeField(val: any): SearchResultsTypeFi throw "".concat("Invalid value: ", val) as string; } export function serializeSearchResults(val: SearchResults): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["type"]: val.type == void 0 ? void 0 : serializeSearchResultsTypeField(val.type), ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileOrFolderOrWebLink): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["type"]: val.type == void 0 ? void 0 : serializeSearchResultsTypeField(val.type), ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileOrFolderOrWebLink): any { return serializeFileOrFolderOrWebLink(item); }) as readonly any[] }; } export function deserializeSearchResults(val: any): SearchResults { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; const type: undefined | SearchResultsTypeField = val.type == void 0 ? void 0 : deserializeSearchResultsTypeField(val.type); - const entries: undefined | readonly FileOrFolderOrWebLink[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const entries: undefined | readonly FileOrFolderOrWebLink[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFileOrFolderOrWebLink(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, type: type, entries: entries } satisfies SearchResults; } export function serializeSearchResultsOrSearchResultsWithSharedLinks(val: SearchResultsOrSearchResultsWithSharedLinks): Json { @@ -9033,28 +8998,28 @@ export function deserializeRecentItemInteractionTypeField(val: any): RecentItemI throw "".concat("Invalid value: ", val) as string; } export function serializeRecentItem(val: RecentItem): Json { - return { ["type"]: val.type, ["item"]: val.item == void 0 ? void 0 : serializeFileOrFolderOrWebLink(val.item), ["interaction_type"]: val.interactionType == void 0 ? void 0 : serializeRecentItemInteractionTypeField(val.interactionType), ["interacted_at"]: val.interactedAt, ["interaction_shared_link"]: val.interactionSharedLink }; + return { ["type"]: val.type == void 0 ? void 0 : val.type, ["item"]: val.item == void 0 ? void 0 : serializeFileOrFolderOrWebLink(val.item), ["interaction_type"]: val.interactionType == void 0 ? void 0 : serializeRecentItemInteractionTypeField(val.interactionType), ["interacted_at"]: val.interactedAt == void 0 ? void 0 : val.interactedAt, ["interaction_shared_link"]: val.interactionSharedLink == void 0 ? void 0 : val.interactionSharedLink }; } export function deserializeRecentItem(val: any): RecentItem { - const type: undefined | string = isJson(val.type, "string") ? val.type : void 0; + const type: undefined | string = val.type == void 0 ? void 0 : val.type; const item: undefined | FileOrFolderOrWebLink = val.item == void 0 ? void 0 : deserializeFileOrFolderOrWebLink(val.item); const interactionType: undefined | RecentItemInteractionTypeField = val.interaction_type == void 0 ? void 0 : deserializeRecentItemInteractionTypeField(val.interaction_type); - const interactedAt: undefined | string = isJson(val.interacted_at, "string") ? val.interacted_at : void 0; - const interactionSharedLink: undefined | string = isJson(val.interaction_shared_link, "string") ? val.interaction_shared_link : void 0; + const interactedAt: undefined | string = val.interacted_at == void 0 ? void 0 : val.interacted_at; + const interactionSharedLink: undefined | string = val.interaction_shared_link == void 0 ? void 0 : val.interaction_shared_link; return { type: type, item: item, interactionType: interactionType, interactedAt: interactedAt, interactionSharedLink: interactionSharedLink } satisfies RecentItem; } export function serializeRecentItems(val: RecentItems): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: RecentItem): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: RecentItem): any { return serializeRecentItem(item); }) as readonly any[] }; } export function deserializeRecentItems(val: any): RecentItems { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly RecentItem[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly RecentItem[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeRecentItem(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies RecentItems; } export function serializeLegalHoldPolicyAssignment(val: LegalHoldPolicyAssignment): Json { @@ -9062,15 +9027,15 @@ export function serializeLegalHoldPolicyAssignment(val: LegalHoldPolicyAssignmen if (!isJson(base, "object")) { throw "Expecting an object for \"LegalHoldPolicyAssignment\""; } - return { ...base, ...{ ["legal_hold_policy"]: val.legalHoldPolicy == void 0 ? void 0 : serializeLegalHoldPolicyMini(val.legalHoldPolicy), ["assigned_to"]: val.assignedTo == void 0 ? void 0 : serializeFileOrFolderOrWebLink(val.assignedTo), ["assigned_by"]: val.assignedBy == void 0 ? void 0 : serializeUserMini(val.assignedBy), ["assigned_at"]: val.assignedAt, ["deleted_at"]: val.deletedAt } }; + return { ...base, ...{ ["legal_hold_policy"]: val.legalHoldPolicy == void 0 ? void 0 : serializeLegalHoldPolicyMini(val.legalHoldPolicy), ["assigned_to"]: val.assignedTo == void 0 ? void 0 : serializeFileOrFolderOrWebLink(val.assignedTo), ["assigned_by"]: val.assignedBy == void 0 ? void 0 : serializeUserMini(val.assignedBy), ["assigned_at"]: val.assignedAt == void 0 ? void 0 : val.assignedAt, ["deleted_at"]: val.deletedAt == void 0 ? void 0 : val.deletedAt } }; } export function deserializeLegalHoldPolicyAssignment(val: any): LegalHoldPolicyAssignment { const legalHoldPolicy: undefined | LegalHoldPolicyMini = val.legal_hold_policy == void 0 ? void 0 : deserializeLegalHoldPolicyMini(val.legal_hold_policy); const assignedTo: undefined | FileOrFolderOrWebLink = val.assigned_to == void 0 ? void 0 : deserializeFileOrFolderOrWebLink(val.assigned_to); const assignedBy: undefined | UserMini = val.assigned_by == void 0 ? void 0 : deserializeUserMini(val.assigned_by); - const assignedAt: undefined | string = isJson(val.assigned_at, "string") ? val.assigned_at : void 0; - const deletedAt: undefined | string = isJson(val.deleted_at, "string") ? val.deleted_at : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const assignedAt: undefined | string = val.assigned_at == void 0 ? void 0 : val.assigned_at; + const deletedAt: undefined | string = val.deleted_at == void 0 ? void 0 : val.deleted_at; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | LegalHoldPolicyAssignmentBaseTypeField = val.type == void 0 ? void 0 : deserializeLegalHoldPolicyAssignmentBaseTypeField(val.type); return { legalHoldPolicy: legalHoldPolicy, assignedTo: assignedTo, assignedBy: assignedBy, assignedAt: assignedAt, deletedAt: deletedAt, id: id, type: type } satisfies LegalHoldPolicyAssignment; } @@ -9087,33 +9052,33 @@ export function deserializeFileVersionLegalHoldTypeField(val: any): FileVersionL throw "".concat("Invalid value: ", val) as string; } export function serializeFileVersionLegalHold(val: FileVersionLegalHold): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeFileVersionLegalHoldTypeField(val.type), ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion), ["file"]: val.file == void 0 ? void 0 : serializeFileMini(val.file), ["legal_hold_policy_assignments"]: val.legalHoldPolicyAssignments == void 0 ? void 0 : val.legalHoldPolicyAssignments.map(function (item: LegalHoldPolicyAssignment): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeFileVersionLegalHoldTypeField(val.type), ["file_version"]: val.fileVersion == void 0 ? void 0 : serializeFileVersionMini(val.fileVersion), ["file"]: val.file == void 0 ? void 0 : serializeFileMini(val.file), ["legal_hold_policy_assignments"]: val.legalHoldPolicyAssignments == void 0 ? void 0 : val.legalHoldPolicyAssignments.map(function (item: LegalHoldPolicyAssignment): any { return serializeLegalHoldPolicyAssignment(item); - }) as readonly any[], ["deleted_at"]: val.deletedAt }; + }) as readonly any[], ["deleted_at"]: val.deletedAt == void 0 ? void 0 : val.deletedAt }; } export function deserializeFileVersionLegalHold(val: any): FileVersionLegalHold { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | FileVersionLegalHoldTypeField = val.type == void 0 ? void 0 : deserializeFileVersionLegalHoldTypeField(val.type); const fileVersion: undefined | FileVersionMini = val.file_version == void 0 ? void 0 : deserializeFileVersionMini(val.file_version); const file: undefined | FileMini = val.file == void 0 ? void 0 : deserializeFileMini(val.file); - const legalHoldPolicyAssignments: undefined | readonly LegalHoldPolicyAssignment[] = isJson(val.legal_hold_policy_assignments, "array") ? val.legal_hold_policy_assignments.map(function (itm: Json): any { + const legalHoldPolicyAssignments: undefined | readonly LegalHoldPolicyAssignment[] = val.legal_hold_policy_assignments == void 0 ? void 0 : isJson(val.legal_hold_policy_assignments, "array") ? val.legal_hold_policy_assignments.map(function (itm: Json): any { return deserializeLegalHoldPolicyAssignment(itm); - }) as readonly any[] : void 0; - const deletedAt: undefined | string = isJson(val.deleted_at, "string") ? val.deleted_at : void 0; + }) as readonly any[] : []; + const deletedAt: undefined | string = val.deleted_at == void 0 ? void 0 : val.deleted_at; return { id: id, type: type, fileVersion: fileVersion, file: file, legalHoldPolicyAssignments: legalHoldPolicyAssignments, deletedAt: deletedAt } satisfies FileVersionLegalHold; } export function serializeFileVersionLegalHolds(val: FileVersionLegalHolds): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileVersionLegalHold): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: FileVersionLegalHold): any { return serializeFileVersionLegalHold(item); }) as readonly any[] }; } export function deserializeFileVersionLegalHolds(val: any): FileVersionLegalHolds { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly FileVersionLegalHold[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly FileVersionLegalHold[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeFileVersionLegalHold(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies FileVersionLegalHolds; } export function serializeCollaborationTypeField(val: CollaborationTypeField): Json { @@ -9180,27 +9145,27 @@ export function deserializeCollaborationStatusField(val: any): CollaborationStat throw "".concat("Invalid value: ", val) as string; } export function serializeCollaborationAcceptanceRequirementsStatusFieldTermsOfServiceRequirementField(val: CollaborationAcceptanceRequirementsStatusFieldTermsOfServiceRequirementField): Json { - return { ["is_accepted"]: val.isAccepted, ["terms_of_service"]: val.termsOfService == void 0 ? void 0 : serializeTermsOfServiceBase(val.termsOfService) }; + return { ["is_accepted"]: val.isAccepted == void 0 ? void 0 : val.isAccepted, ["terms_of_service"]: val.termsOfService == void 0 ? void 0 : serializeTermsOfServiceBase(val.termsOfService) }; } export function deserializeCollaborationAcceptanceRequirementsStatusFieldTermsOfServiceRequirementField(val: any): CollaborationAcceptanceRequirementsStatusFieldTermsOfServiceRequirementField { - const isAccepted: undefined | boolean = isJson(val.is_accepted, "boolean") ? val.is_accepted : void 0; + const isAccepted: undefined | boolean = val.is_accepted == void 0 ? void 0 : val.is_accepted; const termsOfService: undefined | TermsOfServiceBase = val.terms_of_service == void 0 ? void 0 : deserializeTermsOfServiceBase(val.terms_of_service); return { isAccepted: isAccepted, termsOfService: termsOfService } satisfies CollaborationAcceptanceRequirementsStatusFieldTermsOfServiceRequirementField; } export function serializeCollaborationAcceptanceRequirementsStatusFieldStrongPasswordRequirementField(val: CollaborationAcceptanceRequirementsStatusFieldStrongPasswordRequirementField): Json { - return { ["enterprise_has_strong_password_required_for_external_users"]: val.enterpriseHasStrongPasswordRequiredForExternalUsers, ["user_has_strong_password"]: val.userHasStrongPassword }; + return { ["enterprise_has_strong_password_required_for_external_users"]: val.enterpriseHasStrongPasswordRequiredForExternalUsers == void 0 ? void 0 : val.enterpriseHasStrongPasswordRequiredForExternalUsers, ["user_has_strong_password"]: val.userHasStrongPassword == void 0 ? void 0 : val.userHasStrongPassword }; } export function deserializeCollaborationAcceptanceRequirementsStatusFieldStrongPasswordRequirementField(val: any): CollaborationAcceptanceRequirementsStatusFieldStrongPasswordRequirementField { - const enterpriseHasStrongPasswordRequiredForExternalUsers: undefined | boolean = isJson(val.enterprise_has_strong_password_required_for_external_users, "boolean") ? val.enterprise_has_strong_password_required_for_external_users : void 0; - const userHasStrongPassword: undefined | boolean = isJson(val.user_has_strong_password, "boolean") ? val.user_has_strong_password : void 0; + const enterpriseHasStrongPasswordRequiredForExternalUsers: undefined | boolean = val.enterprise_has_strong_password_required_for_external_users == void 0 ? void 0 : val.enterprise_has_strong_password_required_for_external_users; + const userHasStrongPassword: undefined | boolean = val.user_has_strong_password == void 0 ? void 0 : val.user_has_strong_password; return { enterpriseHasStrongPasswordRequiredForExternalUsers: enterpriseHasStrongPasswordRequiredForExternalUsers, userHasStrongPassword: userHasStrongPassword } satisfies CollaborationAcceptanceRequirementsStatusFieldStrongPasswordRequirementField; } export function serializeCollaborationAcceptanceRequirementsStatusFieldTwoFactorAuthenticationRequirementField(val: CollaborationAcceptanceRequirementsStatusFieldTwoFactorAuthenticationRequirementField): Json { - return { ["enterprise_has_two_factor_auth_enabled"]: val.enterpriseHasTwoFactorAuthEnabled, ["user_has_two_factor_authentication_enabled"]: val.userHasTwoFactorAuthenticationEnabled }; + return { ["enterprise_has_two_factor_auth_enabled"]: val.enterpriseHasTwoFactorAuthEnabled == void 0 ? void 0 : val.enterpriseHasTwoFactorAuthEnabled, ["user_has_two_factor_authentication_enabled"]: val.userHasTwoFactorAuthenticationEnabled == void 0 ? void 0 : val.userHasTwoFactorAuthenticationEnabled }; } export function deserializeCollaborationAcceptanceRequirementsStatusFieldTwoFactorAuthenticationRequirementField(val: any): CollaborationAcceptanceRequirementsStatusFieldTwoFactorAuthenticationRequirementField { - const enterpriseHasTwoFactorAuthEnabled: undefined | boolean = isJson(val.enterprise_has_two_factor_auth_enabled, "boolean") ? val.enterprise_has_two_factor_auth_enabled : void 0; - const userHasTwoFactorAuthenticationEnabled: undefined | boolean = isJson(val.user_has_two_factor_authentication_enabled, "boolean") ? val.user_has_two_factor_authentication_enabled : void 0; + const enterpriseHasTwoFactorAuthEnabled: undefined | boolean = val.enterprise_has_two_factor_auth_enabled == void 0 ? void 0 : val.enterprise_has_two_factor_auth_enabled; + const userHasTwoFactorAuthenticationEnabled: undefined | boolean = val.user_has_two_factor_authentication_enabled == void 0 ? void 0 : val.user_has_two_factor_authentication_enabled; return { enterpriseHasTwoFactorAuthEnabled: enterpriseHasTwoFactorAuthEnabled, userHasTwoFactorAuthenticationEnabled: userHasTwoFactorAuthenticationEnabled } satisfies CollaborationAcceptanceRequirementsStatusFieldTwoFactorAuthenticationRequirementField; } export function serializeCollaborationAcceptanceRequirementsStatusField(val: CollaborationAcceptanceRequirementsStatusField): Json { @@ -9213,21 +9178,21 @@ export function deserializeCollaborationAcceptanceRequirementsStatusField(val: a return { termsOfServiceRequirement: termsOfServiceRequirement, strongPasswordRequirement: strongPasswordRequirement, twoFactorAuthenticationRequirement: twoFactorAuthenticationRequirement } satisfies CollaborationAcceptanceRequirementsStatusField; } export function serializeCollaboration(val: Collaboration): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationTypeField(val.type), ["item"]: val.item == void 0 ? void 0 : serializeFileOrFolderOrWebLink(val.item), ["accessible_by"]: val.accessibleBy == void 0 ? void 0 : serializeUserCollaborations(val.accessibleBy), ["invite_email"]: val.inviteEmail, ["role"]: val.role == void 0 ? void 0 : serializeCollaborationRoleField(val.role), ["expires_at"]: val.expiresAt, ["status"]: val.status == void 0 ? void 0 : serializeCollaborationStatusField(val.status), ["acknowledged_at"]: val.acknowledgedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserCollaborations(val.createdBy), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["acceptance_requirements_status"]: val.acceptanceRequirementsStatus == void 0 ? void 0 : serializeCollaborationAcceptanceRequirementsStatusField(val.acceptanceRequirementsStatus) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeCollaborationTypeField(val.type), ["item"]: val.item == void 0 ? void 0 : serializeFileOrFolderOrWebLink(val.item), ["accessible_by"]: val.accessibleBy == void 0 ? void 0 : serializeUserCollaborations(val.accessibleBy), ["invite_email"]: val.inviteEmail == void 0 ? void 0 : val.inviteEmail, ["role"]: val.role == void 0 ? void 0 : serializeCollaborationRoleField(val.role), ["expires_at"]: val.expiresAt == void 0 ? void 0 : val.expiresAt, ["status"]: val.status == void 0 ? void 0 : serializeCollaborationStatusField(val.status), ["acknowledged_at"]: val.acknowledgedAt == void 0 ? void 0 : val.acknowledgedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserCollaborations(val.createdBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["acceptance_requirements_status"]: val.acceptanceRequirementsStatus == void 0 ? void 0 : serializeCollaborationAcceptanceRequirementsStatusField(val.acceptanceRequirementsStatus) }; } export function deserializeCollaboration(val: any): Collaboration { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | CollaborationTypeField = val.type == void 0 ? void 0 : deserializeCollaborationTypeField(val.type); const item: undefined | FileOrFolderOrWebLink = val.item == void 0 ? void 0 : deserializeFileOrFolderOrWebLink(val.item); const accessibleBy: undefined | UserCollaborations = val.accessible_by == void 0 ? void 0 : deserializeUserCollaborations(val.accessible_by); - const inviteEmail: undefined | string = isJson(val.invite_email, "string") ? val.invite_email : void 0; + const inviteEmail: undefined | string = val.invite_email == void 0 ? void 0 : val.invite_email; const role: undefined | CollaborationRoleField = val.role == void 0 ? void 0 : deserializeCollaborationRoleField(val.role); - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; const status: undefined | CollaborationStatusField = val.status == void 0 ? void 0 : deserializeCollaborationStatusField(val.status); - const acknowledgedAt: undefined | string = isJson(val.acknowledged_at, "string") ? val.acknowledged_at : void 0; + const acknowledgedAt: undefined | string = val.acknowledged_at == void 0 ? void 0 : val.acknowledged_at; const createdBy: undefined | UserCollaborations = val.created_by == void 0 ? void 0 : deserializeUserCollaborations(val.created_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; const acceptanceRequirementsStatus: undefined | CollaborationAcceptanceRequirementsStatusField = val.acceptance_requirements_status == void 0 ? void 0 : deserializeCollaborationAcceptanceRequirementsStatusField(val.acceptance_requirements_status); return { id: id, type: type, item: item, accessibleBy: accessibleBy, inviteEmail: inviteEmail, role: role, expiresAt: expiresAt, status: status, acknowledgedAt: acknowledgedAt, createdBy: createdBy, createdAt: createdAt, modifiedAt: modifiedAt, acceptanceRequirementsStatus: acceptanceRequirementsStatus } satisfies Collaboration; } @@ -9247,30 +9212,30 @@ export function deserializeCollaborationsOrderFieldDirectionField(val: any): Col throw "".concat("Invalid value: ", val) as string; } export function serializeCollaborationsOrderField(val: CollaborationsOrderField): Json { - return { ["by"]: val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeCollaborationsOrderFieldDirectionField(val.direction) }; + return { ["by"]: val.by == void 0 ? void 0 : val.by, ["direction"]: val.direction == void 0 ? void 0 : serializeCollaborationsOrderFieldDirectionField(val.direction) }; } export function deserializeCollaborationsOrderField(val: any): CollaborationsOrderField { - const by: undefined | string = isJson(val.by, "string") ? val.by : void 0; + const by: undefined | string = val.by == void 0 ? void 0 : val.by; const direction: undefined | CollaborationsOrderFieldDirectionField = val.direction == void 0 ? void 0 : deserializeCollaborationsOrderFieldDirectionField(val.direction); return { by: by, direction: direction } satisfies CollaborationsOrderField; } export function serializeCollaborations(val: Collaborations): Json { - return { ["total_count"]: val.totalCount, ["limit"]: val.limit, ["offset"]: val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: CollaborationsOrderField): any { + return { ["total_count"]: val.totalCount == void 0 ? void 0 : val.totalCount, ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["offset"]: val.offset == void 0 ? void 0 : val.offset, ["order"]: val.order == void 0 ? void 0 : val.order.map(function (item: CollaborationsOrderField): any { return serializeCollaborationsOrderField(item); }) as readonly any[], ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Collaboration): any { return serializeCollaboration(item); }) as readonly any[] }; } export function deserializeCollaborations(val: any): Collaborations { - const totalCount: undefined | number = isJson(val.total_count, "number") ? val.total_count : void 0; - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const offset: undefined | number = isJson(val.offset, "number") ? val.offset : void 0; - const order: undefined | readonly CollaborationsOrderField[] = isJson(val.order, "array") ? val.order.map(function (itm: Json): any { + const totalCount: undefined | number = val.total_count == void 0 ? void 0 : val.total_count; + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const offset: undefined | number = val.offset == void 0 ? void 0 : val.offset; + const order: undefined | readonly CollaborationsOrderField[] = val.order == void 0 ? void 0 : isJson(val.order, "array") ? val.order.map(function (itm: Json): any { return deserializeCollaborationsOrderField(itm); - }) as readonly any[] : void 0; - const entries: undefined | readonly Collaboration[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + }) as readonly any[] : []; + const entries: undefined | readonly Collaboration[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeCollaboration(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { totalCount: totalCount, limit: limit, offset: offset, order: order, entries: entries } satisfies Collaborations; } export function serializeWorkflowMiniTypeField(val: WorkflowMiniTypeField): Json { @@ -9286,14 +9251,14 @@ export function deserializeWorkflowMiniTypeField(val: any): WorkflowMiniTypeFiel throw "".concat("Invalid value: ", val) as string; } export function serializeWorkflowMini(val: WorkflowMini): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeWorkflowMiniTypeField(val.type), ["name"]: val.name, ["description"]: val.description, ["is_enabled"]: val.isEnabled }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeWorkflowMiniTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name, ["description"]: val.description == void 0 ? void 0 : val.description, ["is_enabled"]: val.isEnabled == void 0 ? void 0 : val.isEnabled }; } export function deserializeWorkflowMini(val: any): WorkflowMini { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WorkflowMiniTypeField = val.type == void 0 ? void 0 : deserializeWorkflowMiniTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const isEnabled: undefined | boolean = isJson(val.is_enabled, "boolean") ? val.is_enabled : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const isEnabled: undefined | boolean = val.is_enabled == void 0 ? void 0 : val.is_enabled; return { id: id, type: type, name: name, description: description, isEnabled: isEnabled } satisfies WorkflowMini; } export function serializeWorkflowFlowsFieldTypeField(val: WorkflowFlowsFieldTypeField): Json { @@ -9357,19 +9322,19 @@ export function deserializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectFieldTy throw "".concat("Invalid value: ", val) as string; } export function serializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectField(val: WorkflowFlowsFieldTriggerFieldScopeFieldObjectField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectFieldTypeField(val.type), ["id"]: val.id }; + return { ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectFieldTypeField(val.type), ["id"]: val.id == void 0 ? void 0 : val.id }; } export function deserializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectField(val: any): WorkflowFlowsFieldTriggerFieldScopeFieldObjectField { const type: undefined | WorkflowFlowsFieldTriggerFieldScopeFieldObjectFieldTypeField = val.type == void 0 ? void 0 : deserializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectFieldTypeField(val.type); - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; return { type: type, id: id } satisfies WorkflowFlowsFieldTriggerFieldScopeFieldObjectField; } export function serializeWorkflowFlowsFieldTriggerFieldScopeField(val: WorkflowFlowsFieldTriggerFieldScopeField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldTriggerFieldScopeFieldTypeField(val.type), ["ref"]: val.ref, ["object"]: val.object == void 0 ? void 0 : serializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectField(val.object) }; + return { ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldTriggerFieldScopeFieldTypeField(val.type), ["ref"]: val.ref == void 0 ? void 0 : val.ref, ["object"]: val.object == void 0 ? void 0 : serializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectField(val.object) }; } export function deserializeWorkflowFlowsFieldTriggerFieldScopeField(val: any): WorkflowFlowsFieldTriggerFieldScopeField { const type: undefined | WorkflowFlowsFieldTriggerFieldScopeFieldTypeField = val.type == void 0 ? void 0 : deserializeWorkflowFlowsFieldTriggerFieldScopeFieldTypeField(val.type); - const ref: undefined | string = isJson(val.ref, "string") ? val.ref : void 0; + const ref: undefined | string = val.ref == void 0 ? void 0 : val.ref; const object: undefined | WorkflowFlowsFieldTriggerFieldScopeFieldObjectField = val.object == void 0 ? void 0 : deserializeWorkflowFlowsFieldTriggerFieldScopeFieldObjectField(val.object); return { type: type, ref: ref, object: object } satisfies WorkflowFlowsFieldTriggerFieldScopeField; } @@ -9381,9 +9346,9 @@ export function serializeWorkflowFlowsFieldTriggerField(val: WorkflowFlowsFieldT export function deserializeWorkflowFlowsFieldTriggerField(val: any): WorkflowFlowsFieldTriggerField { const type: undefined | WorkflowFlowsFieldTriggerFieldTypeField = val.type == void 0 ? void 0 : deserializeWorkflowFlowsFieldTriggerFieldTypeField(val.type); const triggerType: undefined | WorkflowFlowsFieldTriggerFieldTriggerTypeField = val.trigger_type == void 0 ? void 0 : deserializeWorkflowFlowsFieldTriggerFieldTriggerTypeField(val.trigger_type); - const scope: undefined | readonly WorkflowFlowsFieldTriggerFieldScopeField[] = isJson(val.scope, "array") ? val.scope.map(function (itm: Json): any { + const scope: undefined | readonly WorkflowFlowsFieldTriggerFieldScopeField[] = val.scope == void 0 ? void 0 : isJson(val.scope, "array") ? val.scope.map(function (itm: Json): any { return deserializeWorkflowFlowsFieldTriggerFieldScopeField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { type: type, triggerType: triggerType, scope: scope } satisfies WorkflowFlowsFieldTriggerField; } export function serializeWorkflowFlowsFieldOutcomesFieldTypeField(val: WorkflowFlowsFieldOutcomesFieldTypeField): Json { @@ -9567,43 +9532,43 @@ export function deserializeWorkflowFlowsFieldOutcomesFieldIfRejectedFieldActionT throw "".concat("Invalid value: ", val) as string; } export function serializeWorkflowFlowsFieldOutcomesFieldIfRejectedField(val: WorkflowFlowsFieldOutcomesFieldIfRejectedField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldOutcomesFieldIfRejectedFieldTypeField(val.type), ["name"]: val.name, ["action_type"]: val.actionType == void 0 ? void 0 : serializeWorkflowFlowsFieldOutcomesFieldIfRejectedFieldActionTypeField(val.actionType) }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldOutcomesFieldIfRejectedFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name, ["action_type"]: val.actionType == void 0 ? void 0 : serializeWorkflowFlowsFieldOutcomesFieldIfRejectedFieldActionTypeField(val.actionType) }; } export function deserializeWorkflowFlowsFieldOutcomesFieldIfRejectedField(val: any): WorkflowFlowsFieldOutcomesFieldIfRejectedField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WorkflowFlowsFieldOutcomesFieldIfRejectedFieldTypeField = val.type == void 0 ? void 0 : deserializeWorkflowFlowsFieldOutcomesFieldIfRejectedFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const actionType: undefined | WorkflowFlowsFieldOutcomesFieldIfRejectedFieldActionTypeField = val.action_type == void 0 ? void 0 : deserializeWorkflowFlowsFieldOutcomesFieldIfRejectedFieldActionTypeField(val.action_type); return { id: id, type: type, name: name, actionType: actionType } satisfies WorkflowFlowsFieldOutcomesFieldIfRejectedField; } export function serializeWorkflowFlowsFieldOutcomesField(val: WorkflowFlowsFieldOutcomesField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldOutcomesFieldTypeField(val.type), ["name"]: val.name, ["action_type"]: val.actionType == void 0 ? void 0 : serializeWorkflowFlowsFieldOutcomesFieldActionTypeField(val.actionType), ["if_rejected"]: val.ifRejected == void 0 ? void 0 : val.ifRejected.map(function (item: WorkflowFlowsFieldOutcomesFieldIfRejectedField): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldOutcomesFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name, ["action_type"]: val.actionType == void 0 ? void 0 : serializeWorkflowFlowsFieldOutcomesFieldActionTypeField(val.actionType), ["if_rejected"]: val.ifRejected == void 0 ? void 0 : val.ifRejected.map(function (item: WorkflowFlowsFieldOutcomesFieldIfRejectedField): any { return serializeWorkflowFlowsFieldOutcomesFieldIfRejectedField(item); }) as readonly any[] }; } export function deserializeWorkflowFlowsFieldOutcomesField(val: any): WorkflowFlowsFieldOutcomesField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WorkflowFlowsFieldOutcomesFieldTypeField = val.type == void 0 ? void 0 : deserializeWorkflowFlowsFieldOutcomesFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; const actionType: undefined | WorkflowFlowsFieldOutcomesFieldActionTypeField = val.action_type == void 0 ? void 0 : deserializeWorkflowFlowsFieldOutcomesFieldActionTypeField(val.action_type); - const ifRejected: undefined | readonly WorkflowFlowsFieldOutcomesFieldIfRejectedField[] = isJson(val.if_rejected, "array") ? val.if_rejected.map(function (itm: Json): any { + const ifRejected: undefined | readonly WorkflowFlowsFieldOutcomesFieldIfRejectedField[] = val.if_rejected == void 0 ? void 0 : isJson(val.if_rejected, "array") ? val.if_rejected.map(function (itm: Json): any { return deserializeWorkflowFlowsFieldOutcomesFieldIfRejectedField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { id: id, type: type, name: name, actionType: actionType, ifRejected: ifRejected } satisfies WorkflowFlowsFieldOutcomesField; } export function serializeWorkflowFlowsField(val: WorkflowFlowsField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldTypeField(val.type), ["trigger"]: val.trigger == void 0 ? void 0 : serializeWorkflowFlowsFieldTriggerField(val.trigger), ["outcomes"]: val.outcomes == void 0 ? void 0 : val.outcomes.map(function (item: WorkflowFlowsFieldOutcomesField): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeWorkflowFlowsFieldTypeField(val.type), ["trigger"]: val.trigger == void 0 ? void 0 : serializeWorkflowFlowsFieldTriggerField(val.trigger), ["outcomes"]: val.outcomes == void 0 ? void 0 : val.outcomes.map(function (item: WorkflowFlowsFieldOutcomesField): any { return serializeWorkflowFlowsFieldOutcomesField(item); - }) as readonly any[], ["created_at"]: val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy) }; + }) as readonly any[], ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy) }; } export function deserializeWorkflowFlowsField(val: any): WorkflowFlowsField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WorkflowFlowsFieldTypeField = val.type == void 0 ? void 0 : deserializeWorkflowFlowsFieldTypeField(val.type); const trigger: undefined | WorkflowFlowsFieldTriggerField = val.trigger == void 0 ? void 0 : deserializeWorkflowFlowsFieldTriggerField(val.trigger); - const outcomes: undefined | readonly WorkflowFlowsFieldOutcomesField[] = isJson(val.outcomes, "array") ? val.outcomes.map(function (itm: Json): any { + const outcomes: undefined | readonly WorkflowFlowsFieldOutcomesField[] = val.outcomes == void 0 ? void 0 : isJson(val.outcomes, "array") ? val.outcomes.map(function (itm: Json): any { return deserializeWorkflowFlowsFieldOutcomesField(itm); - }) as readonly any[] : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + }) as readonly any[] : []; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); return { id: id, type: type, trigger: trigger, outcomes: outcomes, createdAt: createdAt, createdBy: createdBy } satisfies WorkflowFlowsField; } @@ -9617,28 +9582,28 @@ export function serializeWorkflow(val: Workflow): Json { }) as readonly any[] } }; } export function deserializeWorkflow(val: any): Workflow { - const flows: undefined | readonly WorkflowFlowsField[] = isJson(val.flows, "array") ? val.flows.map(function (itm: Json): any { + const flows: undefined | readonly WorkflowFlowsField[] = val.flows == void 0 ? void 0 : isJson(val.flows, "array") ? val.flows.map(function (itm: Json): any { return deserializeWorkflowFlowsField(itm); - }) as readonly any[] : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + }) as readonly any[] : []; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WorkflowMiniTypeField = val.type == void 0 ? void 0 : deserializeWorkflowMiniTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const isEnabled: undefined | boolean = isJson(val.is_enabled, "boolean") ? val.is_enabled : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const isEnabled: undefined | boolean = val.is_enabled == void 0 ? void 0 : val.is_enabled; return { flows: flows, id: id, type: type, name: name, description: description, isEnabled: isEnabled } satisfies Workflow; } export function serializeWorkflows(val: Workflows): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Workflow): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: Workflow): any { return serializeWorkflow(item); }) as readonly any[] }; } export function deserializeWorkflows(val: any): Workflows { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly Workflow[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly Workflow[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeWorkflow(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies Workflows; } export function serializeWorkflowFull(val: WorkflowFull): Json { @@ -9646,21 +9611,21 @@ export function serializeWorkflowFull(val: WorkflowFull): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"WorkflowFull\""; } - return { ...base, ...{ ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserBase(val.modifiedBy) } }; + return { ...base, ...{ ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserBase(val.modifiedBy) } }; } export function deserializeWorkflowFull(val: any): WorkflowFull { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); const modifiedBy: undefined | UserBase = val.modified_by == void 0 ? void 0 : deserializeUserBase(val.modified_by); - const flows: undefined | readonly WorkflowFlowsField[] = isJson(val.flows, "array") ? val.flows.map(function (itm: Json): any { + const flows: undefined | readonly WorkflowFlowsField[] = val.flows == void 0 ? void 0 : isJson(val.flows, "array") ? val.flows.map(function (itm: Json): any { return deserializeWorkflowFlowsField(itm); - }) as readonly any[] : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + }) as readonly any[] : []; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | WorkflowMiniTypeField = val.type == void 0 ? void 0 : deserializeWorkflowMiniTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const description: undefined | string = isJson(val.description, "string") ? val.description : void 0; - const isEnabled: undefined | boolean = isJson(val.is_enabled, "boolean") ? val.is_enabled : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const description: undefined | string = val.description == void 0 ? void 0 : val.description; + const isEnabled: undefined | boolean = val.is_enabled == void 0 ? void 0 : val.is_enabled; return { createdAt: createdAt, modifiedAt: modifiedAt, createdBy: createdBy, modifiedBy: modifiedBy, flows: flows, id: id, type: type, name: name, description: description, isEnabled: isEnabled } satisfies WorkflowFull; } export function serializeZipDownloadNameConflictsFieldTypeField(val: ZipDownloadNameConflictsFieldTypeField): Json { @@ -9679,27 +9644,31 @@ export function deserializeZipDownloadNameConflictsFieldTypeField(val: any): Zip throw "".concat("Invalid value: ", val) as string; } export function serializeZipDownloadNameConflictsField(val: ZipDownloadNameConflictsField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeZipDownloadNameConflictsFieldTypeField(val.type), ["original_name"]: val.originalName, ["download_name"]: val.downloadName }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeZipDownloadNameConflictsFieldTypeField(val.type), ["original_name"]: val.originalName == void 0 ? void 0 : val.originalName, ["download_name"]: val.downloadName == void 0 ? void 0 : val.downloadName }; } export function deserializeZipDownloadNameConflictsField(val: any): ZipDownloadNameConflictsField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | ZipDownloadNameConflictsFieldTypeField = val.type == void 0 ? void 0 : deserializeZipDownloadNameConflictsFieldTypeField(val.type); - const originalName: undefined | string = isJson(val.original_name, "string") ? val.original_name : void 0; - const downloadName: undefined | string = isJson(val.download_name, "string") ? val.download_name : void 0; + const originalName: undefined | string = val.original_name == void 0 ? void 0 : val.original_name; + const downloadName: undefined | string = val.download_name == void 0 ? void 0 : val.download_name; return { id: id, type: type, originalName: originalName, downloadName: downloadName } satisfies ZipDownloadNameConflictsField; } export function serializeZipDownload(val: ZipDownload): Json { - return { ["download_url"]: val.downloadUrl, ["status_url"]: val.statusUrl, ["expires_at"]: val.expiresAt, ["name_conflicts"]: val.nameConflicts == void 0 ? void 0 : val.nameConflicts.map(function (item: readonly ZipDownloadNameConflictsField[]): undefined { - return void 0; + return { ["download_url"]: val.downloadUrl == void 0 ? void 0 : val.downloadUrl, ["status_url"]: val.statusUrl == void 0 ? void 0 : val.statusUrl, ["expires_at"]: val.expiresAt == void 0 ? void 0 : val.expiresAt, ["name_conflicts"]: val.nameConflicts == void 0 ? void 0 : val.nameConflicts.map(function (item: readonly ZipDownloadNameConflictsField[]): readonly any[] { + return item.map(function (item: ZipDownloadNameConflictsField): any { + return serializeZipDownloadNameConflictsField(item); + }) as readonly any[]; }) as readonly any[] }; } export function deserializeZipDownload(val: any): ZipDownload { - const downloadUrl: undefined | string = isJson(val.download_url, "string") ? val.download_url : void 0; - const statusUrl: undefined | string = isJson(val.status_url, "string") ? val.status_url : void 0; - const expiresAt: undefined | string = isJson(val.expires_at, "string") ? val.expires_at : void 0; - const nameConflicts: undefined | readonly (readonly ZipDownloadNameConflictsField[])[] = isJson(val.name_conflicts, "array") ? val.name_conflicts.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; + const downloadUrl: undefined | string = val.download_url == void 0 ? void 0 : val.download_url; + const statusUrl: undefined | string = val.status_url == void 0 ? void 0 : val.status_url; + const expiresAt: undefined | string = val.expires_at == void 0 ? void 0 : val.expires_at; + const nameConflicts: undefined | readonly (readonly ZipDownloadNameConflictsField[])[] = val.name_conflicts == void 0 ? void 0 : isJson(val.name_conflicts, "array") ? val.name_conflicts.map(function (itm: Json): any { + return isJson(itm, "array") ? itm.map(function (itm: Json): any { + return deserializeZipDownloadNameConflictsField(itm); + }) as readonly any[] : []; + }) as readonly any[] : []; return { downloadUrl: downloadUrl, statusUrl: statusUrl, expiresAt: expiresAt, nameConflicts: nameConflicts } satisfies ZipDownload; } export function serializeZipDownloadStatusStateField(val: ZipDownloadStatusStateField): Json { @@ -9721,13 +9690,13 @@ export function deserializeZipDownloadStatusStateField(val: any): ZipDownloadSta throw "".concat("Invalid value: ", val) as string; } export function serializeZipDownloadStatus(val: ZipDownloadStatus): Json { - return { ["total_file_count"]: val.totalFileCount, ["downloaded_file_count"]: val.downloadedFileCount, ["skipped_file_count"]: val.skippedFileCount, ["skipped_folder_count"]: val.skippedFolderCount, ["state"]: val.state == void 0 ? void 0 : serializeZipDownloadStatusStateField(val.state) }; + return { ["total_file_count"]: val.totalFileCount == void 0 ? void 0 : val.totalFileCount, ["downloaded_file_count"]: val.downloadedFileCount == void 0 ? void 0 : val.downloadedFileCount, ["skipped_file_count"]: val.skippedFileCount == void 0 ? void 0 : val.skippedFileCount, ["skipped_folder_count"]: val.skippedFolderCount == void 0 ? void 0 : val.skippedFolderCount, ["state"]: val.state == void 0 ? void 0 : serializeZipDownloadStatusStateField(val.state) }; } export function deserializeZipDownloadStatus(val: any): ZipDownloadStatus { - const totalFileCount: undefined | number = isJson(val.total_file_count, "number") ? val.total_file_count : void 0; - const downloadedFileCount: undefined | number = isJson(val.downloaded_file_count, "number") ? val.downloaded_file_count : void 0; - const skippedFileCount: undefined | number = isJson(val.skipped_file_count, "number") ? val.skipped_file_count : void 0; - const skippedFolderCount: undefined | number = isJson(val.skipped_folder_count, "number") ? val.skipped_folder_count : void 0; + const totalFileCount: undefined | number = val.total_file_count == void 0 ? void 0 : val.total_file_count; + const downloadedFileCount: undefined | number = val.downloaded_file_count == void 0 ? void 0 : val.downloaded_file_count; + const skippedFileCount: undefined | number = val.skipped_file_count == void 0 ? void 0 : val.skipped_file_count; + const skippedFolderCount: undefined | number = val.skipped_folder_count == void 0 ? void 0 : val.skipped_folder_count; const state: undefined | ZipDownloadStatusStateField = val.state == void 0 ? void 0 : deserializeZipDownloadStatusStateField(val.state); return { totalFileCount: totalFileCount, downloadedFileCount: downloadedFileCount, skippedFileCount: skippedFileCount, skippedFolderCount: skippedFolderCount, state: state } satisfies ZipDownloadStatus; } @@ -9756,10 +9725,10 @@ export function deserializeKeywordSkillCardSkillCardTypeField(val: any): Keyword throw "".concat("Invalid value: ", val) as string; } export function serializeKeywordSkillCardSkillCardTitleField(val: KeywordSkillCardSkillCardTitleField): Json { - return { ["code"]: val.code, ["message"]: val.message }; + return { ["code"]: val.code == void 0 ? void 0 : val.code, ["message"]: val.message }; } export function deserializeKeywordSkillCardSkillCardTitleField(val: any): KeywordSkillCardSkillCardTitleField { - const code: undefined | string = isJson(val.code, "string") ? val.code : void 0; + const code: undefined | string = val.code == void 0 ? void 0 : val.code; const message: string = val.message; return { code: code, message: message } satisfies KeywordSkillCardSkillCardTitleField; } @@ -9804,34 +9773,34 @@ export function deserializeKeywordSkillCardInvocationField(val: any): KeywordSki return { type: type, id: id } satisfies KeywordSkillCardInvocationField; } export function serializeKeywordSkillCardEntriesField(val: KeywordSkillCardEntriesField): Json { - return { ["text"]: val.text }; + return { ["text"]: val.text == void 0 ? void 0 : val.text }; } export function deserializeKeywordSkillCardEntriesField(val: any): KeywordSkillCardEntriesField { - const text: undefined | string = isJson(val.text, "string") ? val.text : void 0; + const text: undefined | string = val.text == void 0 ? void 0 : val.text; return { text: text } satisfies KeywordSkillCardEntriesField; } export function serializeKeywordSkillCard(val: KeywordSkillCard): Json { - return { ["created_at"]: val.createdAt, ["type"]: serializeKeywordSkillCardTypeField(val.type), ["skill_card_type"]: serializeKeywordSkillCardSkillCardTypeField(val.skillCardType), ["skill_card_title"]: val.skillCardTitle == void 0 ? void 0 : serializeKeywordSkillCardSkillCardTitleField(val.skillCardTitle), ["skill"]: serializeKeywordSkillCardSkillField(val.skill), ["invocation"]: serializeKeywordSkillCardInvocationField(val.invocation), ["entries"]: val.entries.map(function (item: KeywordSkillCardEntriesField): any { + return { ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["type"]: serializeKeywordSkillCardTypeField(val.type), ["skill_card_type"]: serializeKeywordSkillCardSkillCardTypeField(val.skillCardType), ["skill_card_title"]: val.skillCardTitle == void 0 ? void 0 : serializeKeywordSkillCardSkillCardTitleField(val.skillCardTitle), ["skill"]: serializeKeywordSkillCardSkillField(val.skill), ["invocation"]: serializeKeywordSkillCardInvocationField(val.invocation), ["entries"]: val.entries.map(function (item: KeywordSkillCardEntriesField): any { return serializeKeywordSkillCardEntriesField(item); }) as readonly any[] }; } export function deserializeKeywordSkillCard(val: any): KeywordSkillCard { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const type: KeywordSkillCardTypeField = deserializeKeywordSkillCardTypeField(val.type); const skillCardType: KeywordSkillCardSkillCardTypeField = deserializeKeywordSkillCardSkillCardTypeField(val.skill_card_type); const skillCardTitle: undefined | KeywordSkillCardSkillCardTitleField = val.skill_card_title == void 0 ? void 0 : deserializeKeywordSkillCardSkillCardTitleField(val.skill_card_title); const skill: KeywordSkillCardSkillField = deserializeKeywordSkillCardSkillField(val.skill); const invocation: KeywordSkillCardInvocationField = deserializeKeywordSkillCardInvocationField(val.invocation); - const entries: readonly KeywordSkillCardEntriesField[] = val.entries.map(function (itm: Json): any { + const entries: readonly KeywordSkillCardEntriesField[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeKeywordSkillCardEntriesField(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { createdAt: createdAt, type: type, skillCardType: skillCardType, skillCardTitle: skillCardTitle, skill: skill, invocation: invocation, entries: entries } satisfies KeywordSkillCard; } export function serializeIntegrationMappingSlackOptions(val: IntegrationMappingSlackOptions): Json { - return { ["is_access_management_disabled"]: val.isAccessManagementDisabled }; + return { ["is_access_management_disabled"]: val.isAccessManagementDisabled == void 0 ? void 0 : val.isAccessManagementDisabled }; } export function deserializeIntegrationMappingSlackOptions(val: any): IntegrationMappingSlackOptions { - const isAccessManagementDisabled: undefined | boolean = isJson(val.is_access_management_disabled, "boolean") ? val.is_access_management_disabled : void 0; + const isAccessManagementDisabled: undefined | boolean = val.is_access_management_disabled == void 0 ? void 0 : val.is_access_management_disabled; return { isAccessManagementDisabled: isAccessManagementDisabled } satisfies IntegrationMappingSlackOptions; } export function serializeIntegrationMappingPartnerItemSlackTypeField(val: IntegrationMappingPartnerItemSlackTypeField): Json { @@ -9847,13 +9816,13 @@ export function deserializeIntegrationMappingPartnerItemSlackTypeField(val: any) throw "".concat("Invalid value: ", val) as string; } export function serializeIntegrationMappingPartnerItemSlack(val: IntegrationMappingPartnerItemSlack): Json { - return { ["type"]: serializeIntegrationMappingPartnerItemSlackTypeField(val.type), ["id"]: val.id, ["slack_workspace_id"]: val.slackWorkspaceId, ["slack_org_id"]: val.slackOrgId }; + return { ["type"]: serializeIntegrationMappingPartnerItemSlackTypeField(val.type), ["id"]: val.id, ["slack_workspace_id"]: val.slackWorkspaceId == void 0 ? void 0 : val.slackWorkspaceId, ["slack_org_id"]: val.slackOrgId == void 0 ? void 0 : val.slackOrgId }; } export function deserializeIntegrationMappingPartnerItemSlack(val: any): IntegrationMappingPartnerItemSlack { const type: IntegrationMappingPartnerItemSlackTypeField = deserializeIntegrationMappingPartnerItemSlackTypeField(val.type); const id: string = val.id; - const slackWorkspaceId: undefined | string = isJson(val.slack_workspace_id, "string") ? val.slack_workspace_id : void 0; - const slackOrgId: undefined | string = isJson(val.slack_org_id, "string") ? val.slack_org_id : void 0; + const slackWorkspaceId: undefined | string = val.slack_workspace_id == void 0 ? void 0 : val.slack_workspace_id; + const slackOrgId: undefined | string = val.slack_org_id == void 0 ? void 0 : val.slack_org_id; return { type: type, id: id, slackWorkspaceId: slackWorkspaceId, slackOrgId: slackOrgId } satisfies IntegrationMappingPartnerItemSlack; } export function serializeIntegrationMappingTypeField(val: IntegrationMappingTypeField): Json { @@ -9868,63 +9837,45 @@ export function deserializeIntegrationMappingTypeField(val: any): IntegrationMap } throw "".concat("Invalid value: ", val) as string; } -export function serializeIntegrationMappingBoxItemField(val: IntegrationMappingBoxItemField): Json { - return {}; -} -export function deserializeIntegrationMappingBoxItemField(val: any): IntegrationMappingBoxItemField { - return {} satisfies IntegrationMappingBoxItemField; -} export function serializeIntegrationMappingOptionsField(val: IntegrationMappingOptionsField): Json { return {}; } export function deserializeIntegrationMappingOptionsField(val: any): IntegrationMappingOptionsField { return {} satisfies IntegrationMappingOptionsField; } -export function serializeIntegrationMappingCreatedByField(val: IntegrationMappingCreatedByField): Json { - return {}; -} -export function deserializeIntegrationMappingCreatedByField(val: any): IntegrationMappingCreatedByField { - return {} satisfies IntegrationMappingCreatedByField; -} -export function serializeIntegrationMappingModifiedByField(val: IntegrationMappingModifiedByField): Json { - return {}; -} -export function deserializeIntegrationMappingModifiedByField(val: any): IntegrationMappingModifiedByField { - return {} satisfies IntegrationMappingModifiedByField; -} export function serializeIntegrationMapping(val: IntegrationMapping): Json { const base: any = serializeIntegrationMappingBase(val); if (!isJson(base, "object")) { throw "Expecting an object for \"IntegrationMapping\""; } - return { ...base, ...{ ["type"]: serializeIntegrationMappingTypeField(val.type), ["partner_item"]: serializeIntegrationMappingPartnerItemSlack(val.partnerItem), ["box_item"]: serializeIntegrationMappingBoxItemField(val.boxItem), ["is_manually_created"]: val.isManuallyCreated, ["options"]: val.options == void 0 ? void 0 : serializeIntegrationMappingOptionsField(val.options), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeIntegrationMappingCreatedByField(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeIntegrationMappingModifiedByField(val.modifiedBy), ["created_at"]: val.createdAt, ["modified_at"]: val.modifiedAt } }; + return { ...base, ...{ ["type"]: serializeIntegrationMappingTypeField(val.type), ["partner_item"]: serializeIntegrationMappingPartnerItemSlack(val.partnerItem), ["box_item"]: serializeFolderMini(val.boxItem), ["is_manually_created"]: val.isManuallyCreated == void 0 ? void 0 : val.isManuallyCreated, ["options"]: val.options == void 0 ? void 0 : serializeIntegrationMappingOptionsField(val.options), ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserIntegrationMappings(val.createdBy), ["modified_by"]: val.modifiedBy == void 0 ? void 0 : serializeUserIntegrationMappings(val.modifiedBy), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["modified_at"]: val.modifiedAt == void 0 ? void 0 : val.modifiedAt } }; } export function deserializeIntegrationMapping(val: any): IntegrationMapping { const type: IntegrationMappingTypeField = deserializeIntegrationMappingTypeField(val.type); const partnerItem: IntegrationMappingPartnerItemSlack = deserializeIntegrationMappingPartnerItemSlack(val.partner_item); - const boxItem: IntegrationMappingBoxItemField = deserializeIntegrationMappingBoxItemField(val.box_item); - const isManuallyCreated: undefined | boolean = isJson(val.is_manually_created, "boolean") ? val.is_manually_created : void 0; + const boxItem: FolderMini = deserializeFolderMini(val.box_item); + const isManuallyCreated: undefined | boolean = val.is_manually_created == void 0 ? void 0 : val.is_manually_created; const options: undefined | IntegrationMappingOptionsField = val.options == void 0 ? void 0 : deserializeIntegrationMappingOptionsField(val.options); - const createdBy: undefined | IntegrationMappingCreatedByField = val.created_by == void 0 ? void 0 : deserializeIntegrationMappingCreatedByField(val.created_by); - const modifiedBy: undefined | IntegrationMappingModifiedByField = val.modified_by == void 0 ? void 0 : deserializeIntegrationMappingModifiedByField(val.modified_by); - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const createdBy: undefined | UserIntegrationMappings = val.created_by == void 0 ? void 0 : deserializeUserIntegrationMappings(val.created_by); + const modifiedBy: undefined | UserIntegrationMappings = val.modified_by == void 0 ? void 0 : deserializeUserIntegrationMappings(val.modified_by); + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const integrationType: undefined | IntegrationMappingBaseIntegrationTypeField = val.integration_type == void 0 ? void 0 : deserializeIntegrationMappingBaseIntegrationTypeField(val.integration_type); return { type: type, partnerItem: partnerItem, boxItem: boxItem, isManuallyCreated: isManuallyCreated, options: options, createdBy: createdBy, modifiedBy: modifiedBy, createdAt: createdAt, modifiedAt: modifiedAt, id: id, integrationType: integrationType } satisfies IntegrationMapping; } export function serializeIntegrationMappings(val: IntegrationMappings): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: IntegrationMapping): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: IntegrationMapping): any { return serializeIntegrationMapping(item); }) as readonly any[] }; } export function deserializeIntegrationMappings(val: any): IntegrationMappings { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly IntegrationMapping[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly IntegrationMapping[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeIntegrationMapping(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies IntegrationMappings; } export function serializeIntegrationMappingBoxItemSlackTypeField(val: IntegrationMappingBoxItemSlackTypeField): Json { @@ -9947,6 +9898,15 @@ export function deserializeIntegrationMappingBoxItemSlack(val: any): Integration const id: string = val.id; return { type: type, id: id } satisfies IntegrationMappingBoxItemSlack; } +export function serializeIntegrationMappingSlackCreateRequest(val: IntegrationMappingSlackCreateRequest): Json { + return { ["partner_item"]: serializeIntegrationMappingPartnerItemSlack(val.partnerItem), ["box_item"]: serializeIntegrationMappingBoxItemSlack(val.boxItem), ["options"]: val.options == void 0 ? void 0 : serializeIntegrationMappingSlackOptions(val.options) }; +} +export function deserializeIntegrationMappingSlackCreateRequest(val: any): IntegrationMappingSlackCreateRequest { + const partnerItem: IntegrationMappingPartnerItemSlack = deserializeIntegrationMappingPartnerItemSlack(val.partner_item); + const boxItem: IntegrationMappingBoxItemSlack = deserializeIntegrationMappingBoxItemSlack(val.box_item); + const options: undefined | IntegrationMappingSlackOptions = val.options == void 0 ? void 0 : deserializeIntegrationMappingSlackOptions(val.options); + return { partnerItem: partnerItem, boxItem: boxItem, options: options } satisfies IntegrationMappingSlackCreateRequest; +} export function serializeTimelineSkillCardTypeField(val: TimelineSkillCardTypeField): Json { return val; } @@ -9972,10 +9932,10 @@ export function deserializeTimelineSkillCardSkillCardTypeField(val: any): Timeli throw "".concat("Invalid value: ", val) as string; } export function serializeTimelineSkillCardSkillCardTitleField(val: TimelineSkillCardSkillCardTitleField): Json { - return { ["code"]: val.code, ["message"]: val.message }; + return { ["code"]: val.code == void 0 ? void 0 : val.code, ["message"]: val.message }; } export function deserializeTimelineSkillCardSkillCardTitleField(val: any): TimelineSkillCardSkillCardTitleField { - const code: undefined | string = isJson(val.code, "string") ? val.code : void 0; + const code: undefined | string = val.code == void 0 ? void 0 : val.code; const message: string = val.message; return { code: code, message: message } satisfies TimelineSkillCardSkillCardTitleField; } @@ -10020,42 +9980,42 @@ export function deserializeTimelineSkillCardInvocationField(val: any): TimelineS return { type: type, id: id } satisfies TimelineSkillCardInvocationField; } export function serializeTimelineSkillCardEntriesFieldAppearsField(val: TimelineSkillCardEntriesFieldAppearsField): Json { - return { ["start"]: val.start, ["end"]: val.end }; + return { ["start"]: val.start == void 0 ? void 0 : val.start, ["end"]: val.end == void 0 ? void 0 : val.end }; } export function deserializeTimelineSkillCardEntriesFieldAppearsField(val: any): TimelineSkillCardEntriesFieldAppearsField { - const start: undefined | number = isJson(val.start, "number") ? val.start : void 0; - const end: undefined | number = isJson(val.end, "number") ? val.end : void 0; + const start: undefined | number = val.start == void 0 ? void 0 : val.start; + const end: undefined | number = val.end == void 0 ? void 0 : val.end; return { start: start, end: end } satisfies TimelineSkillCardEntriesFieldAppearsField; } export function serializeTimelineSkillCardEntriesField(val: TimelineSkillCardEntriesField): Json { - return { ["text"]: val.text, ["appears"]: val.appears == void 0 ? void 0 : val.appears.map(function (item: TimelineSkillCardEntriesFieldAppearsField): any { + return { ["text"]: val.text == void 0 ? void 0 : val.text, ["appears"]: val.appears == void 0 ? void 0 : val.appears.map(function (item: TimelineSkillCardEntriesFieldAppearsField): any { return serializeTimelineSkillCardEntriesFieldAppearsField(item); - }) as readonly any[], ["image_url"]: val.imageUrl }; + }) as readonly any[], ["image_url"]: val.imageUrl == void 0 ? void 0 : val.imageUrl }; } export function deserializeTimelineSkillCardEntriesField(val: any): TimelineSkillCardEntriesField { - const text: undefined | string = isJson(val.text, "string") ? val.text : void 0; - const appears: undefined | readonly TimelineSkillCardEntriesFieldAppearsField[] = isJson(val.appears, "array") ? val.appears.map(function (itm: Json): any { + const text: undefined | string = val.text == void 0 ? void 0 : val.text; + const appears: undefined | readonly TimelineSkillCardEntriesFieldAppearsField[] = val.appears == void 0 ? void 0 : isJson(val.appears, "array") ? val.appears.map(function (itm: Json): any { return deserializeTimelineSkillCardEntriesFieldAppearsField(itm); - }) as readonly any[] : void 0; - const imageUrl: undefined | string = isJson(val.image_url, "string") ? val.image_url : void 0; + }) as readonly any[] : []; + const imageUrl: undefined | string = val.image_url == void 0 ? void 0 : val.image_url; return { text: text, appears: appears, imageUrl: imageUrl } satisfies TimelineSkillCardEntriesField; } export function serializeTimelineSkillCard(val: TimelineSkillCard): Json { - return { ["created_at"]: val.createdAt, ["type"]: serializeTimelineSkillCardTypeField(val.type), ["skill_card_type"]: serializeTimelineSkillCardSkillCardTypeField(val.skillCardType), ["skill_card_title"]: val.skillCardTitle == void 0 ? void 0 : serializeTimelineSkillCardSkillCardTitleField(val.skillCardTitle), ["skill"]: serializeTimelineSkillCardSkillField(val.skill), ["invocation"]: serializeTimelineSkillCardInvocationField(val.invocation), ["duration"]: val.duration, ["entries"]: val.entries.map(function (item: TimelineSkillCardEntriesField): any { + return { ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["type"]: serializeTimelineSkillCardTypeField(val.type), ["skill_card_type"]: serializeTimelineSkillCardSkillCardTypeField(val.skillCardType), ["skill_card_title"]: val.skillCardTitle == void 0 ? void 0 : serializeTimelineSkillCardSkillCardTitleField(val.skillCardTitle), ["skill"]: serializeTimelineSkillCardSkillField(val.skill), ["invocation"]: serializeTimelineSkillCardInvocationField(val.invocation), ["duration"]: val.duration == void 0 ? void 0 : val.duration, ["entries"]: val.entries.map(function (item: TimelineSkillCardEntriesField): any { return serializeTimelineSkillCardEntriesField(item); }) as readonly any[] }; } export function deserializeTimelineSkillCard(val: any): TimelineSkillCard { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const type: TimelineSkillCardTypeField = deserializeTimelineSkillCardTypeField(val.type); const skillCardType: TimelineSkillCardSkillCardTypeField = deserializeTimelineSkillCardSkillCardTypeField(val.skill_card_type); const skillCardTitle: undefined | TimelineSkillCardSkillCardTitleField = val.skill_card_title == void 0 ? void 0 : deserializeTimelineSkillCardSkillCardTitleField(val.skill_card_title); const skill: TimelineSkillCardSkillField = deserializeTimelineSkillCardSkillField(val.skill); const invocation: TimelineSkillCardInvocationField = deserializeTimelineSkillCardInvocationField(val.invocation); - const duration: undefined | number = isJson(val.duration, "number") ? val.duration : void 0; - const entries: readonly TimelineSkillCardEntriesField[] = val.entries.map(function (itm: Json): any { + const duration: undefined | number = val.duration == void 0 ? void 0 : val.duration; + const entries: readonly TimelineSkillCardEntriesField[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTimelineSkillCardEntriesField(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { createdAt: createdAt, type: type, skillCardType: skillCardType, skillCardTitle: skillCardTitle, skill: skill, invocation: invocation, duration: duration, entries: entries } satisfies TimelineSkillCard; } export function serializeTranscriptSkillCardTypeField(val: TranscriptSkillCardTypeField): Json { @@ -10083,10 +10043,10 @@ export function deserializeTranscriptSkillCardSkillCardTypeField(val: any): Tran throw "".concat("Invalid value: ", val) as string; } export function serializeTranscriptSkillCardSkillCardTitleField(val: TranscriptSkillCardSkillCardTitleField): Json { - return { ["code"]: val.code, ["message"]: val.message }; + return { ["code"]: val.code == void 0 ? void 0 : val.code, ["message"]: val.message }; } export function deserializeTranscriptSkillCardSkillCardTitleField(val: any): TranscriptSkillCardSkillCardTitleField { - const code: undefined | string = isJson(val.code, "string") ? val.code : void 0; + const code: undefined | string = val.code == void 0 ? void 0 : val.code; const message: string = val.message; return { code: code, message: message } satisfies TranscriptSkillCardSkillCardTitleField; } @@ -10131,40 +10091,40 @@ export function deserializeTranscriptSkillCardInvocationField(val: any): Transcr return { type: type, id: id } satisfies TranscriptSkillCardInvocationField; } export function serializeTranscriptSkillCardEntriesFieldAppearsField(val: TranscriptSkillCardEntriesFieldAppearsField): Json { - return { ["start"]: val.start }; + return { ["start"]: val.start == void 0 ? void 0 : val.start }; } export function deserializeTranscriptSkillCardEntriesFieldAppearsField(val: any): TranscriptSkillCardEntriesFieldAppearsField { - const start: undefined | number = isJson(val.start, "number") ? val.start : void 0; + const start: undefined | number = val.start == void 0 ? void 0 : val.start; return { start: start } satisfies TranscriptSkillCardEntriesFieldAppearsField; } export function serializeTranscriptSkillCardEntriesField(val: TranscriptSkillCardEntriesField): Json { - return { ["text"]: val.text, ["appears"]: val.appears == void 0 ? void 0 : val.appears.map(function (item: TranscriptSkillCardEntriesFieldAppearsField): any { + return { ["text"]: val.text == void 0 ? void 0 : val.text, ["appears"]: val.appears == void 0 ? void 0 : val.appears.map(function (item: TranscriptSkillCardEntriesFieldAppearsField): any { return serializeTranscriptSkillCardEntriesFieldAppearsField(item); }) as readonly any[] }; } export function deserializeTranscriptSkillCardEntriesField(val: any): TranscriptSkillCardEntriesField { - const text: undefined | string = isJson(val.text, "string") ? val.text : void 0; - const appears: undefined | readonly TranscriptSkillCardEntriesFieldAppearsField[] = isJson(val.appears, "array") ? val.appears.map(function (itm: Json): any { + const text: undefined | string = val.text == void 0 ? void 0 : val.text; + const appears: undefined | readonly TranscriptSkillCardEntriesFieldAppearsField[] = val.appears == void 0 ? void 0 : isJson(val.appears, "array") ? val.appears.map(function (itm: Json): any { return deserializeTranscriptSkillCardEntriesFieldAppearsField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { text: text, appears: appears } satisfies TranscriptSkillCardEntriesField; } export function serializeTranscriptSkillCard(val: TranscriptSkillCard): Json { - return { ["created_at"]: val.createdAt, ["type"]: serializeTranscriptSkillCardTypeField(val.type), ["skill_card_type"]: serializeTranscriptSkillCardSkillCardTypeField(val.skillCardType), ["skill_card_title"]: val.skillCardTitle == void 0 ? void 0 : serializeTranscriptSkillCardSkillCardTitleField(val.skillCardTitle), ["skill"]: serializeTranscriptSkillCardSkillField(val.skill), ["invocation"]: serializeTranscriptSkillCardInvocationField(val.invocation), ["duration"]: val.duration, ["entries"]: val.entries.map(function (item: TranscriptSkillCardEntriesField): any { + return { ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["type"]: serializeTranscriptSkillCardTypeField(val.type), ["skill_card_type"]: serializeTranscriptSkillCardSkillCardTypeField(val.skillCardType), ["skill_card_title"]: val.skillCardTitle == void 0 ? void 0 : serializeTranscriptSkillCardSkillCardTitleField(val.skillCardTitle), ["skill"]: serializeTranscriptSkillCardSkillField(val.skill), ["invocation"]: serializeTranscriptSkillCardInvocationField(val.invocation), ["duration"]: val.duration == void 0 ? void 0 : val.duration, ["entries"]: val.entries.map(function (item: TranscriptSkillCardEntriesField): any { return serializeTranscriptSkillCardEntriesField(item); }) as readonly any[] }; } export function deserializeTranscriptSkillCard(val: any): TranscriptSkillCard { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const type: TranscriptSkillCardTypeField = deserializeTranscriptSkillCardTypeField(val.type); const skillCardType: TranscriptSkillCardSkillCardTypeField = deserializeTranscriptSkillCardSkillCardTypeField(val.skill_card_type); const skillCardTitle: undefined | TranscriptSkillCardSkillCardTitleField = val.skill_card_title == void 0 ? void 0 : deserializeTranscriptSkillCardSkillCardTitleField(val.skill_card_title); const skill: TranscriptSkillCardSkillField = deserializeTranscriptSkillCardSkillField(val.skill); const invocation: TranscriptSkillCardInvocationField = deserializeTranscriptSkillCardInvocationField(val.invocation); - const duration: undefined | number = isJson(val.duration, "number") ? val.duration : void 0; - const entries: readonly TranscriptSkillCardEntriesField[] = val.entries.map(function (itm: Json): any { + const duration: undefined | number = val.duration == void 0 ? void 0 : val.duration; + const entries: readonly TranscriptSkillCardEntriesField[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeTranscriptSkillCardEntriesField(itm); - }) as readonly any[]; + }) as readonly any[] : []; return { createdAt: createdAt, type: type, skillCardType: skillCardType, skillCardTitle: skillCardTitle, skill: skill, invocation: invocation, duration: duration, entries: entries } satisfies TranscriptSkillCard; } export function serializeStatusSkillCardTypeField(val: StatusSkillCardTypeField): Json { @@ -10192,10 +10152,10 @@ export function deserializeStatusSkillCardSkillCardTypeField(val: any): StatusSk throw "".concat("Invalid value: ", val) as string; } export function serializeStatusSkillCardSkillCardTitleField(val: StatusSkillCardSkillCardTitleField): Json { - return { ["code"]: val.code, ["message"]: val.message }; + return { ["code"]: val.code == void 0 ? void 0 : val.code, ["message"]: val.message }; } export function deserializeStatusSkillCardSkillCardTitleField(val: any): StatusSkillCardSkillCardTitleField { - const code: undefined | string = isJson(val.code, "string") ? val.code : void 0; + const code: undefined | string = val.code == void 0 ? void 0 : val.code; const message: string = val.message; return { code: code, message: message } satisfies StatusSkillCardSkillCardTitleField; } @@ -10224,11 +10184,11 @@ export function deserializeStatusSkillCardStatusFieldCodeField(val: any): Status throw "".concat("Invalid value: ", val) as string; } export function serializeStatusSkillCardStatusField(val: StatusSkillCardStatusField): Json { - return { ["code"]: serializeStatusSkillCardStatusFieldCodeField(val.code), ["message"]: val.message }; + return { ["code"]: serializeStatusSkillCardStatusFieldCodeField(val.code), ["message"]: val.message == void 0 ? void 0 : val.message }; } export function deserializeStatusSkillCardStatusField(val: any): StatusSkillCardStatusField { const code: StatusSkillCardStatusFieldCodeField = deserializeStatusSkillCardStatusFieldCodeField(val.code); - const message: undefined | string = isJson(val.message, "string") ? val.message : void 0; + const message: undefined | string = val.message == void 0 ? void 0 : val.message; return { code: code, message: message } satisfies StatusSkillCardStatusField; } export function serializeStatusSkillCardSkillFieldTypeField(val: StatusSkillCardSkillFieldTypeField): Json { @@ -10272,10 +10232,10 @@ export function deserializeStatusSkillCardInvocationField(val: any): StatusSkill return { type: type, id: id } satisfies StatusSkillCardInvocationField; } export function serializeStatusSkillCard(val: StatusSkillCard): Json { - return { ["created_at"]: val.createdAt, ["type"]: serializeStatusSkillCardTypeField(val.type), ["skill_card_type"]: serializeStatusSkillCardSkillCardTypeField(val.skillCardType), ["skill_card_title"]: val.skillCardTitle == void 0 ? void 0 : serializeStatusSkillCardSkillCardTitleField(val.skillCardTitle), ["status"]: serializeStatusSkillCardStatusField(val.status), ["skill"]: serializeStatusSkillCardSkillField(val.skill), ["invocation"]: serializeStatusSkillCardInvocationField(val.invocation) }; + return { ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["type"]: serializeStatusSkillCardTypeField(val.type), ["skill_card_type"]: serializeStatusSkillCardSkillCardTypeField(val.skillCardType), ["skill_card_title"]: val.skillCardTitle == void 0 ? void 0 : serializeStatusSkillCardSkillCardTitleField(val.skillCardTitle), ["status"]: serializeStatusSkillCardStatusField(val.status), ["skill"]: serializeStatusSkillCardSkillField(val.skill), ["invocation"]: serializeStatusSkillCardInvocationField(val.invocation) }; } export function deserializeStatusSkillCard(val: any): StatusSkillCard { - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; const type: StatusSkillCardTypeField = deserializeStatusSkillCardTypeField(val.type); const skillCardType: StatusSkillCardSkillCardTypeField = deserializeStatusSkillCardSkillCardTypeField(val.skill_card_type); const skillCardTitle: undefined | StatusSkillCardSkillCardTitleField = val.skill_card_title == void 0 ? void 0 : deserializeStatusSkillCardSkillCardTitleField(val.skill_card_title); @@ -10291,22 +10251,22 @@ export function deserializeKeywordSkillCardOrStatusSkillCardOrTimelineSkillCardO throw "Can't deserialize KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard"; } export function serializeSkillCardsMetadata(val: SkillCardsMetadata): Json { - return { ["$canEdit"]: val.canEdit, ["$id"]: val.id, ["$parent"]: val.parent, ["$scope"]: val.scope, ["$template"]: val.template, ["$type"]: val.type, ["$typeVersion"]: val.typeVersion, ["$version"]: val.version, ["cards"]: val.cards == void 0 ? void 0 : val.cards.map(function (item: KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard): any { + return { ["$canEdit"]: val.canEdit == void 0 ? void 0 : val.canEdit, ["$id"]: val.id == void 0 ? void 0 : val.id, ["$parent"]: val.parent == void 0 ? void 0 : val.parent, ["$scope"]: val.scope == void 0 ? void 0 : val.scope, ["$template"]: val.template == void 0 ? void 0 : val.template, ["$type"]: val.type == void 0 ? void 0 : val.type, ["$typeVersion"]: val.typeVersion == void 0 ? void 0 : val.typeVersion, ["$version"]: val.version == void 0 ? void 0 : val.version, ["cards"]: val.cards == void 0 ? void 0 : val.cards.map(function (item: KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard): any { return serializeKeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard(item); }) as readonly any[] }; } export function deserializeSkillCardsMetadata(val: any): SkillCardsMetadata { - const canEdit: undefined | boolean = isJson(val.$canEdit, "boolean") ? val.$canEdit : void 0; - const id: undefined | string = isJson(val.$id, "string") ? val.$id : void 0; - const parent: undefined | string = isJson(val.$parent, "string") ? val.$parent : void 0; - const scope: undefined | string = isJson(val.$scope, "string") ? val.$scope : void 0; - const template: undefined | string = isJson(val.$template, "string") ? val.$template : void 0; - const type: undefined | string = isJson(val.$type, "string") ? val.$type : void 0; - const typeVersion: undefined | number = isJson(val.$typeVersion, "number") ? val.$typeVersion : void 0; - const version: undefined | number = isJson(val.$version, "number") ? val.$version : void 0; - const cards: undefined | readonly KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard[] = isJson(val.cards, "array") ? val.cards.map(function (itm: Json): any { + const canEdit: undefined | boolean = val.$canEdit == void 0 ? void 0 : val.$canEdit; + const id: undefined | string = val.$id == void 0 ? void 0 : val.$id; + const parent: undefined | string = val.$parent == void 0 ? void 0 : val.$parent; + const scope: undefined | string = val.$scope == void 0 ? void 0 : val.$scope; + const template: undefined | string = val.$template == void 0 ? void 0 : val.$template; + const type: undefined | string = val.$type == void 0 ? void 0 : val.$type; + const typeVersion: undefined | number = val.$typeVersion == void 0 ? void 0 : val.$typeVersion; + const version: undefined | number = val.$version == void 0 ? void 0 : val.$version; + const cards: undefined | readonly KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard[] = val.cards == void 0 ? void 0 : isJson(val.cards, "array") ? val.cards.map(function (itm: Json): any { return deserializeKeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { canEdit: canEdit, id: id, parent: parent, scope: scope, template: template, type: type, typeVersion: typeVersion, version: version, cards: cards } satisfies SkillCardsMetadata; } export function serializeSignRequestCreateSignerRoleField(val: SignRequestCreateSignerRoleField): Json { @@ -10328,29 +10288,29 @@ export function deserializeSignRequestCreateSignerRoleField(val: any): SignReque throw "".concat("Invalid value: ", val) as string; } export function serializeSignRequestCreateSigner(val: SignRequestCreateSigner): Json { - return { ["email"]: val.email, ["role"]: val.role == void 0 ? void 0 : serializeSignRequestCreateSignerRoleField(val.role), ["is_in_person"]: val.isInPerson, ["order"]: val.order, ["embed_url_external_user_id"]: val.embedUrlExternalUserId, ["redirect_url"]: val.redirectUrl, ["declined_redirect_url"]: val.declinedRedirectUrl, ["login_required"]: val.loginRequired, ["verification_phone_number"]: val.verificationPhoneNumber, ["password"]: val.password }; + return { ["email"]: val.email, ["role"]: val.role == void 0 ? void 0 : serializeSignRequestCreateSignerRoleField(val.role), ["is_in_person"]: val.isInPerson == void 0 ? void 0 : val.isInPerson, ["order"]: val.order == void 0 ? void 0 : val.order, ["embed_url_external_user_id"]: val.embedUrlExternalUserId == void 0 ? void 0 : val.embedUrlExternalUserId, ["redirect_url"]: val.redirectUrl == void 0 ? void 0 : val.redirectUrl, ["declined_redirect_url"]: val.declinedRedirectUrl == void 0 ? void 0 : val.declinedRedirectUrl, ["login_required"]: val.loginRequired == void 0 ? void 0 : val.loginRequired, ["verification_phone_number"]: val.verificationPhoneNumber == void 0 ? void 0 : val.verificationPhoneNumber, ["password"]: val.password == void 0 ? void 0 : val.password }; } export function deserializeSignRequestCreateSigner(val: any): SignRequestCreateSigner { const email: string = val.email; const role: undefined | SignRequestCreateSignerRoleField = val.role == void 0 ? void 0 : deserializeSignRequestCreateSignerRoleField(val.role); - const isInPerson: undefined | boolean = isJson(val.is_in_person, "boolean") ? val.is_in_person : void 0; - const order: undefined | number = isJson(val.order, "number") ? val.order : void 0; - const embedUrlExternalUserId: undefined | string = isJson(val.embed_url_external_user_id, "string") ? val.embed_url_external_user_id : void 0; - const redirectUrl: undefined | string = isJson(val.redirect_url, "string") ? val.redirect_url : void 0; - const declinedRedirectUrl: undefined | string = isJson(val.declined_redirect_url, "string") ? val.declined_redirect_url : void 0; - const loginRequired: undefined | boolean = isJson(val.login_required, "boolean") ? val.login_required : void 0; - const verificationPhoneNumber: undefined | string = isJson(val.verification_phone_number, "string") ? val.verification_phone_number : void 0; - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; + const isInPerson: undefined | boolean = val.is_in_person == void 0 ? void 0 : val.is_in_person; + const order: undefined | number = val.order == void 0 ? void 0 : val.order; + const embedUrlExternalUserId: undefined | string = val.embed_url_external_user_id == void 0 ? void 0 : val.embed_url_external_user_id; + const redirectUrl: undefined | string = val.redirect_url == void 0 ? void 0 : val.redirect_url; + const declinedRedirectUrl: undefined | string = val.declined_redirect_url == void 0 ? void 0 : val.declined_redirect_url; + const loginRequired: undefined | boolean = val.login_required == void 0 ? void 0 : val.login_required; + const verificationPhoneNumber: undefined | string = val.verification_phone_number == void 0 ? void 0 : val.verification_phone_number; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; return { email: email, role: role, isInPerson: isInPerson, order: order, embedUrlExternalUserId: embedUrlExternalUserId, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, loginRequired: loginRequired, verificationPhoneNumber: verificationPhoneNumber, password: password } satisfies SignRequestCreateSigner; } export function serializeSignRequestPrefillTag(val: SignRequestPrefillTag): Json { - return { ["document_tag_id"]: val.documentTagId, ["text_value"]: val.textValue, ["checkbox_value"]: val.checkboxValue, ["date_value"]: val.dateValue }; + return { ["document_tag_id"]: val.documentTagId == void 0 ? void 0 : val.documentTagId, ["text_value"]: val.textValue == void 0 ? void 0 : val.textValue, ["checkbox_value"]: val.checkboxValue == void 0 ? void 0 : val.checkboxValue, ["date_value"]: val.dateValue == void 0 ? void 0 : val.dateValue }; } export function deserializeSignRequestPrefillTag(val: any): SignRequestPrefillTag { - const documentTagId: undefined | string = isJson(val.document_tag_id, "string") ? val.document_tag_id : void 0; - const textValue: undefined | string = isJson(val.text_value, "string") ? val.text_value : void 0; - const checkboxValue: undefined | boolean = isJson(val.checkbox_value, "boolean") ? val.checkbox_value : void 0; - const dateValue: undefined | string = isJson(val.date_value, "string") ? val.date_value : void 0; + const documentTagId: undefined | string = val.document_tag_id == void 0 ? void 0 : val.document_tag_id; + const textValue: undefined | string = val.text_value == void 0 ? void 0 : val.text_value; + const checkboxValue: undefined | boolean = val.checkbox_value == void 0 ? void 0 : val.checkbox_value; + const dateValue: undefined | string = val.date_value == void 0 ? void 0 : val.date_value; return { documentTagId: documentTagId, textValue: textValue, checkboxValue: checkboxValue, dateValue: dateValue } satisfies SignRequestPrefillTag; } export function serializeSignRequestSignerInputTypeField(val: SignRequestSignerInputTypeField): Json { @@ -10433,10 +10393,10 @@ export function deserializeSignRequestSignerInput(val: any): SignRequestSignerIn const type: undefined | SignRequestSignerInputTypeField = val.type == void 0 ? void 0 : deserializeSignRequestSignerInputTypeField(val.type); const contentType: undefined | SignRequestSignerInputContentTypeField = val.content_type == void 0 ? void 0 : deserializeSignRequestSignerInputContentTypeField(val.content_type); const pageIndex: number = val.page_index; - const documentTagId: undefined | string = isJson(val.document_tag_id, "string") ? val.document_tag_id : void 0; - const textValue: undefined | string = isJson(val.text_value, "string") ? val.text_value : void 0; - const checkboxValue: undefined | boolean = isJson(val.checkbox_value, "boolean") ? val.checkbox_value : void 0; - const dateValue: undefined | string = isJson(val.date_value, "string") ? val.date_value : void 0; + const documentTagId: undefined | string = val.document_tag_id == void 0 ? void 0 : val.document_tag_id; + const textValue: undefined | string = val.text_value == void 0 ? void 0 : val.text_value; + const checkboxValue: undefined | boolean = val.checkbox_value == void 0 ? void 0 : val.checkbox_value; + const dateValue: undefined | string = val.date_value == void 0 ? void 0 : val.date_value; return { type: type, contentType: contentType, pageIndex: pageIndex, documentTagId: documentTagId, textValue: textValue, checkboxValue: checkboxValue, dateValue: dateValue } satisfies SignRequestSignerInput; } export function serializeSignRequestSignerSignerDecisionFieldTypeField(val: SignRequestSignerSignerDecisionFieldTypeField): Json { @@ -10455,11 +10415,11 @@ export function deserializeSignRequestSignerSignerDecisionFieldTypeField(val: an throw "".concat("Invalid value: ", val) as string; } export function serializeSignRequestSignerSignerDecisionField(val: SignRequestSignerSignerDecisionField): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeSignRequestSignerSignerDecisionFieldTypeField(val.type), ["finalized_at"]: val.finalizedAt }; + return { ["type"]: val.type == void 0 ? void 0 : serializeSignRequestSignerSignerDecisionFieldTypeField(val.type), ["finalized_at"]: val.finalizedAt == void 0 ? void 0 : val.finalizedAt }; } export function deserializeSignRequestSignerSignerDecisionField(val: any): SignRequestSignerSignerDecisionField { const type: undefined | SignRequestSignerSignerDecisionFieldTypeField = val.type == void 0 ? void 0 : deserializeSignRequestSignerSignerDecisionFieldTypeField(val.type); - const finalizedAt: undefined | string = isJson(val.finalized_at, "string") ? val.finalized_at : void 0; + const finalizedAt: undefined | string = val.finalized_at == void 0 ? void 0 : val.finalized_at; return { type: type, finalizedAt: finalizedAt } satisfies SignRequestSignerSignerDecisionField; } export function serializeSignRequestSigner(val: SignRequestSigner): Json { @@ -10467,51 +10427,51 @@ export function serializeSignRequestSigner(val: SignRequestSigner): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"SignRequestSigner\""; } - return { ...base, ...{ ["has_viewed_document"]: val.hasViewedDocument, ["signer_decision"]: val.signerDecision == void 0 ? void 0 : serializeSignRequestSignerSignerDecisionField(val.signerDecision), ["inputs"]: val.inputs == void 0 ? void 0 : val.inputs.map(function (item: SignRequestSignerInput): any { + return { ...base, ...{ ["has_viewed_document"]: val.hasViewedDocument == void 0 ? void 0 : val.hasViewedDocument, ["signer_decision"]: val.signerDecision == void 0 ? void 0 : serializeSignRequestSignerSignerDecisionField(val.signerDecision), ["inputs"]: val.inputs == void 0 ? void 0 : val.inputs.map(function (item: SignRequestSignerInput): any { return serializeSignRequestSignerInput(item); - }) as readonly any[], ["embed_url"]: val.embedUrl } }; + }) as readonly any[], ["embed_url"]: val.embedUrl == void 0 ? void 0 : val.embedUrl } }; } export function deserializeSignRequestSigner(val: any): SignRequestSigner { - const hasViewedDocument: undefined | boolean = isJson(val.has_viewed_document, "boolean") ? val.has_viewed_document : void 0; + const hasViewedDocument: undefined | boolean = val.has_viewed_document == void 0 ? void 0 : val.has_viewed_document; const signerDecision: undefined | SignRequestSignerSignerDecisionField = val.signer_decision == void 0 ? void 0 : deserializeSignRequestSignerSignerDecisionField(val.signer_decision); - const inputs: undefined | readonly SignRequestSignerInput[] = isJson(val.inputs, "array") ? val.inputs.map(function (itm: Json): any { + const inputs: undefined | readonly SignRequestSignerInput[] = val.inputs == void 0 ? void 0 : isJson(val.inputs, "array") ? val.inputs.map(function (itm: Json): any { return deserializeSignRequestSignerInput(itm); - }) as readonly any[] : void 0; - const embedUrl: undefined | string = isJson(val.embed_url, "string") ? val.embed_url : void 0; + }) as readonly any[] : []; + const embedUrl: undefined | string = val.embed_url == void 0 ? void 0 : val.embed_url; const email: string = val.email; const role: undefined | SignRequestCreateSignerRoleField = val.role == void 0 ? void 0 : deserializeSignRequestCreateSignerRoleField(val.role); - const isInPerson: undefined | boolean = isJson(val.is_in_person, "boolean") ? val.is_in_person : void 0; - const order: undefined | number = isJson(val.order, "number") ? val.order : void 0; - const embedUrlExternalUserId: undefined | string = isJson(val.embed_url_external_user_id, "string") ? val.embed_url_external_user_id : void 0; - const redirectUrl: undefined | string = isJson(val.redirect_url, "string") ? val.redirect_url : void 0; - const declinedRedirectUrl: undefined | string = isJson(val.declined_redirect_url, "string") ? val.declined_redirect_url : void 0; - const loginRequired: undefined | boolean = isJson(val.login_required, "boolean") ? val.login_required : void 0; - const verificationPhoneNumber: undefined | string = isJson(val.verification_phone_number, "string") ? val.verification_phone_number : void 0; - const password: undefined | string = isJson(val.password, "string") ? val.password : void 0; + const isInPerson: undefined | boolean = val.is_in_person == void 0 ? void 0 : val.is_in_person; + const order: undefined | number = val.order == void 0 ? void 0 : val.order; + const embedUrlExternalUserId: undefined | string = val.embed_url_external_user_id == void 0 ? void 0 : val.embed_url_external_user_id; + const redirectUrl: undefined | string = val.redirect_url == void 0 ? void 0 : val.redirect_url; + const declinedRedirectUrl: undefined | string = val.declined_redirect_url == void 0 ? void 0 : val.declined_redirect_url; + const loginRequired: undefined | boolean = val.login_required == void 0 ? void 0 : val.login_required; + const verificationPhoneNumber: undefined | string = val.verification_phone_number == void 0 ? void 0 : val.verification_phone_number; + const password: undefined | string = val.password == void 0 ? void 0 : val.password; return { hasViewedDocument: hasViewedDocument, signerDecision: signerDecision, inputs: inputs, embedUrl: embedUrl, email: email, role: role, isInPerson: isInPerson, order: order, embedUrlExternalUserId: embedUrlExternalUserId, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, loginRequired: loginRequired, verificationPhoneNumber: verificationPhoneNumber, password: password } satisfies SignRequestSigner; } export function serializeSignRequestBase(val: SignRequestBase): Json { - return { ["is_document_preparation_needed"]: val.isDocumentPreparationNeeded, ["redirect_url"]: val.redirectUrl, ["declined_redirect_url"]: val.declinedRedirectUrl, ["are_text_signatures_enabled"]: val.areTextSignaturesEnabled, ["email_subject"]: val.emailSubject, ["email_message"]: val.emailMessage, ["are_reminders_enabled"]: val.areRemindersEnabled, ["parent_folder"]: serializeFolderMini(val.parentFolder), ["name"]: val.name, ["prefill_tags"]: val.prefillTags == void 0 ? void 0 : val.prefillTags.map(function (item: SignRequestPrefillTag): any { + return { ["is_document_preparation_needed"]: val.isDocumentPreparationNeeded == void 0 ? void 0 : val.isDocumentPreparationNeeded, ["redirect_url"]: val.redirectUrl == void 0 ? void 0 : val.redirectUrl, ["declined_redirect_url"]: val.declinedRedirectUrl == void 0 ? void 0 : val.declinedRedirectUrl, ["are_text_signatures_enabled"]: val.areTextSignaturesEnabled == void 0 ? void 0 : val.areTextSignaturesEnabled, ["email_subject"]: val.emailSubject == void 0 ? void 0 : val.emailSubject, ["email_message"]: val.emailMessage == void 0 ? void 0 : val.emailMessage, ["are_reminders_enabled"]: val.areRemindersEnabled == void 0 ? void 0 : val.areRemindersEnabled, ["parent_folder"]: serializeFolderMini(val.parentFolder), ["name"]: val.name == void 0 ? void 0 : val.name, ["prefill_tags"]: val.prefillTags == void 0 ? void 0 : val.prefillTags.map(function (item: SignRequestPrefillTag): any { return serializeSignRequestPrefillTag(item); - }) as readonly any[], ["days_valid"]: val.daysValid, ["external_id"]: val.externalId, ["is_phone_verification_required_to_view"]: val.isPhoneVerificationRequiredToView, ["template_id"]: val.templateId }; + }) as readonly any[], ["days_valid"]: val.daysValid == void 0 ? void 0 : val.daysValid, ["external_id"]: val.externalId == void 0 ? void 0 : val.externalId, ["is_phone_verification_required_to_view"]: val.isPhoneVerificationRequiredToView == void 0 ? void 0 : val.isPhoneVerificationRequiredToView, ["template_id"]: val.templateId == void 0 ? void 0 : val.templateId }; } export function deserializeSignRequestBase(val: any): SignRequestBase { - const isDocumentPreparationNeeded: undefined | boolean = isJson(val.is_document_preparation_needed, "boolean") ? val.is_document_preparation_needed : void 0; - const redirectUrl: undefined | string = isJson(val.redirect_url, "string") ? val.redirect_url : void 0; - const declinedRedirectUrl: undefined | string = isJson(val.declined_redirect_url, "string") ? val.declined_redirect_url : void 0; - const areTextSignaturesEnabled: undefined | boolean = isJson(val.are_text_signatures_enabled, "boolean") ? val.are_text_signatures_enabled : void 0; - const emailSubject: undefined | string = isJson(val.email_subject, "string") ? val.email_subject : void 0; - const emailMessage: undefined | string = isJson(val.email_message, "string") ? val.email_message : void 0; - const areRemindersEnabled: undefined | boolean = isJson(val.are_reminders_enabled, "boolean") ? val.are_reminders_enabled : void 0; + const isDocumentPreparationNeeded: undefined | boolean = val.is_document_preparation_needed == void 0 ? void 0 : val.is_document_preparation_needed; + const redirectUrl: undefined | string = val.redirect_url == void 0 ? void 0 : val.redirect_url; + const declinedRedirectUrl: undefined | string = val.declined_redirect_url == void 0 ? void 0 : val.declined_redirect_url; + const areTextSignaturesEnabled: undefined | boolean = val.are_text_signatures_enabled == void 0 ? void 0 : val.are_text_signatures_enabled; + const emailSubject: undefined | string = val.email_subject == void 0 ? void 0 : val.email_subject; + const emailMessage: undefined | string = val.email_message == void 0 ? void 0 : val.email_message; + const areRemindersEnabled: undefined | boolean = val.are_reminders_enabled == void 0 ? void 0 : val.are_reminders_enabled; const parentFolder: FolderMini = deserializeFolderMini(val.parent_folder); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const prefillTags: undefined | readonly SignRequestPrefillTag[] = isJson(val.prefill_tags, "array") ? val.prefill_tags.map(function (itm: Json): any { + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const prefillTags: undefined | readonly SignRequestPrefillTag[] = val.prefill_tags == void 0 ? void 0 : isJson(val.prefill_tags, "array") ? val.prefill_tags.map(function (itm: Json): any { return deserializeSignRequestPrefillTag(itm); - }) as readonly any[] : void 0; - const daysValid: undefined | number = isJson(val.days_valid, "number") ? val.days_valid : void 0; - const externalId: undefined | string = isJson(val.external_id, "string") ? val.external_id : void 0; - const isPhoneVerificationRequiredToView: undefined | boolean = isJson(val.is_phone_verification_required_to_view, "boolean") ? val.is_phone_verification_required_to_view : void 0; - const templateId: undefined | string = isJson(val.template_id, "string") ? val.template_id : void 0; + }) as readonly any[] : []; + const daysValid: undefined | number = val.days_valid == void 0 ? void 0 : val.days_valid; + const externalId: undefined | string = val.external_id == void 0 ? void 0 : val.external_id; + const isPhoneVerificationRequiredToView: undefined | boolean = val.is_phone_verification_required_to_view == void 0 ? void 0 : val.is_phone_verification_required_to_view; + const templateId: undefined | string = val.template_id == void 0 ? void 0 : val.template_id; return { isDocumentPreparationNeeded: isDocumentPreparationNeeded, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, areTextSignaturesEnabled: areTextSignaturesEnabled, emailSubject: emailSubject, emailMessage: emailMessage, areRemindersEnabled: areRemindersEnabled, parentFolder: parentFolder, name: name, prefillTags: prefillTags, daysValid: daysValid, externalId: externalId, isPhoneVerificationRequiredToView: isPhoneVerificationRequiredToView, templateId: templateId } satisfies SignRequestBase; } export function serializeSignRequestTypeField(val: SignRequestTypeField): Json { @@ -10574,13 +10534,13 @@ export function deserializeSignRequestStatusField(val: any): SignRequestStatusFi export function serializeSignRequestSignFilesField(val: SignRequestSignFilesField): Json { return { ["files"]: val.files == void 0 ? void 0 : val.files.map(function (item: FileMini): any { return serializeFileMini(item); - }) as readonly any[], ["is_ready_for_download"]: val.isReadyForDownload }; + }) as readonly any[], ["is_ready_for_download"]: val.isReadyForDownload == void 0 ? void 0 : val.isReadyForDownload }; } export function deserializeSignRequestSignFilesField(val: any): SignRequestSignFilesField { - const files: undefined | readonly FileMini[] = isJson(val.files, "array") ? val.files.map(function (itm: Json): any { + const files: undefined | readonly FileMini[] = val.files == void 0 ? void 0 : isJson(val.files, "array") ? val.files.map(function (itm: Json): any { return deserializeFileMini(itm); - }) as readonly any[] : void 0; - const isReadyForDownload: undefined | boolean = isJson(val.is_ready_for_download, "boolean") ? val.is_ready_for_download : void 0; + }) as readonly any[] : []; + const isReadyForDownload: undefined | boolean = val.is_ready_for_download == void 0 ? void 0 : val.is_ready_for_download; return { files: files, isReadyForDownload: isReadyForDownload } satisfies SignRequestSignFilesField; } export function serializeSignRequest(val: SignRequest): Json { @@ -10592,53 +10552,53 @@ export function serializeSignRequest(val: SignRequest): Json { return serializeFileBase(item); }) as readonly any[], ["signers"]: val.signers == void 0 ? void 0 : val.signers.map(function (item: SignRequestSigner): any { return serializeSignRequestSigner(item); - }) as readonly any[], ["signature_color"]: val.signatureColor, ["id"]: val.id, ["prepare_url"]: val.prepareUrl, ["signing_log"]: val.signingLog == void 0 ? void 0 : serializeFileMini(val.signingLog), ["status"]: val.status == void 0 ? void 0 : serializeSignRequestStatusField(val.status), ["sign_files"]: val.signFiles == void 0 ? void 0 : serializeSignRequestSignFilesField(val.signFiles), ["auto_expire_at"]: val.autoExpireAt } }; + }) as readonly any[], ["signature_color"]: val.signatureColor == void 0 ? void 0 : val.signatureColor, ["id"]: val.id == void 0 ? void 0 : val.id, ["prepare_url"]: val.prepareUrl == void 0 ? void 0 : val.prepareUrl, ["signing_log"]: val.signingLog == void 0 ? void 0 : serializeFileMini(val.signingLog), ["status"]: val.status == void 0 ? void 0 : serializeSignRequestStatusField(val.status), ["sign_files"]: val.signFiles == void 0 ? void 0 : serializeSignRequestSignFilesField(val.signFiles), ["auto_expire_at"]: val.autoExpireAt == void 0 ? void 0 : val.autoExpireAt } }; } export function deserializeSignRequest(val: any): SignRequest { const type: undefined | SignRequestTypeField = val.type == void 0 ? void 0 : deserializeSignRequestTypeField(val.type); - const sourceFiles: undefined | readonly FileBase[] = isJson(val.source_files, "array") ? val.source_files.map(function (itm: Json): any { + const sourceFiles: undefined | readonly FileBase[] = val.source_files == void 0 ? void 0 : isJson(val.source_files, "array") ? val.source_files.map(function (itm: Json): any { return deserializeFileBase(itm); - }) as readonly any[] : void 0; - const signers: undefined | readonly SignRequestSigner[] = isJson(val.signers, "array") ? val.signers.map(function (itm: Json): any { + }) as readonly any[] : []; + const signers: undefined | readonly SignRequestSigner[] = val.signers == void 0 ? void 0 : isJson(val.signers, "array") ? val.signers.map(function (itm: Json): any { return deserializeSignRequestSigner(itm); - }) as readonly any[] : void 0; - const signatureColor: undefined | string = isJson(val.signature_color, "string") ? val.signature_color : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const prepareUrl: undefined | string = isJson(val.prepare_url, "string") ? val.prepare_url : void 0; + }) as readonly any[] : []; + const signatureColor: undefined | string = val.signature_color == void 0 ? void 0 : val.signature_color; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const prepareUrl: undefined | string = val.prepare_url == void 0 ? void 0 : val.prepare_url; const signingLog: undefined | FileMini = val.signing_log == void 0 ? void 0 : deserializeFileMini(val.signing_log); const status: undefined | SignRequestStatusField = val.status == void 0 ? void 0 : deserializeSignRequestStatusField(val.status); const signFiles: undefined | SignRequestSignFilesField = val.sign_files == void 0 ? void 0 : deserializeSignRequestSignFilesField(val.sign_files); - const autoExpireAt: undefined | string = isJson(val.auto_expire_at, "string") ? val.auto_expire_at : void 0; - const isDocumentPreparationNeeded: undefined | boolean = isJson(val.is_document_preparation_needed, "boolean") ? val.is_document_preparation_needed : void 0; - const redirectUrl: undefined | string = isJson(val.redirect_url, "string") ? val.redirect_url : void 0; - const declinedRedirectUrl: undefined | string = isJson(val.declined_redirect_url, "string") ? val.declined_redirect_url : void 0; - const areTextSignaturesEnabled: undefined | boolean = isJson(val.are_text_signatures_enabled, "boolean") ? val.are_text_signatures_enabled : void 0; - const emailSubject: undefined | string = isJson(val.email_subject, "string") ? val.email_subject : void 0; - const emailMessage: undefined | string = isJson(val.email_message, "string") ? val.email_message : void 0; - const areRemindersEnabled: undefined | boolean = isJson(val.are_reminders_enabled, "boolean") ? val.are_reminders_enabled : void 0; + const autoExpireAt: undefined | string = val.auto_expire_at == void 0 ? void 0 : val.auto_expire_at; + const isDocumentPreparationNeeded: undefined | boolean = val.is_document_preparation_needed == void 0 ? void 0 : val.is_document_preparation_needed; + const redirectUrl: undefined | string = val.redirect_url == void 0 ? void 0 : val.redirect_url; + const declinedRedirectUrl: undefined | string = val.declined_redirect_url == void 0 ? void 0 : val.declined_redirect_url; + const areTextSignaturesEnabled: undefined | boolean = val.are_text_signatures_enabled == void 0 ? void 0 : val.are_text_signatures_enabled; + const emailSubject: undefined | string = val.email_subject == void 0 ? void 0 : val.email_subject; + const emailMessage: undefined | string = val.email_message == void 0 ? void 0 : val.email_message; + const areRemindersEnabled: undefined | boolean = val.are_reminders_enabled == void 0 ? void 0 : val.are_reminders_enabled; const parentFolder: FolderMini = deserializeFolderMini(val.parent_folder); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const prefillTags: undefined | readonly SignRequestPrefillTag[] = isJson(val.prefill_tags, "array") ? val.prefill_tags.map(function (itm: Json): any { + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const prefillTags: undefined | readonly SignRequestPrefillTag[] = val.prefill_tags == void 0 ? void 0 : isJson(val.prefill_tags, "array") ? val.prefill_tags.map(function (itm: Json): any { return deserializeSignRequestPrefillTag(itm); - }) as readonly any[] : void 0; - const daysValid: undefined | number = isJson(val.days_valid, "number") ? val.days_valid : void 0; - const externalId: undefined | string = isJson(val.external_id, "string") ? val.external_id : void 0; - const isPhoneVerificationRequiredToView: undefined | boolean = isJson(val.is_phone_verification_required_to_view, "boolean") ? val.is_phone_verification_required_to_view : void 0; - const templateId: undefined | string = isJson(val.template_id, "string") ? val.template_id : void 0; + }) as readonly any[] : []; + const daysValid: undefined | number = val.days_valid == void 0 ? void 0 : val.days_valid; + const externalId: undefined | string = val.external_id == void 0 ? void 0 : val.external_id; + const isPhoneVerificationRequiredToView: undefined | boolean = val.is_phone_verification_required_to_view == void 0 ? void 0 : val.is_phone_verification_required_to_view; + const templateId: undefined | string = val.template_id == void 0 ? void 0 : val.template_id; return { type: type, sourceFiles: sourceFiles, signers: signers, signatureColor: signatureColor, id: id, prepareUrl: prepareUrl, signingLog: signingLog, status: status, signFiles: signFiles, autoExpireAt: autoExpireAt, isDocumentPreparationNeeded: isDocumentPreparationNeeded, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, areTextSignaturesEnabled: areTextSignaturesEnabled, emailSubject: emailSubject, emailMessage: emailMessage, areRemindersEnabled: areRemindersEnabled, parentFolder: parentFolder, name: name, prefillTags: prefillTags, daysValid: daysValid, externalId: externalId, isPhoneVerificationRequiredToView: isPhoneVerificationRequiredToView, templateId: templateId } satisfies SignRequest; } export function serializeSignRequests(val: SignRequests): Json { - return { ["limit"]: val.limit, ["next_marker"]: val.nextMarker, ["prev_marker"]: val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: SignRequest): any { + return { ["limit"]: val.limit == void 0 ? void 0 : val.limit, ["next_marker"]: val.nextMarker == void 0 ? void 0 : val.nextMarker, ["prev_marker"]: val.prevMarker == void 0 ? void 0 : val.prevMarker, ["entries"]: val.entries == void 0 ? void 0 : val.entries.map(function (item: SignRequest): any { return serializeSignRequest(item); }) as readonly any[] }; } export function deserializeSignRequests(val: any): SignRequests { - const limit: undefined | number = isJson(val.limit, "number") ? val.limit : void 0; - const nextMarker: undefined | number = isJson(val.next_marker, "number") ? val.next_marker : void 0; - const prevMarker: undefined | number = isJson(val.prev_marker, "number") ? val.prev_marker : void 0; - const entries: undefined | readonly SignRequest[] = isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + const nextMarker: undefined | number = val.next_marker == void 0 ? void 0 : val.next_marker; + const prevMarker: undefined | number = val.prev_marker == void 0 ? void 0 : val.prev_marker; + const entries: undefined | readonly SignRequest[] = val.entries == void 0 ? void 0 : isJson(val.entries, "array") ? val.entries.map(function (itm: Json): any { return deserializeSignRequest(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; return { limit: limit, nextMarker: nextMarker, prevMarker: prevMarker, entries: entries } satisfies SignRequests; } export function serializeSignRequestCreateRequest(val: SignRequestCreateRequest): Json { @@ -10653,28 +10613,28 @@ export function serializeSignRequestCreateRequest(val: SignRequestCreateRequest) }) as readonly any[] } }; } export function deserializeSignRequestCreateRequest(val: any): SignRequestCreateRequest { - const sourceFiles: undefined | readonly FileBase[] = isJson(val.source_files, "array") ? val.source_files.map(function (itm: Json): any { + const sourceFiles: undefined | readonly FileBase[] = val.source_files == void 0 ? void 0 : isJson(val.source_files, "array") ? val.source_files.map(function (itm: Json): any { return deserializeFileBase(itm); - }) as readonly any[] : void 0; - const signers: readonly SignRequestCreateSigner[] = val.signers.map(function (itm: Json): any { + }) as readonly any[] : []; + const signers: readonly SignRequestCreateSigner[] = isJson(val.signers, "array") ? val.signers.map(function (itm: Json): any { return deserializeSignRequestCreateSigner(itm); - }) as readonly any[]; - const isDocumentPreparationNeeded: undefined | boolean = isJson(val.is_document_preparation_needed, "boolean") ? val.is_document_preparation_needed : void 0; - const redirectUrl: undefined | string = isJson(val.redirect_url, "string") ? val.redirect_url : void 0; - const declinedRedirectUrl: undefined | string = isJson(val.declined_redirect_url, "string") ? val.declined_redirect_url : void 0; - const areTextSignaturesEnabled: undefined | boolean = isJson(val.are_text_signatures_enabled, "boolean") ? val.are_text_signatures_enabled : void 0; - const emailSubject: undefined | string = isJson(val.email_subject, "string") ? val.email_subject : void 0; - const emailMessage: undefined | string = isJson(val.email_message, "string") ? val.email_message : void 0; - const areRemindersEnabled: undefined | boolean = isJson(val.are_reminders_enabled, "boolean") ? val.are_reminders_enabled : void 0; + }) as readonly any[] : []; + const isDocumentPreparationNeeded: undefined | boolean = val.is_document_preparation_needed == void 0 ? void 0 : val.is_document_preparation_needed; + const redirectUrl: undefined | string = val.redirect_url == void 0 ? void 0 : val.redirect_url; + const declinedRedirectUrl: undefined | string = val.declined_redirect_url == void 0 ? void 0 : val.declined_redirect_url; + const areTextSignaturesEnabled: undefined | boolean = val.are_text_signatures_enabled == void 0 ? void 0 : val.are_text_signatures_enabled; + const emailSubject: undefined | string = val.email_subject == void 0 ? void 0 : val.email_subject; + const emailMessage: undefined | string = val.email_message == void 0 ? void 0 : val.email_message; + const areRemindersEnabled: undefined | boolean = val.are_reminders_enabled == void 0 ? void 0 : val.are_reminders_enabled; const parentFolder: FolderMini = deserializeFolderMini(val.parent_folder); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const prefillTags: undefined | readonly SignRequestPrefillTag[] = isJson(val.prefill_tags, "array") ? val.prefill_tags.map(function (itm: Json): any { + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const prefillTags: undefined | readonly SignRequestPrefillTag[] = val.prefill_tags == void 0 ? void 0 : isJson(val.prefill_tags, "array") ? val.prefill_tags.map(function (itm: Json): any { return deserializeSignRequestPrefillTag(itm); - }) as readonly any[] : void 0; - const daysValid: undefined | number = isJson(val.days_valid, "number") ? val.days_valid : void 0; - const externalId: undefined | string = isJson(val.external_id, "string") ? val.external_id : void 0; - const isPhoneVerificationRequiredToView: undefined | boolean = isJson(val.is_phone_verification_required_to_view, "boolean") ? val.is_phone_verification_required_to_view : void 0; - const templateId: undefined | string = isJson(val.template_id, "string") ? val.template_id : void 0; + }) as readonly any[] : []; + const daysValid: undefined | number = val.days_valid == void 0 ? void 0 : val.days_valid; + const externalId: undefined | string = val.external_id == void 0 ? void 0 : val.external_id; + const isPhoneVerificationRequiredToView: undefined | boolean = val.is_phone_verification_required_to_view == void 0 ? void 0 : val.is_phone_verification_required_to_view; + const templateId: undefined | string = val.template_id == void 0 ? void 0 : val.template_id; return { sourceFiles: sourceFiles, signers: signers, isDocumentPreparationNeeded: isDocumentPreparationNeeded, redirectUrl: redirectUrl, declinedRedirectUrl: declinedRedirectUrl, areTextSignaturesEnabled: areTextSignaturesEnabled, emailSubject: emailSubject, emailMessage: emailMessage, areRemindersEnabled: areRemindersEnabled, parentFolder: parentFolder, name: name, prefillTags: prefillTags, daysValid: daysValid, externalId: externalId, isPhoneVerificationRequiredToView: isPhoneVerificationRequiredToView, templateId: templateId } satisfies SignRequestCreateRequest; } export function serializeTemplateSignerInputTypeField(val: TemplateSignerInputTypeField): Json { @@ -10759,19 +10719,19 @@ export function deserializeTemplateSignerInputContentTypeField(val: any): Templa throw "".concat("Invalid value: ", val) as string; } export function serializeTemplateSignerInputCoordinatesField(val: TemplateSignerInputCoordinatesField): Json { - return { ["x"]: val.x, ["y"]: val.y }; + return { ["x"]: val.x == void 0 ? void 0 : val.x, ["y"]: val.y == void 0 ? void 0 : val.y }; } export function deserializeTemplateSignerInputCoordinatesField(val: any): TemplateSignerInputCoordinatesField { - const x: undefined | number = isJson(val.x, "number") ? val.x : void 0; - const y: undefined | number = isJson(val.y, "number") ? val.y : void 0; + const x: undefined | number = val.x == void 0 ? void 0 : val.x; + const y: undefined | number = val.y == void 0 ? void 0 : val.y; return { x: x, y: y } satisfies TemplateSignerInputCoordinatesField; } export function serializeTemplateSignerInputDimensionsField(val: TemplateSignerInputDimensionsField): Json { - return { ["width"]: val.width, ["height"]: val.height }; + return { ["width"]: val.width == void 0 ? void 0 : val.width, ["height"]: val.height == void 0 ? void 0 : val.height }; } export function deserializeTemplateSignerInputDimensionsField(val: any): TemplateSignerInputDimensionsField { - const width: undefined | number = isJson(val.width, "number") ? val.width : void 0; - const height: undefined | number = isJson(val.height, "number") ? val.height : void 0; + const width: undefined | number = val.width == void 0 ? void 0 : val.width; + const height: undefined | number = val.height == void 0 ? void 0 : val.height; return { width: width, height: height } satisfies TemplateSignerInputDimensionsField; } export function serializeTemplateSignerInput(val: TemplateSignerInput): Json { @@ -10779,26 +10739,26 @@ export function serializeTemplateSignerInput(val: TemplateSignerInput): Json { if (!isJson(base, "object")) { throw "Expecting an object for \"TemplateSignerInput\""; } - return { ...base, ...{ ["type"]: val.type == void 0 ? void 0 : serializeTemplateSignerInputTypeField(val.type), ["content_type"]: val.contentType == void 0 ? void 0 : serializeTemplateSignerInputContentTypeField(val.contentType), ["is_required"]: val.isRequired, ["page_index"]: val.pageIndex, ["document_id"]: val.documentId, ["dropdown_choices"]: val.dropdownChoices == void 0 ? void 0 : val.dropdownChoices.map(function (item: string): undefined { - return void 0; - }) as readonly any[], ["group_id"]: val.groupId, ["coordinates"]: val.coordinates == void 0 ? void 0 : serializeTemplateSignerInputCoordinatesField(val.coordinates), ["dimensions"]: val.dimensions == void 0 ? void 0 : serializeTemplateSignerInputDimensionsField(val.dimensions) } }; + return { ...base, ...{ ["type"]: val.type == void 0 ? void 0 : serializeTemplateSignerInputTypeField(val.type), ["content_type"]: val.contentType == void 0 ? void 0 : serializeTemplateSignerInputContentTypeField(val.contentType), ["is_required"]: val.isRequired == void 0 ? void 0 : val.isRequired, ["page_index"]: val.pageIndex, ["document_id"]: val.documentId == void 0 ? void 0 : val.documentId, ["dropdown_choices"]: val.dropdownChoices == void 0 ? void 0 : val.dropdownChoices.map(function (item: string): string { + return item; + }) as readonly any[], ["group_id"]: val.groupId == void 0 ? void 0 : val.groupId, ["coordinates"]: val.coordinates == void 0 ? void 0 : serializeTemplateSignerInputCoordinatesField(val.coordinates), ["dimensions"]: val.dimensions == void 0 ? void 0 : serializeTemplateSignerInputDimensionsField(val.dimensions) } }; } export function deserializeTemplateSignerInput(val: any): TemplateSignerInput { const type: undefined | TemplateSignerInputTypeField = val.type == void 0 ? void 0 : deserializeTemplateSignerInputTypeField(val.type); const contentType: undefined | TemplateSignerInputContentTypeField = val.content_type == void 0 ? void 0 : deserializeTemplateSignerInputContentTypeField(val.content_type); - const isRequired: undefined | boolean = isJson(val.is_required, "boolean") ? val.is_required : void 0; + const isRequired: undefined | boolean = val.is_required == void 0 ? void 0 : val.is_required; const pageIndex: number = val.page_index; - const documentId: undefined | string = isJson(val.document_id, "string") ? val.document_id : void 0; - const dropdownChoices: undefined | readonly string[] = isJson(val.dropdown_choices, "array") ? val.dropdown_choices.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; - const groupId: undefined | string = isJson(val.group_id, "string") ? val.group_id : void 0; + const documentId: undefined | string = val.document_id == void 0 ? void 0 : val.document_id; + const dropdownChoices: undefined | readonly string[] = val.dropdown_choices == void 0 ? void 0 : isJson(val.dropdown_choices, "array") ? val.dropdown_choices.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; + const groupId: undefined | string = val.group_id == void 0 ? void 0 : val.group_id; const coordinates: undefined | TemplateSignerInputCoordinatesField = val.coordinates == void 0 ? void 0 : deserializeTemplateSignerInputCoordinatesField(val.coordinates); const dimensions: undefined | TemplateSignerInputDimensionsField = val.dimensions == void 0 ? void 0 : deserializeTemplateSignerInputDimensionsField(val.dimensions); - const documentTagId: undefined | string = isJson(val.document_tag_id, "string") ? val.document_tag_id : void 0; - const textValue: undefined | string = isJson(val.text_value, "string") ? val.text_value : void 0; - const checkboxValue: undefined | boolean = isJson(val.checkbox_value, "boolean") ? val.checkbox_value : void 0; - const dateValue: undefined | string = isJson(val.date_value, "string") ? val.date_value : void 0; + const documentTagId: undefined | string = val.document_tag_id == void 0 ? void 0 : val.document_tag_id; + const textValue: undefined | string = val.text_value == void 0 ? void 0 : val.text_value; + const checkboxValue: undefined | boolean = val.checkbox_value == void 0 ? void 0 : val.checkbox_value; + const dateValue: undefined | string = val.date_value == void 0 ? void 0 : val.date_value; return { type: type, contentType: contentType, isRequired: isRequired, pageIndex: pageIndex, documentId: documentId, dropdownChoices: dropdownChoices, groupId: groupId, coordinates: coordinates, dimensions: dimensions, documentTagId: documentTagId, textValue: textValue, checkboxValue: checkboxValue, dateValue: dateValue } satisfies TemplateSignerInput; } export function serializeTemplateSignerRoleField(val: TemplateSignerRoleField): Json { @@ -10822,16 +10782,16 @@ export function deserializeTemplateSignerRoleField(val: any): TemplateSignerRole export function serializeTemplateSigner(val: TemplateSigner): Json { return { ["inputs"]: val.inputs == void 0 ? void 0 : val.inputs.map(function (item: TemplateSignerInput): any { return serializeTemplateSignerInput(item); - }) as readonly any[], ["email"]: val.email, ["role"]: val.role == void 0 ? void 0 : serializeTemplateSignerRoleField(val.role), ["is_in_person"]: val.isInPerson, ["order"]: val.order }; + }) as readonly any[], ["email"]: val.email == void 0 ? void 0 : val.email, ["role"]: val.role == void 0 ? void 0 : serializeTemplateSignerRoleField(val.role), ["is_in_person"]: val.isInPerson == void 0 ? void 0 : val.isInPerson, ["order"]: val.order == void 0 ? void 0 : val.order }; } export function deserializeTemplateSigner(val: any): TemplateSigner { - const inputs: undefined | readonly TemplateSignerInput[] = isJson(val.inputs, "array") ? val.inputs.map(function (itm: Json): any { + const inputs: undefined | readonly TemplateSignerInput[] = val.inputs == void 0 ? void 0 : isJson(val.inputs, "array") ? val.inputs.map(function (itm: Json): any { return deserializeTemplateSignerInput(itm); - }) as readonly any[] : void 0; - const email: undefined | string = isJson(val.email, "string") ? val.email : void 0; + }) as readonly any[] : []; + const email: undefined | string = val.email == void 0 ? void 0 : val.email; const role: undefined | TemplateSignerRoleField = val.role == void 0 ? void 0 : deserializeTemplateSignerRoleField(val.role); - const isInPerson: undefined | boolean = isJson(val.is_in_person, "boolean") ? val.is_in_person : void 0; - const order: undefined | number = isJson(val.order, "number") ? val.order : void 0; + const isInPerson: undefined | boolean = val.is_in_person == void 0 ? void 0 : val.is_in_person; + const order: undefined | number = val.order == void 0 ? void 0 : val.order; return { inputs: inputs, email: email, role: role, isInPerson: isInPerson, order: order } satisfies TemplateSigner; } export function serializeSignTemplateAdditionalInfoFieldNonEditableField(val: SignTemplateAdditionalInfoFieldNonEditableField): Json { @@ -10874,14 +10834,18 @@ export function deserializeSignTemplateAdditionalInfoFieldRequiredFieldSignersFi throw "".concat("Invalid value: ", val) as string; } export function serializeSignTemplateAdditionalInfoFieldRequiredField(val: SignTemplateAdditionalInfoFieldRequiredField): Json { - return { ["signers"]: val.signers == void 0 ? void 0 : val.signers.map(function (item: readonly SignTemplateAdditionalInfoFieldRequiredFieldSignersField[]): undefined { - return void 0; + return { ["signers"]: val.signers == void 0 ? void 0 : val.signers.map(function (item: readonly SignTemplateAdditionalInfoFieldRequiredFieldSignersField[]): readonly any[] { + return item.map(function (item: SignTemplateAdditionalInfoFieldRequiredFieldSignersField): any { + return serializeSignTemplateAdditionalInfoFieldRequiredFieldSignersField(item); + }) as readonly any[]; }) as readonly any[] }; } export function deserializeSignTemplateAdditionalInfoFieldRequiredField(val: any): SignTemplateAdditionalInfoFieldRequiredField { - const signers: undefined | readonly (readonly SignTemplateAdditionalInfoFieldRequiredFieldSignersField[])[] = isJson(val.signers, "array") ? val.signers.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; + const signers: undefined | readonly (readonly SignTemplateAdditionalInfoFieldRequiredFieldSignersField[])[] = val.signers == void 0 ? void 0 : isJson(val.signers, "array") ? val.signers.map(function (itm: Json): any { + return isJson(itm, "array") ? itm.map(function (itm: Json): any { + return deserializeSignTemplateAdditionalInfoFieldRequiredFieldSignersField(itm); + }) as readonly any[] : []; + }) as readonly any[] : []; return { signers: signers } satisfies SignTemplateAdditionalInfoFieldRequiredField; } export function serializeSignTemplateAdditionalInfoField(val: SignTemplateAdditionalInfoField): Json { @@ -10890,69 +10854,69 @@ export function serializeSignTemplateAdditionalInfoField(val: SignTemplateAdditi }) as readonly any[], ["required"]: val.required == void 0 ? void 0 : serializeSignTemplateAdditionalInfoFieldRequiredField(val.required) }; } export function deserializeSignTemplateAdditionalInfoField(val: any): SignTemplateAdditionalInfoField { - const nonEditable: undefined | readonly SignTemplateAdditionalInfoFieldNonEditableField[] = isJson(val.non_editable, "array") ? val.non_editable.map(function (itm: Json): any { + const nonEditable: undefined | readonly SignTemplateAdditionalInfoFieldNonEditableField[] = val.non_editable == void 0 ? void 0 : isJson(val.non_editable, "array") ? val.non_editable.map(function (itm: Json): any { return deserializeSignTemplateAdditionalInfoFieldNonEditableField(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; const required: undefined | SignTemplateAdditionalInfoFieldRequiredField = val.required == void 0 ? void 0 : deserializeSignTemplateAdditionalInfoFieldRequiredField(val.required); return { nonEditable: nonEditable, required: required } satisfies SignTemplateAdditionalInfoField; } export function serializeSignTemplateReadySignLinkField(val: SignTemplateReadySignLinkField): Json { - return { ["url"]: val.url, ["name"]: val.name, ["instructions"]: val.instructions, ["folder_id"]: val.folderId, ["is_notification_disabled"]: val.isNotificationDisabled, ["is_active"]: val.isActive }; + return { ["url"]: val.url == void 0 ? void 0 : val.url, ["name"]: val.name == void 0 ? void 0 : val.name, ["instructions"]: val.instructions == void 0 ? void 0 : val.instructions, ["folder_id"]: val.folderId == void 0 ? void 0 : val.folderId, ["is_notification_disabled"]: val.isNotificationDisabled == void 0 ? void 0 : val.isNotificationDisabled, ["is_active"]: val.isActive == void 0 ? void 0 : val.isActive }; } export function deserializeSignTemplateReadySignLinkField(val: any): SignTemplateReadySignLinkField { - const url: undefined | string = isJson(val.url, "string") ? val.url : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const instructions: undefined | string = isJson(val.instructions, "string") ? val.instructions : void 0; - const folderId: undefined | string = isJson(val.folder_id, "string") ? val.folder_id : void 0; - const isNotificationDisabled: undefined | boolean = isJson(val.is_notification_disabled, "boolean") ? val.is_notification_disabled : void 0; - const isActive: undefined | boolean = isJson(val.is_active, "boolean") ? val.is_active : void 0; + const url: undefined | string = val.url == void 0 ? void 0 : val.url; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const instructions: undefined | string = val.instructions == void 0 ? void 0 : val.instructions; + const folderId: undefined | string = val.folder_id == void 0 ? void 0 : val.folder_id; + const isNotificationDisabled: undefined | boolean = val.is_notification_disabled == void 0 ? void 0 : val.is_notification_disabled; + const isActive: undefined | boolean = val.is_active == void 0 ? void 0 : val.is_active; return { url: url, name: name, instructions: instructions, folderId: folderId, isNotificationDisabled: isNotificationDisabled, isActive: isActive } satisfies SignTemplateReadySignLinkField; } export function serializeSignTemplateCustomBrandingField(val: SignTemplateCustomBrandingField): Json { - return { ["company_name"]: val.companyName, ["logo_uri"]: val.logoUri, ["branding_color"]: val.brandingColor, ["email_footer_text"]: val.emailFooterText }; + return { ["company_name"]: val.companyName == void 0 ? void 0 : val.companyName, ["logo_uri"]: val.logoUri == void 0 ? void 0 : val.logoUri, ["branding_color"]: val.brandingColor == void 0 ? void 0 : val.brandingColor, ["email_footer_text"]: val.emailFooterText == void 0 ? void 0 : val.emailFooterText }; } export function deserializeSignTemplateCustomBrandingField(val: any): SignTemplateCustomBrandingField { - const companyName: undefined | string = isJson(val.company_name, "string") ? val.company_name : void 0; - const logoUri: undefined | string = isJson(val.logo_uri, "string") ? val.logo_uri : void 0; - const brandingColor: undefined | string = isJson(val.branding_color, "string") ? val.branding_color : void 0; - const emailFooterText: undefined | string = isJson(val.email_footer_text, "string") ? val.email_footer_text : void 0; + const companyName: undefined | string = val.company_name == void 0 ? void 0 : val.company_name; + const logoUri: undefined | string = val.logo_uri == void 0 ? void 0 : val.logo_uri; + const brandingColor: undefined | string = val.branding_color == void 0 ? void 0 : val.branding_color; + const emailFooterText: undefined | string = val.email_footer_text == void 0 ? void 0 : val.email_footer_text; return { companyName: companyName, logoUri: logoUri, brandingColor: brandingColor, emailFooterText: emailFooterText } satisfies SignTemplateCustomBrandingField; } export function serializeSignTemplate(val: SignTemplate): Json { - return { ["id"]: val.id, ["name"]: val.name, ["email_subject"]: val.emailSubject, ["email_message"]: val.emailMessage, ["days_valid"]: val.daysValid, ["parent_folder"]: val.parentFolder == void 0 ? void 0 : serializeFolderMini(val.parentFolder), ["source_files"]: val.sourceFiles == void 0 ? void 0 : val.sourceFiles.map(function (item: FileMini): any { + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["name"]: val.name == void 0 ? void 0 : val.name, ["email_subject"]: val.emailSubject == void 0 ? void 0 : val.emailSubject, ["email_message"]: val.emailMessage == void 0 ? void 0 : val.emailMessage, ["days_valid"]: val.daysValid == void 0 ? void 0 : val.daysValid, ["parent_folder"]: val.parentFolder == void 0 ? void 0 : serializeFolderMini(val.parentFolder), ["source_files"]: val.sourceFiles == void 0 ? void 0 : val.sourceFiles.map(function (item: FileMini): any { return serializeFileMini(item); - }) as readonly any[], ["are_fields_locked"]: val.areFieldsLocked, ["are_options_locked"]: val.areOptionsLocked, ["are_recipients_locked"]: val.areRecipientsLocked, ["are_email_settings_locked"]: val.areEmailSettingsLocked, ["are_files_locked"]: val.areFilesLocked, ["signers"]: val.signers == void 0 ? void 0 : val.signers.map(function (item: TemplateSigner): any { + }) as readonly any[], ["are_fields_locked"]: val.areFieldsLocked == void 0 ? void 0 : val.areFieldsLocked, ["are_options_locked"]: val.areOptionsLocked == void 0 ? void 0 : val.areOptionsLocked, ["are_recipients_locked"]: val.areRecipientsLocked == void 0 ? void 0 : val.areRecipientsLocked, ["are_email_settings_locked"]: val.areEmailSettingsLocked == void 0 ? void 0 : val.areEmailSettingsLocked, ["are_files_locked"]: val.areFilesLocked == void 0 ? void 0 : val.areFilesLocked, ["signers"]: val.signers == void 0 ? void 0 : val.signers.map(function (item: TemplateSigner): any { return serializeTemplateSigner(item); }) as readonly any[], ["additional_info"]: val.additionalInfo == void 0 ? void 0 : serializeSignTemplateAdditionalInfoField(val.additionalInfo), ["ready_sign_link"]: val.readySignLink == void 0 ? void 0 : serializeSignTemplateReadySignLinkField(val.readySignLink), ["custom_branding"]: val.customBranding == void 0 ? void 0 : serializeSignTemplateCustomBrandingField(val.customBranding) }; } export function deserializeSignTemplate(val: any): SignTemplate { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const emailSubject: undefined | string = isJson(val.email_subject, "string") ? val.email_subject : void 0; - const emailMessage: undefined | string = isJson(val.email_message, "string") ? val.email_message : void 0; - const daysValid: undefined | number = isJson(val.days_valid, "number") ? val.days_valid : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const emailSubject: undefined | string = val.email_subject == void 0 ? void 0 : val.email_subject; + const emailMessage: undefined | string = val.email_message == void 0 ? void 0 : val.email_message; + const daysValid: undefined | number = val.days_valid == void 0 ? void 0 : val.days_valid; const parentFolder: undefined | FolderMini = val.parent_folder == void 0 ? void 0 : deserializeFolderMini(val.parent_folder); - const sourceFiles: undefined | readonly FileMini[] = isJson(val.source_files, "array") ? val.source_files.map(function (itm: Json): any { + const sourceFiles: undefined | readonly FileMini[] = val.source_files == void 0 ? void 0 : isJson(val.source_files, "array") ? val.source_files.map(function (itm: Json): any { return deserializeFileMini(itm); - }) as readonly any[] : void 0; - const areFieldsLocked: undefined | boolean = isJson(val.are_fields_locked, "boolean") ? val.are_fields_locked : void 0; - const areOptionsLocked: undefined | boolean = isJson(val.are_options_locked, "boolean") ? val.are_options_locked : void 0; - const areRecipientsLocked: undefined | boolean = isJson(val.are_recipients_locked, "boolean") ? val.are_recipients_locked : void 0; - const areEmailSettingsLocked: undefined | boolean = isJson(val.are_email_settings_locked, "boolean") ? val.are_email_settings_locked : void 0; - const areFilesLocked: undefined | boolean = isJson(val.are_files_locked, "boolean") ? val.are_files_locked : void 0; - const signers: undefined | readonly TemplateSigner[] = isJson(val.signers, "array") ? val.signers.map(function (itm: Json): any { + }) as readonly any[] : []; + const areFieldsLocked: undefined | boolean = val.are_fields_locked == void 0 ? void 0 : val.are_fields_locked; + const areOptionsLocked: undefined | boolean = val.are_options_locked == void 0 ? void 0 : val.are_options_locked; + const areRecipientsLocked: undefined | boolean = val.are_recipients_locked == void 0 ? void 0 : val.are_recipients_locked; + const areEmailSettingsLocked: undefined | boolean = val.are_email_settings_locked == void 0 ? void 0 : val.are_email_settings_locked; + const areFilesLocked: undefined | boolean = val.are_files_locked == void 0 ? void 0 : val.are_files_locked; + const signers: undefined | readonly TemplateSigner[] = val.signers == void 0 ? void 0 : isJson(val.signers, "array") ? val.signers.map(function (itm: Json): any { return deserializeTemplateSigner(itm); - }) as readonly any[] : void 0; + }) as readonly any[] : []; const additionalInfo: undefined | SignTemplateAdditionalInfoField = val.additional_info == void 0 ? void 0 : deserializeSignTemplateAdditionalInfoField(val.additional_info); const readySignLink: undefined | SignTemplateReadySignLinkField = val.ready_sign_link == void 0 ? void 0 : deserializeSignTemplateReadySignLinkField(val.ready_sign_link); const customBranding: undefined | SignTemplateCustomBrandingField = val.custom_branding == void 0 ? void 0 : deserializeSignTemplateCustomBrandingField(val.custom_branding); return { id: id, name: name, emailSubject: emailSubject, emailMessage: emailMessage, daysValid: daysValid, parentFolder: parentFolder, sourceFiles: sourceFiles, areFieldsLocked: areFieldsLocked, areOptionsLocked: areOptionsLocked, areRecipientsLocked: areRecipientsLocked, areEmailSettingsLocked: areEmailSettingsLocked, areFilesLocked: areFilesLocked, signers: signers, additionalInfo: additionalInfo, readySignLink: readySignLink, customBranding: customBranding } satisfies SignTemplate; } export function serializeShieldInformationBarrierReportDetailsDetailsField(val: ShieldInformationBarrierReportDetailsDetailsField): Json { - return { ["folder_id"]: val.folderId }; + return { ["folder_id"]: val.folderId == void 0 ? void 0 : val.folderId }; } export function deserializeShieldInformationBarrierReportDetailsDetailsField(val: any): ShieldInformationBarrierReportDetailsDetailsField { - const folderId: undefined | string = isJson(val.folder_id, "string") ? val.folder_id : void 0; + const folderId: undefined | string = val.folder_id == void 0 ? void 0 : val.folder_id; return { folderId: folderId } satisfies ShieldInformationBarrierReportDetailsDetailsField; } export function serializeShieldInformationBarrierReportDetails(val: ShieldInformationBarrierReportDetails): Json { @@ -10962,6 +10926,45 @@ export function deserializeShieldInformationBarrierReportDetails(val: any): Shie const details: undefined | ShieldInformationBarrierReportDetailsDetailsField = val.details == void 0 ? void 0 : deserializeShieldInformationBarrierReportDetailsDetailsField(val.details); return { details: details } satisfies ShieldInformationBarrierReportDetails; } +export function serializeShieldInformationBarrierReportStatusField(val: ShieldInformationBarrierReportStatusField): Json { + return val; +} +export function deserializeShieldInformationBarrierReportStatusField(val: any): ShieldInformationBarrierReportStatusField { + if (!isJson(val, "string")) { + throw "Expecting a string for \"ShieldInformationBarrierReportStatusField\""; + } + if (val == "pending") { + return "pending"; + } + if (val == "error") { + return "error"; + } + if (val == "done") { + return "done"; + } + if (val == "cancelled") { + return "cancelled"; + } + throw "".concat("Invalid value: ", val) as string; +} +export function serializeShieldInformationBarrierReport(val: ShieldInformationBarrierReport): Json { + const base: any = serializeShieldInformationBarrierReportBase(val); + if (!isJson(base, "object")) { + throw "Expecting an object for \"ShieldInformationBarrierReport\""; + } + return { ...base, ...{ ["shield_information_barrier"]: val.shieldInformationBarrier == void 0 ? void 0 : serializeShieldInformationBarrierReference(val.shieldInformationBarrier), ["status"]: val.status == void 0 ? void 0 : serializeShieldInformationBarrierReportStatusField(val.status), ["details"]: val.details == void 0 ? void 0 : serializeShieldInformationBarrierReportDetails(val.details), ["created_at"]: val.createdAt == void 0 ? void 0 : val.createdAt, ["created_by"]: val.createdBy == void 0 ? void 0 : serializeUserBase(val.createdBy), ["updated_at"]: val.updatedAt == void 0 ? void 0 : val.updatedAt } }; +} +export function deserializeShieldInformationBarrierReport(val: any): ShieldInformationBarrierReport { + const shieldInformationBarrier: undefined | ShieldInformationBarrierReference = val.shield_information_barrier == void 0 ? void 0 : deserializeShieldInformationBarrierReference(val.shield_information_barrier); + const status: undefined | ShieldInformationBarrierReportStatusField = val.status == void 0 ? void 0 : deserializeShieldInformationBarrierReportStatusField(val.status); + const details: undefined | ShieldInformationBarrierReportDetails = val.details == void 0 ? void 0 : deserializeShieldInformationBarrierReportDetails(val.details); + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const createdBy: undefined | UserBase = val.created_by == void 0 ? void 0 : deserializeUserBase(val.created_by); + const updatedAt: undefined | string = val.updated_at == void 0 ? void 0 : val.updated_at; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const type: undefined | ShieldInformationBarrierReportBaseTypeField = val.type == void 0 ? void 0 : deserializeShieldInformationBarrierReportBaseTypeField(val.type); + return { shieldInformationBarrier: shieldInformationBarrier, status: status, details: details, createdAt: createdAt, createdBy: createdBy, updatedAt: updatedAt, id: id, type: type } satisfies ShieldInformationBarrierReport; +} export function serializeTrackingCodeTypeField(val: TrackingCodeTypeField): Json { return val; } @@ -10975,12 +10978,12 @@ export function deserializeTrackingCodeTypeField(val: any): TrackingCodeTypeFiel throw "".concat("Invalid value: ", val) as string; } export function serializeTrackingCode(val: TrackingCode): Json { - return { ["type"]: val.type == void 0 ? void 0 : serializeTrackingCodeTypeField(val.type), ["name"]: val.name, ["value"]: val.value }; + return { ["type"]: val.type == void 0 ? void 0 : serializeTrackingCodeTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name, ["value"]: val.value == void 0 ? void 0 : val.value }; } export function deserializeTrackingCode(val: any): TrackingCode { const type: undefined | TrackingCodeTypeField = val.type == void 0 ? void 0 : deserializeTrackingCodeTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const value: undefined | string = isJson(val.value, "string") ? val.value : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const value: undefined | string = val.value == void 0 ? void 0 : val.value; return { type: type, name: name, value: value } satisfies TrackingCode; } export function serializeUserFullRoleField(val: UserFullRoleField): Json { @@ -11014,12 +11017,12 @@ export function deserializeUserFullEnterpriseFieldTypeField(val: any): UserFullE throw "".concat("Invalid value: ", val) as string; } export function serializeUserFullEnterpriseField(val: UserFullEnterpriseField): Json { - return { ["id"]: val.id, ["type"]: val.type == void 0 ? void 0 : serializeUserFullEnterpriseFieldTypeField(val.type), ["name"]: val.name }; + return { ["id"]: val.id == void 0 ? void 0 : val.id, ["type"]: val.type == void 0 ? void 0 : serializeUserFullEnterpriseFieldTypeField(val.type), ["name"]: val.name == void 0 ? void 0 : val.name }; } export function deserializeUserFullEnterpriseField(val: any): UserFullEnterpriseField { - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: undefined | UserFullEnterpriseFieldTypeField = val.type == void 0 ? void 0 : deserializeUserFullEnterpriseFieldTypeField(val.type); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; return { id: id, type: type, name: name } satisfies UserFullEnterpriseField; } export function serializeUserFull(val: UserFull): Json { @@ -11029,43 +11032,43 @@ export function serializeUserFull(val: UserFull): Json { } return { ...base, ...{ ["role"]: val.role == void 0 ? void 0 : serializeUserFullRoleField(val.role), ["tracking_codes"]: val.trackingCodes == void 0 ? void 0 : val.trackingCodes.map(function (item: TrackingCode): any { return serializeTrackingCode(item); - }) as readonly any[], ["can_see_managed_users"]: val.canSeeManagedUsers, ["is_sync_enabled"]: val.isSyncEnabled, ["is_external_collab_restricted"]: val.isExternalCollabRestricted, ["is_exempt_from_device_limits"]: val.isExemptFromDeviceLimits, ["is_exempt_from_login_verification"]: val.isExemptFromLoginVerification, ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeUserFullEnterpriseField(val.enterprise), ["my_tags"]: val.myTags == void 0 ? void 0 : val.myTags.map(function (item: string): undefined { - return void 0; - }) as readonly any[], ["hostname"]: val.hostname, ["is_platform_access_only"]: val.isPlatformAccessOnly, ["external_app_user_id"]: val.externalAppUserId } }; + }) as readonly any[], ["can_see_managed_users"]: val.canSeeManagedUsers == void 0 ? void 0 : val.canSeeManagedUsers, ["is_sync_enabled"]: val.isSyncEnabled == void 0 ? void 0 : val.isSyncEnabled, ["is_external_collab_restricted"]: val.isExternalCollabRestricted == void 0 ? void 0 : val.isExternalCollabRestricted, ["is_exempt_from_device_limits"]: val.isExemptFromDeviceLimits == void 0 ? void 0 : val.isExemptFromDeviceLimits, ["is_exempt_from_login_verification"]: val.isExemptFromLoginVerification == void 0 ? void 0 : val.isExemptFromLoginVerification, ["enterprise"]: val.enterprise == void 0 ? void 0 : serializeUserFullEnterpriseField(val.enterprise), ["my_tags"]: val.myTags == void 0 ? void 0 : val.myTags.map(function (item: string): string { + return item; + }) as readonly any[], ["hostname"]: val.hostname == void 0 ? void 0 : val.hostname, ["is_platform_access_only"]: val.isPlatformAccessOnly == void 0 ? void 0 : val.isPlatformAccessOnly, ["external_app_user_id"]: val.externalAppUserId == void 0 ? void 0 : val.externalAppUserId } }; } export function deserializeUserFull(val: any): UserFull { const role: undefined | UserFullRoleField = val.role == void 0 ? void 0 : deserializeUserFullRoleField(val.role); - const trackingCodes: undefined | readonly TrackingCode[] = isJson(val.tracking_codes, "array") ? val.tracking_codes.map(function (itm: Json): any { + const trackingCodes: undefined | readonly TrackingCode[] = val.tracking_codes == void 0 ? void 0 : isJson(val.tracking_codes, "array") ? val.tracking_codes.map(function (itm: Json): any { return deserializeTrackingCode(itm); - }) as readonly any[] : void 0; - const canSeeManagedUsers: undefined | boolean = isJson(val.can_see_managed_users, "boolean") ? val.can_see_managed_users : void 0; - const isSyncEnabled: undefined | boolean = isJson(val.is_sync_enabled, "boolean") ? val.is_sync_enabled : void 0; - const isExternalCollabRestricted: undefined | boolean = isJson(val.is_external_collab_restricted, "boolean") ? val.is_external_collab_restricted : void 0; - const isExemptFromDeviceLimits: undefined | boolean = isJson(val.is_exempt_from_device_limits, "boolean") ? val.is_exempt_from_device_limits : void 0; - const isExemptFromLoginVerification: undefined | boolean = isJson(val.is_exempt_from_login_verification, "boolean") ? val.is_exempt_from_login_verification : void 0; + }) as readonly any[] : []; + const canSeeManagedUsers: undefined | boolean = val.can_see_managed_users == void 0 ? void 0 : val.can_see_managed_users; + const isSyncEnabled: undefined | boolean = val.is_sync_enabled == void 0 ? void 0 : val.is_sync_enabled; + const isExternalCollabRestricted: undefined | boolean = val.is_external_collab_restricted == void 0 ? void 0 : val.is_external_collab_restricted; + const isExemptFromDeviceLimits: undefined | boolean = val.is_exempt_from_device_limits == void 0 ? void 0 : val.is_exempt_from_device_limits; + const isExemptFromLoginVerification: undefined | boolean = val.is_exempt_from_login_verification == void 0 ? void 0 : val.is_exempt_from_login_verification; const enterprise: undefined | UserFullEnterpriseField = val.enterprise == void 0 ? void 0 : deserializeUserFullEnterpriseField(val.enterprise); - const myTags: undefined | readonly string[] = isJson(val.my_tags, "array") ? val.my_tags.map(function (itm: Json): undefined { - return void 0; - }) as readonly any[] : void 0; - const hostname: undefined | string = isJson(val.hostname, "string") ? val.hostname : void 0; - const isPlatformAccessOnly: undefined | boolean = isJson(val.is_platform_access_only, "boolean") ? val.is_platform_access_only : void 0; - const externalAppUserId: undefined | string = isJson(val.external_app_user_id, "string") ? val.external_app_user_id : void 0; - const createdAt: undefined | string = isJson(val.created_at, "string") ? val.created_at : void 0; - const modifiedAt: undefined | string = isJson(val.modified_at, "string") ? val.modified_at : void 0; - const language: undefined | string = isJson(val.language, "string") ? val.language : void 0; - const timezone: undefined | string = isJson(val.timezone, "string") ? val.timezone : void 0; - const spaceAmount: undefined | number = isJson(val.space_amount, "number") ? val.space_amount : void 0; - const spaceUsed: undefined | number = isJson(val.space_used, "number") ? val.space_used : void 0; - const maxUploadSize: undefined | number = isJson(val.max_upload_size, "number") ? val.max_upload_size : void 0; + const myTags: undefined | readonly string[] = val.my_tags == void 0 ? void 0 : isJson(val.my_tags, "array") ? val.my_tags.map(function (itm: Json): Json { + return itm; + }) as readonly any[] : []; + const hostname: undefined | string = val.hostname == void 0 ? void 0 : val.hostname; + const isPlatformAccessOnly: undefined | boolean = val.is_platform_access_only == void 0 ? void 0 : val.is_platform_access_only; + const externalAppUserId: undefined | string = val.external_app_user_id == void 0 ? void 0 : val.external_app_user_id; + const createdAt: undefined | string = val.created_at == void 0 ? void 0 : val.created_at; + const modifiedAt: undefined | string = val.modified_at == void 0 ? void 0 : val.modified_at; + const language: undefined | string = val.language == void 0 ? void 0 : val.language; + const timezone: undefined | string = val.timezone == void 0 ? void 0 : val.timezone; + const spaceAmount: undefined | number = val.space_amount == void 0 ? void 0 : val.space_amount; + const spaceUsed: undefined | number = val.space_used == void 0 ? void 0 : val.space_used; + const maxUploadSize: undefined | number = val.max_upload_size == void 0 ? void 0 : val.max_upload_size; const status: undefined | UserStatusField = val.status == void 0 ? void 0 : deserializeUserStatusField(val.status); - const jobTitle: undefined | string = isJson(val.job_title, "string") ? val.job_title : void 0; - const phone: undefined | string = isJson(val.phone, "string") ? val.phone : void 0; - const address: undefined | string = isJson(val.address, "string") ? val.address : void 0; - const avatarUrl: undefined | string = isJson(val.avatar_url, "string") ? val.avatar_url : void 0; + const jobTitle: undefined | string = val.job_title == void 0 ? void 0 : val.job_title; + const phone: undefined | string = val.phone == void 0 ? void 0 : val.phone; + const address: undefined | string = val.address == void 0 ? void 0 : val.address; + const avatarUrl: undefined | string = val.avatar_url == void 0 ? void 0 : val.avatar_url; const notificationEmail: undefined | UserNotificationEmailField = val.notification_email == void 0 ? void 0 : deserializeUserNotificationEmailField(val.notification_email); - const name: undefined | string = isJson(val.name, "string") ? val.name : void 0; - const login: undefined | string = isJson(val.login, "string") ? val.login : void 0; - const id: undefined | string = isJson(val.id, "string") ? val.id : void 0; + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + const login: undefined | string = val.login == void 0 ? void 0 : val.login; + const id: undefined | string = val.id == void 0 ? void 0 : val.id; const type: UserBaseTypeField = deserializeUserBaseTypeField(val.type); return { role: role, trackingCodes: trackingCodes, canSeeManagedUsers: canSeeManagedUsers, isSyncEnabled: isSyncEnabled, isExternalCollabRestricted: isExternalCollabRestricted, isExemptFromDeviceLimits: isExemptFromDeviceLimits, isExemptFromLoginVerification: isExemptFromLoginVerification, enterprise: enterprise, myTags: myTags, hostname: hostname, isPlatformAccessOnly: isPlatformAccessOnly, externalAppUserId: externalAppUserId, createdAt: createdAt, modifiedAt: modifiedAt, language: language, timezone: timezone, spaceAmount: spaceAmount, spaceUsed: spaceUsed, maxUploadSize: maxUploadSize, status: status, jobTitle: jobTitle, phone: phone, address: address, avatarUrl: avatarUrl, notificationEmail: notificationEmail, name: name, login: login, id: id, type: type } satisfies UserFull; } @@ -11094,41 +11097,68 @@ export function deserializeMetadataFilterFiltersField(val: any): MetadataFilterF return {} satisfies MetadataFilterFiltersField; } export function serializeMetadataFilter(val: MetadataFilter): Json { - return { ["scope"]: val.scope == void 0 ? void 0 : serializeMetadataFilterScopeField(val.scope), ["templateKey"]: val.templateKey, ["filters"]: val.filters == void 0 ? void 0 : serializeMetadataFilterFiltersField(val.filters) }; + return { ["scope"]: val.scope == void 0 ? void 0 : serializeMetadataFilterScopeField(val.scope), ["templateKey"]: val.templateKey == void 0 ? void 0 : val.templateKey, ["filters"]: val.filters == void 0 ? void 0 : serializeMetadataFilterFiltersField(val.filters) }; } export function deserializeMetadataFilter(val: any): MetadataFilter { const scope: undefined | MetadataFilterScopeField = val.scope == void 0 ? void 0 : deserializeMetadataFilterScopeField(val.scope); - const templateKey: undefined | string = isJson(val.templateKey, "string") ? val.templateKey : void 0; + const templateKey: undefined | string = val.templateKey == void 0 ? void 0 : val.templateKey; const filters: undefined | MetadataFilterFiltersField = val.filters == void 0 ? void 0 : deserializeMetadataFilterFiltersField(val.filters); return { scope: scope, templateKey: templateKey, filters: filters } satisfies MetadataFilter; } export function serializeMetadataFieldFilterString(val: MetadataFieldFilterString): Json { - return {}; + return val; } export function deserializeMetadataFieldFilterString(val: any): MetadataFieldFilterString { - return {} satisfies MetadataFieldFilterString; + return val; } export function serializeMetadataFieldFilterFloat(val: MetadataFieldFilterFloat): Json { - return {}; + return val; } export function deserializeMetadataFieldFilterFloat(val: any): MetadataFieldFilterFloat { - return {} satisfies MetadataFieldFilterFloat; + return val; } export function serializeMetadataFieldFilterMultiSelect(val: MetadataFieldFilterMultiSelect): Json { - return {}; + return Object.fromEntries(Object.entries(val).map(([k, v]: [ + string, + any + ]) => [k, function (v: any): readonly any[] { + return v.map(function (item: string): string { + return item; + }) as readonly any[]; + }(v)])) as { + readonly [key: string]: any; + }; } export function deserializeMetadataFieldFilterMultiSelect(val: any): MetadataFieldFilterMultiSelect { - return {} satisfies MetadataFieldFilterMultiSelect; + return val; } export function serializeMetadataFieldFilterFloatRange(val: MetadataFieldFilterFloatRange): Json { - return {}; + return Object.fromEntries(Object.entries(val).map(([k, v]: [ + string, + any + ]) => [k, function (v: any): { + readonly [key: string]: any; + } { + return { ["lt"]: v.lt == void 0 ? void 0 : v.lt, ["gt"]: v.gt == void 0 ? void 0 : v.gt }; + }(v)])) as { + readonly [key: string]: any; + }; } export function deserializeMetadataFieldFilterFloatRange(val: any): MetadataFieldFilterFloatRange { - return {} satisfies MetadataFieldFilterFloatRange; + return val; } export function serializeMetadataFieldFilterDateRange(val: MetadataFieldFilterDateRange): Json { - return {}; + return Object.fromEntries(Object.entries(val).map(([k, v]: [ + string, + any + ]) => [k, function (v: any): { + readonly [key: string]: any; + } { + return { ["lt"]: v.lt == void 0 ? void 0 : v.lt, ["gt"]: v.gt == void 0 ? void 0 : v.gt }; + }(v)])) as { + readonly [key: string]: any; + }; } export function deserializeMetadataFieldFilterDateRange(val: any): MetadataFieldFilterDateRange { - return {} satisfies MetadataFieldFilterDateRange; + return val; } diff --git a/src/test/collections.generated.test.ts b/src/test/collections.generated.test.ts new file mode 100644 index 00000000..7006801b --- /dev/null +++ b/src/test/collections.generated.test.ts @@ -0,0 +1,36 @@ +import { serializeCreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { deserializeCreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { serializeCreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { deserializeCreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { serializeUpdateFolderByIdRequestBodyArg } from "../managers/folders.generated.js"; +import { deserializeUpdateFolderByIdRequestBodyArg } from "../managers/folders.generated.js"; +import { CreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { CreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { UpdateFolderByIdRequestBodyArg } from "../managers/folders.generated.js"; +import { decodeBase64 } from "../utils.js"; +import { getEnvVar } from "../utils.js"; +import { getUuid } from "../utils.js"; +import { Client } from "../client.generated.js"; +import { JwtAuth } from "../jwtAuth.js"; +import { JwtConfig } from "../jwtAuth.js"; +const jwtConfig: any = JwtConfig.fromConfigJsonString(decodeBase64(getEnvVar("JWT_CONFIG_BASE_64"))); +const auth: any = new JwtAuth({ config: jwtConfig }); +const client: any = new Client({ auth: auth }); +test("testCollections", async function testCollections(): Promise { + const collections: any = await client.collections.getCollections(); + const favouriteCollection: any = collections.entries[0]; + const collectionItems: any = await client.collections.getCollectionItems(favouriteCollection.id); + const folder: any = await client.folders.createFolder({ name: getUuid(), parent: { id: "0" } satisfies CreateFolderRequestBodyArgParentField } satisfies CreateFolderRequestBodyArg); + await client.folders.updateFolderById(folder.id, { collections: [{ id: favouriteCollection.id }] } satisfies UpdateFolderByIdRequestBodyArg) + const collectionItemsAfterUpdate: any = await client.collections.getCollectionItems(favouriteCollection.id); + if (!(collectionItemsAfterUpdate.entries.length == collectionItems.entries.length + 1)) { + throw "Assertion failed"; + } + await client.folders.updateFolderById(folder.id, { collections: [] } satisfies UpdateFolderByIdRequestBodyArg) + const collectionItemsAfterRemove: any = await client.collections.getCollectionItems(favouriteCollection.id); + if (!(collectionItemsAfterRemove.entries.length == collectionItems.entries.length)) { + throw "Assertion failed"; + } + await client.folders.deleteFolderById(folder.id) +}); +export {}; diff --git a/src/test/emailAliases.generated.test.ts b/src/test/emailAliases.generated.test.ts new file mode 100644 index 00000000..4aa82438 --- /dev/null +++ b/src/test/emailAliases.generated.test.ts @@ -0,0 +1,40 @@ +import { serializeCreateUserRequestBodyArg } from "../managers/users.generated.js"; +import { deserializeCreateUserRequestBodyArg } from "../managers/users.generated.js"; +import { serializeCreateUserEmailAliasRequestBodyArg } from "../managers/emailAliases.generated.js"; +import { deserializeCreateUserEmailAliasRequestBodyArg } from "../managers/emailAliases.generated.js"; +import { CreateUserRequestBodyArg } from "../managers/users.generated.js"; +import { CreateUserEmailAliasRequestBodyArg } from "../managers/emailAliases.generated.js"; +import { decodeBase64 } from "../utils.js"; +import { getEnvVar } from "../utils.js"; +import { getUuid } from "../utils.js"; +import { Client } from "../client.generated.js"; +import { JwtAuth } from "../jwtAuth.js"; +import { JwtConfig } from "../jwtAuth.js"; +const jwtConfig: any = JwtConfig.fromConfigJsonString(decodeBase64(getEnvVar("JWT_CONFIG_BASE_64"))); +const auth: any = new JwtAuth({ config: jwtConfig }); +const client: any = new Client({ auth: auth }); +test("testEmailAliases", async function testEmailAliases(): Promise { + const newUserName: any = getUuid(); + const newUserLogin: any = "".concat(getUuid(), "@boxdemo.com") as string; + const newUser: any = await client.users.createUser({ name: newUserName, login: newUserLogin } satisfies CreateUserRequestBodyArg); + const aliases: any = await client.emailAliases.getUserEmailAliases(newUser.id); + if (!(aliases.totalCount == 0)) { + throw "Assertion failed"; + } + const newAliasEmail: any = "".concat(newUser.id, "@boxdemo.com") as string; + const newAlias: any = await client.emailAliases.createUserEmailAlias(newUser.id, { email: newAliasEmail } satisfies CreateUserEmailAliasRequestBodyArg); + const updatedAliases: any = await client.emailAliases.getUserEmailAliases(newUser.id); + if (!(updatedAliases.totalCount == 1)) { + throw "Assertion failed"; + } + if (!(updatedAliases.entries[0].email == newAliasEmail)) { + throw "Assertion failed"; + } + await client.emailAliases.deleteUserEmailAliasById(newUser.id, newAlias.id) + const finalAliases: any = await client.emailAliases.getUserEmailAliases(newUser.id); + if (!(finalAliases.totalCount == 0)) { + throw "Assertion failed"; + } + await client.users.deleteUserById(newUser.id) +}); +export {}; diff --git a/src/test/fileMetadata.generated.test.ts b/src/test/fileMetadata.generated.test.ts new file mode 100644 index 00000000..8b429ed4 --- /dev/null +++ b/src/test/fileMetadata.generated.test.ts @@ -0,0 +1,56 @@ +import { serializeUploadFileRequestBodyArgAttributesField } from "../managers/uploads.generated.js"; +import { deserializeUploadFileRequestBodyArgAttributesField } from "../managers/uploads.generated.js"; +import { serializeUploadFileRequestBodyArgAttributesFieldParentField } from "../managers/uploads.generated.js"; +import { deserializeUploadFileRequestBodyArgAttributesFieldParentField } from "../managers/uploads.generated.js"; +import { serializeUpdateFileMetadataByIdRequestBodyArg } from "../managers/fileMetadata.generated.js"; +import { deserializeUpdateFileMetadataByIdRequestBodyArg } from "../managers/fileMetadata.generated.js"; +import { serializeUpdateFileMetadataByIdRequestBodyArgOpField } from "../managers/fileMetadata.generated.js"; +import { deserializeUpdateFileMetadataByIdRequestBodyArgOpField } from "../managers/fileMetadata.generated.js"; +import { UploadFileRequestBodyArg } from "../managers/uploads.generated.js"; +import { UploadFileRequestBodyArgAttributesField } from "../managers/uploads.generated.js"; +import { UploadFileRequestBodyArgAttributesFieldParentField } from "../managers/uploads.generated.js"; +import { UpdateFileMetadataByIdRequestBodyArg } from "../managers/fileMetadata.generated.js"; +import { UpdateFileMetadataByIdRequestBodyArgOpField } from "../managers/fileMetadata.generated.js"; +import { decodeBase64 } from "../utils.js"; +import { generateByteStream } from "../utils.js"; +import { getEnvVar } from "../utils.js"; +import { getUuid } from "../utils.js"; +import { Client } from "../client.generated.js"; +import { JwtAuth } from "../jwtAuth.js"; +import { JwtConfig } from "../jwtAuth.js"; +test("fileMetadata", async function fileMetadata(): Promise { + const client: any = new Client({ auth: new JwtAuth({ config: JwtConfig.fromConfigJsonString(decodeBase64(getEnvVar("JWT_CONFIG_BASE_64"))) }) }); + const uploadedFiles: any = await client.uploads.uploadFile({ attributes: { name: getUuid(), parent: { id: "0" } satisfies UploadFileRequestBodyArgAttributesFieldParentField } satisfies UploadFileRequestBodyArgAttributesField, file: generateByteStream(256) } satisfies UploadFileRequestBodyArg); + const fileId: any = uploadedFiles.entries[0].id; + const fileMetadata: any = await client.fileMetadata.getFileMetadata(fileId); + if (!(fileMetadata.entries.length == 0)) { + throw "Assertion failed"; + } + const scope: any = "global"; + const template: any = "properties"; + const data: any = { abc: "xyz" }; + const createdMetadata: any = await client.fileMetadata.createFileMetadataById(fileId, scope, template, data); + if (!(createdMetadata.template == template)) { + throw "Assertion failed"; + } + if (!(createdMetadata.scope == scope)) { + throw "Assertion failed"; + } + if (!(createdMetadata.version == 0)) { + throw "Assertion failed"; + } + const receivedMetadata: any = await client.fileMetadata.getFileMetadataById(fileId, scope, template); + if (!(receivedMetadata.extraData.abc == data.abc)) { + throw "Assertion failed"; + } + const newValue: any = "bar"; + const updatedMetadata: any = await client.fileMetadata.updateFileMetadataById(fileId, scope, template, [{ op: "replace" as UpdateFileMetadataByIdRequestBodyArgOpField, path: "/abc", value: newValue } satisfies UpdateFileMetadataByIdRequestBodyArg]); + const receivedUpdatedMetadata: any = await client.fileMetadata.getFileMetadataById(fileId, scope, template); + if (!(receivedUpdatedMetadata.extraData.abc == newValue)) { + throw "Assertion failed"; + } + await client.fileMetadata.deleteFileMetadataById(fileId, scope, template) + expect(async () => { await client.fileMetadata.getFileMetadataById(fileId, scope, template); }).rejects.toThrow(); + await client.files.deleteFileById(fileId) +}); +export {}; diff --git a/src/test/folderLocks.generated.test.ts b/src/test/folderLocks.generated.test.ts new file mode 100644 index 00000000..2a2d2f68 --- /dev/null +++ b/src/test/folderLocks.generated.test.ts @@ -0,0 +1,51 @@ +import { serializeCreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { deserializeCreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { serializeCreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { deserializeCreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { serializeCreateFolderLockRequestBodyArg } from "../managers/folderLocks.generated.js"; +import { deserializeCreateFolderLockRequestBodyArg } from "../managers/folderLocks.generated.js"; +import { serializeCreateFolderLockRequestBodyArgFolderField } from "../managers/folderLocks.generated.js"; +import { deserializeCreateFolderLockRequestBodyArgFolderField } from "../managers/folderLocks.generated.js"; +import { serializeCreateFolderLockRequestBodyArgLockedOperationsField } from "../managers/folderLocks.generated.js"; +import { deserializeCreateFolderLockRequestBodyArgLockedOperationsField } from "../managers/folderLocks.generated.js"; +import { CreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { CreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { GetFolderLocksQueryParamsArg } from "../managers/folderLocks.generated.js"; +import { CreateFolderLockRequestBodyArg } from "../managers/folderLocks.generated.js"; +import { CreateFolderLockRequestBodyArgFolderField } from "../managers/folderLocks.generated.js"; +import { CreateFolderLockRequestBodyArgLockedOperationsField } from "../managers/folderLocks.generated.js"; +import { decodeBase64 } from "../utils.js"; +import { getEnvVar } from "../utils.js"; +import { getUuid } from "../utils.js"; +import { Client } from "../client.generated.js"; +import { JwtAuth } from "../jwtAuth.js"; +import { JwtConfig } from "../jwtAuth.js"; +const jwtConfig: any = JwtConfig.fromConfigJsonString(decodeBase64(getEnvVar("JWT_CONFIG_BASE_64"))); +const auth: any = new JwtAuth({ config: jwtConfig }); +const client: any = new Client({ auth: auth }); +test("testFolderLocks", async function testFolderLocks(): Promise { + const folder: any = await client.folders.createFolder({ name: getUuid(), parent: { id: "0" } satisfies CreateFolderRequestBodyArgParentField } satisfies CreateFolderRequestBodyArg); + const folderLocks: any = await client.folderLocks.getFolderLocks({ folderId: folder.id } satisfies GetFolderLocksQueryParamsArg); + if (!(folderLocks.entries.length == 0)) { + throw "Assertion failed"; + } + const folderLock: any = await client.folderLocks.createFolderLock({ folder: { id: folder.id, type: "folder" } satisfies CreateFolderLockRequestBodyArgFolderField, lockedOperations: { move: true, delete: true } satisfies CreateFolderLockRequestBodyArgLockedOperationsField } satisfies CreateFolderLockRequestBodyArg); + if (!(folderLock.folder.id == folder.id)) { + throw "Assertion failed"; + } + if (!(folderLock.lockedOperations.move == true)) { + throw "Assertion failed"; + } + if (!(folderLock.lockedOperations.delete == true)) { + throw "Assertion failed"; + } + expect(async () => { await client.folders.deleteFolderById(folder.id); }).rejects.toThrow(); + await client.folderLocks.deleteFolderLockById(folderLock.id) + expect(async () => { await client.folderLocks.deleteFolderLockById(folderLock.id); }).rejects.toThrow(); + const newFolderLocks: any = await client.folderLocks.getFolderLocks({ folderId: folder.id } satisfies GetFolderLocksQueryParamsArg); + if (!(newFolderLocks.entries.length == 0)) { + throw "Assertion failed"; + } + await client.folders.deleteFolderById(folder.id) +}); +export {}; diff --git a/src/test/metadataTemplates.generated.test.ts b/src/test/metadataTemplates.generated.test.ts new file mode 100644 index 00000000..0a0906c6 --- /dev/null +++ b/src/test/metadataTemplates.generated.test.ts @@ -0,0 +1,54 @@ +import { serializeCreateMetadataTemplateSchemaRequestBodyArg } from "../managers/metadataTemplates.generated.js"; +import { deserializeCreateMetadataTemplateSchemaRequestBodyArg } from "../managers/metadataTemplates.generated.js"; +import { serializeGetMetadataTemplateSchemaScopeArg } from "../managers/metadataTemplates.generated.js"; +import { deserializeGetMetadataTemplateSchemaScopeArg } from "../managers/metadataTemplates.generated.js"; +import { serializeDeleteMetadataTemplateSchemaScopeArg } from "../managers/metadataTemplates.generated.js"; +import { deserializeDeleteMetadataTemplateSchemaScopeArg } from "../managers/metadataTemplates.generated.js"; +import { CreateMetadataTemplateSchemaRequestBodyArg } from "../managers/metadataTemplates.generated.js"; +import { GetMetadataTemplateSchemaScopeArg } from "../managers/metadataTemplates.generated.js"; +import { DeleteMetadataTemplateSchemaScopeArg } from "../managers/metadataTemplates.generated.js"; +import { decodeBase64 } from "../utils.js"; +import { getEnvVar } from "../utils.js"; +import { getUuid } from "../utils.js"; +import { Client } from "../client.generated.js"; +import { JwtAuth } from "../jwtAuth.js"; +import { JwtConfig } from "../jwtAuth.js"; +const jwtConfig: any = JwtConfig.fromConfigJsonString(decodeBase64(getEnvVar("JWT_CONFIG_BASE_64"))); +const auth: any = new JwtAuth({ config: jwtConfig }); +const client: any = new Client({ auth: auth }); +test("testMetadataTemplates", async function testMetadataTemplates(): Promise { + const templateKey: any = "".concat("key", getUuid()) as string; + const template: any = await client.metadataTemplates.createMetadataTemplateSchema({ scope: "enterprise", displayName: templateKey, templateKey: templateKey, fields: [{ type: "string", key: "testName", displayName: "testName" }] } satisfies CreateMetadataTemplateSchemaRequestBodyArg); + if (!(template.templateKey == templateKey)) { + throw "Assertion failed"; + } + if (!(template.displayName == templateKey)) { + throw "Assertion failed"; + } + if (!(template.fields.length == 1)) { + throw "Assertion failed"; + } + if (!(template.fields[0].key == "testName")) { + throw "Assertion failed"; + } + if (!(template.fields[0].displayName == "testName")) { + throw "Assertion failed"; + } + if (!await client.metadataTemplates.getMetadataTemplateById(template.id)) { + throw "Assertion failed"; + } + if (!await client.metadataTemplates.getMetadataTemplateSchema("enterprise" as GetMetadataTemplateSchemaScopeArg, template.templateKey)) { + throw "Assertion failed"; + } + const enterpriseMetadataTemplates: any = await client.metadataTemplates.getMetadataTemplateEnterprise(); + if (!(enterpriseMetadataTemplates.entries.length > 0)) { + throw "Assertion failed"; + } + const globalMetadataTemplates: any = await client.metadataTemplates.getMetadataTemplateGlobal(); + if (!(globalMetadataTemplates.entries.length > 0)) { + throw "Assertion failed"; + } + await client.metadataTemplates.deleteMetadataTemplateSchema("enterprise" as DeleteMetadataTemplateSchemaScopeArg, template.templateKey) + expect(async () => { await client.metadataTemplates.deleteMetadataTemplateSchema("enterprise" as DeleteMetadataTemplateSchemaScopeArg, template.templateKey); }).rejects.toThrow(); +}); +export {}; diff --git a/src/test/recentItems.generated.test.ts b/src/test/recentItems.generated.test.ts new file mode 100644 index 00000000..22cad619 --- /dev/null +++ b/src/test/recentItems.generated.test.ts @@ -0,0 +1,17 @@ +import { decodeBase64 } from "../utils.js"; +import { getEnvVar } from "../utils.js"; +import { getUuid } from "../utils.js"; +import { Client } from "../client.generated.js"; +import { JwtAuth } from "../jwtAuth.js"; +import { JwtConfig } from "../jwtAuth.js"; +const jwtConfig: any = JwtConfig.fromConfigJsonString(decodeBase64(getEnvVar("JWT_CONFIG_BASE_64"))); +const auth: any = new JwtAuth({ config: jwtConfig }); +test("testRecentItems", async function testRecentItems(): Promise { + auth.asUser(getEnvVar("USER_ID")) + const client: any = new Client({ auth: auth }); + const recentItems: any = await client.recentItems.getRecentItems(); + if (!(recentItems.entries.length > 0)) { + throw "Assertion failed"; + } +}); +export {}; diff --git a/src/test/trashedFiles.generated.test.ts b/src/test/trashedFiles.generated.test.ts new file mode 100644 index 00000000..2e7df081 --- /dev/null +++ b/src/test/trashedFiles.generated.test.ts @@ -0,0 +1,51 @@ +import { serializeUploadFileRequestBodyArgAttributesField } from "../managers/uploads.generated.js"; +import { deserializeUploadFileRequestBodyArgAttributesField } from "../managers/uploads.generated.js"; +import { serializeUploadFileRequestBodyArgAttributesFieldParentField } from "../managers/uploads.generated.js"; +import { deserializeUploadFileRequestBodyArgAttributesFieldParentField } from "../managers/uploads.generated.js"; +import { UploadFileRequestBodyArg } from "../managers/uploads.generated.js"; +import { UploadFileRequestBodyArgAttributesField } from "../managers/uploads.generated.js"; +import { UploadFileRequestBodyArgAttributesFieldParentField } from "../managers/uploads.generated.js"; +import { decodeBase64 } from "../utils.js"; +import { getEnvVar } from "../utils.js"; +import { getUuid } from "../utils.js"; +import { generateByteStream } from "../utils.js"; +import { Client } from "../client.generated.js"; +import { JwtAuth } from "../jwtAuth.js"; +import { JwtConfig } from "../jwtAuth.js"; +const jwtConfig: any = JwtConfig.fromConfigJsonString(decodeBase64(getEnvVar("JWT_CONFIG_BASE_64"))); +const auth: any = new JwtAuth({ config: jwtConfig }); +const client: any = new Client({ auth: auth }); +test("testTrashedFiles", async function testTrashedFiles(): Promise { + const fileSize: any = 1024 * 1024; + const fileName: any = getUuid(); + const fileByteStream: any = generateByteStream(fileSize); + const files: any = await client.uploads.uploadFile({ attributes: { name: fileName, parent: { id: "0" } satisfies UploadFileRequestBodyArgAttributesFieldParentField } satisfies UploadFileRequestBodyArgAttributesField, file: fileByteStream } satisfies UploadFileRequestBodyArg); + const file: any = files.entries[0]; + await client.files.deleteFileById(file.id) + const fromTrash: any = await client.trashedFiles.getFileTrash(file.id); + if (!(fromTrash.id == file.id)) { + throw "Assertion failed"; + } + if (!(fromTrash.name == file.name)) { + throw "Assertion failed"; + } + const fromApiAfterTrashed: any = await client.files.getFileById(file.id); + if (!(fromApiAfterTrashed.itemStatus == "trashed")) { + throw "Assertion failed"; + } + const restoredFile: any = await client.trashedFiles.restoreFileFromTrash(file.id); + const fromApiAfterRestore: any = await client.files.getFileById(file.id); + if (!(restoredFile.id == fromApiAfterRestore.id)) { + throw "Assertion failed"; + } + if (!(restoredFile.name == fromApiAfterRestore.name)) { + throw "Assertion failed"; + } + if (!(fromApiAfterRestore.itemStatus == "active")) { + throw "Assertion failed"; + } + await client.files.deleteFileById(file.id) + await client.trashedFiles.deleteFileTrash(file.id) + expect(async () => { await client.trashedFiles.getFileTrash(file.id); }).rejects.toThrow(); +}); +export {}; diff --git a/src/test/trashedFolders.generated.test.ts b/src/test/trashedFolders.generated.test.ts new file mode 100644 index 00000000..0d6b1f2a --- /dev/null +++ b/src/test/trashedFolders.generated.test.ts @@ -0,0 +1,39 @@ +import { serializeCreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { deserializeCreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { serializeCreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { deserializeCreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { CreateFolderRequestBodyArg } from "../managers/folders.generated.js"; +import { CreateFolderRequestBodyArgParentField } from "../managers/folders.generated.js"; +import { decodeBase64 } from "../utils.js"; +import { getEnvVar } from "../utils.js"; +import { getUuid } from "../utils.js"; +import { Client } from "../client.generated.js"; +import { JwtAuth } from "../jwtAuth.js"; +import { JwtConfig } from "../jwtAuth.js"; +const jwtConfig: any = JwtConfig.fromConfigJsonString(decodeBase64(getEnvVar("JWT_CONFIG_BASE_64"))); +const auth: any = new JwtAuth({ config: jwtConfig }); +const client: any = new Client({ auth: auth }); +test("testTrashedFolders", async function testTrashedFolders(): Promise { + const folder: any = await client.folders.createFolder({ name: getUuid(), parent: { id: "0" } satisfies CreateFolderRequestBodyArgParentField } satisfies CreateFolderRequestBodyArg); + await client.folders.deleteFolderById(folder.id) + const fromTrash: any = await client.trashedFolders.getFolderTrash(folder.id); + if (!(fromTrash.id == folder.id)) { + throw "Assertion failed"; + } + if (!(fromTrash.name == folder.name)) { + throw "Assertion failed"; + } + expect(async () => { await client.folders.getFolderById(folder.id); }).rejects.toThrow(); + const restoredFolder: any = await client.trashedFolders.restoreFolderFromTrash(folder.id); + const fromApi: any = await client.folders.getFolderById(folder.id); + if (!(restoredFolder.id == fromApi.id)) { + throw "Assertion failed"; + } + if (!(restoredFolder.name == fromApi.name)) { + throw "Assertion failed"; + } + await client.folders.deleteFolderById(folder.id) + await client.trashedFolders.deleteFolderTrash(folder.id) + expect(async () => { await client.trashedFolders.getFolderTrash(folder.id); }).rejects.toThrow(); +}); +export {};