import { AppcondaException, Client, Payload } from "../client"; export class Schemas { client: Client; constructor(client: Client) { this.client = client; } /** * Create account * * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appconda.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appconda.io/docs/references/cloud/client-web/account#createEmailSession). * * @param {string} tenantId * @param {string} name * @param {string} slug * @throws {AppcondaException} * @returns {Promise>} */ async import(projectId: string, databaseId: string,databaseName: string, schema: string): Promise { if (typeof projectId === 'undefined') { throw new AppcondaException('Missing required parameter: "projectId"'); } if (typeof databaseId === 'undefined') { throw new AppcondaException('Missing required parameter: "databaseId"'); } if (typeof schema === 'undefined') { throw new AppcondaException('Missing required parameter: "schema"'); } const apiPath = `/schema/${projectId}/${databaseId}`; const payload: Payload = {}; if (typeof projectId !== 'undefined') { payload['projectId'] = projectId; } if (typeof databaseId !== 'undefined') { payload['databaseId'] = databaseId; } if (typeof databaseName !== 'undefined') { payload['databaseName'] = databaseName; } if (typeof schema !== 'undefined') { payload['schema'] = schema; } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', } return await this.client.call( 'post', uri, apiHeaders, payload, ); } }