"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportBundleBuilder = void 0;
class ImportBundleBuilder {
    constructor(values) {
        this.values = {};
        if (values !== undefined) {
            Object.assign(this.values, values);
        }
    }
    withDsnpUserId(dsnpUserId) {
        return new ImportBundleBuilder({ ...this.values, dsnpUserId });
    }
    withSchemaId(schemaId) {
        return new ImportBundleBuilder({ ...this.values, schemaId });
    }
    withGraphKeyPair(keyType, publicKey, secretKey) {
        const keyPairs = this.values.keyPairs ? [...this.values.keyPairs] : [];
        keyPairs.push({ keyType, publicKey, secretKey });
        return new ImportBundleBuilder({ ...this.values, keyPairs });
    }
    withDsnpKeys(dsnpKeys) {
        return new ImportBundleBuilder({ ...this.values, dsnpKeys });
    }
    withPageData(pageId, content, contentHash) {
        const pages = this.values.pages ? [...this.values.pages] : [];
        pages.push({ pageId, content, contentHash });
        return new ImportBundleBuilder({ ...this.values, pages });
    }
    build() {
        const importBundle = {
            dsnpUserId: this.values.dsnpUserId || '',
            schemaId: this.values.schemaId || 0,
            keyPairs: this.values.keyPairs || [],
            dsnpKeys: this.values.dsnpKeys,
            pages: this.values.pages || [],
        };
        return importBundle;
    }
}
exports.ImportBundleBuilder = ImportBundleBuilder;
//# sourceMappingURL=import-bundle-builder.js.map