import { mergeDeep, someNumber, someString, someAny, someDate, } from '@wix/metro-common-builders';
import { SortOrder, TagExposure, WebhookIdentityType, } from './types.impl.js';
// @ts-ignore
import stack from 'callsite';
export function aAccountInfo(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        accountId: someString({
            validations: [{ type: 'FORMAT', value: 'GUID' }],
        }),
        parentAccountId: someString({
            validations: [{ type: 'FORMAT', value: 'GUID' }],
        }),
        siteId: someString({
            validations: [{ type: 'FORMAT', value: 'GUID' }],
        }),
    }, overrideObject);
}
export function aIdentificationData(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        anonymousVisitorId: someString({
            validations: [{ type: 'FORMAT', value: 'GUID' }],
        }),
        identityType: aWebhookIdentityType(),
    }, overrideObject);
}
export function aWebhookIdentityType(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = WebhookIdentityType.UNKNOWN; }
    return enumFirstItem;
}
export function aMessageEnvelope(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        instanceId: someString({
            validations: [{ type: 'FORMAT', value: 'GUID' }],
        }),
        eventType: someString({
            validations: [{ type: 'MAX_LENGTH', value: '150' }],
        }),
        identity: aIdentificationData(),
        data: someString(),
        accountInfo: aAccountInfo(),
    }, overrideObject);
}
export function aActionEvent(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        bodyAsJson: someString(),
    }, overrideObject);
}
export function aDomainEvent(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        createdEvent: aEntityCreatedEvent(),
        id: someString(),
        entityFqdn: someString(),
        slug: someString(),
        entityId: someString(),
        eventTime: someDate(),
        triggeredByAnonymizeRequest: true,
        originatedFrom: someString(),
        entityEventSequence: someString({
            validations: [{ type: 'DECIMAL_VALUE' }],
        }),
    }, overrideObject);
}
export function aEntityCreatedEvent(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        entityAsJson: someString(),
        triggeredByUndelete: true,
        restoreInfo: aRestoreInfo(),
        additionalMetadataAsJson: someString(),
    }, overrideObject);
}
export function aEntityDeletedEvent(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        movedToTrash: true,
        deletedEntityAsJson: someString(),
        additionalMetadataAsJson: someString(),
    }, overrideObject);
}
export function aEntityUpdatedEvent(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        currentEntityAsJson: someString(),
        previousEntityAsJson: someString(),
        modifiedFields: { modifiedFields: someAny() },
        additionalMetadataAsJson: someString(),
    }, overrideObject);
}
export function aRestoreInfo(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        deletedDate: someDate(),
    }, overrideObject);
}
export function aCreateGlobalTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aCreateGlobalTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aCreateTagForAccountRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aCreateTagForAccountResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aCreateTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aCreateTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aDeleteGlobalTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        tagId: someString({
            validations: [{ type: 'MAX_LENGTH', value: '5' }],
        }),
    }, overrideObject);
}
export function aDeleteGlobalTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({}, overrideObject);
}
export function aDeleteTagForAccountRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        tagId: someString({
            validations: [{ type: 'MAX_LENGTH', value: '5' }],
        }),
    }, overrideObject);
}
export function aDeleteTagForAccountResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({}, overrideObject);
}
export function aDeleteTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        tagId: someString({
            validations: [{ type: 'MAX_LENGTH', value: '5' }],
        }),
    }, overrideObject);
}
export function aDeleteTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({}, overrideObject);
}
export function aGetGlobalTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        tagId: someString({
            validations: [{ type: 'MAX_LENGTH', value: '5' }],
        }),
    }, overrideObject);
}
export function aGetGlobalTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aGetTagForAccountRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        tagId: someString({
            validations: [{ type: 'MAX_LENGTH', value: '5' }],
        }),
    }, overrideObject);
}
export function aGetTagForAccountResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aGetTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        tagId: someString({
            validations: [{ type: 'MAX_LENGTH', value: '5' }],
        }),
    }, overrideObject);
}
export function aGetTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aListGlobalTagsRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        fqdn: someString({
            validations: [{ type: 'MAX_LENGTH', value: '255' }],
        }),
        exposure: aTagExposure(),
    }, overrideObject);
}
export function aListGlobalTagsResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tags: [aTag()],
    }, overrideObject);
}
export function aListTagsForAccountRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        fqdn: someString({
            validations: [{ type: 'MAX_LENGTH', value: '255' }],
        }),
        exposure: aTagExposure(),
    }, overrideObject);
}
export function aListTagsForAccountResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tags: [aTag()],
    }, overrideObject);
}
export function aListTagsRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        fqdn: someString({
            validations: [{ type: 'MAX_LENGTH', value: '255' }],
        }),
        exposure: aTagExposure(),
    }, overrideObject);
}
export function aListTagsResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tags: [aTag()],
    }, overrideObject);
}
export function aMigrateTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aMigrateTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aQueryTagsForAccountRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        fqdn: someString({
            validations: [{ type: 'MAX_LENGTH', value: '255' }],
        }),
        exposure: aTagExposure(),
        query: aCursorQuery(),
    }, overrideObject);
}
export function aQueryTagsForAccountResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tags: [aTag()],
        pagingMetadata: aCursorPagingMetadata(),
    }, overrideObject);
}
export function aQueryTagsRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        fqdn: someString({
            validations: [{ type: 'MAX_LENGTH', value: '255' }],
        }),
        exposure: aTagExposure(),
        query: aCursorQuery(),
    }, overrideObject);
}
export function aQueryTagsResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tags: [aTag()],
        pagingMetadata: aCursorPagingMetadata(),
    }, overrideObject);
}
export function aTag(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        id: someString({
            validations: [
                { type: 'READ_ONLY', value: 'true' },
                { type: 'MAX_LENGTH', value: '5' },
            ],
        }),
        revision: someString({
            validations: [
                { type: 'READ_ONLY', value: 'true' },
                { type: 'DECIMAL_VALUE' },
            ],
        }),
        createdDate: someDate({
            validations: [{ type: 'READ_ONLY', value: 'true' }],
        }),
        updatedDate: someDate({
            validations: [{ type: 'READ_ONLY', value: 'true' }],
        }),
        name: someString({
            validations: [{ type: 'MAX_LENGTH', value: '255' }],
        }),
        fqdn: someString({
            validations: [
                { type: 'IMMUTABLE', value: 'true' },
                { type: 'MAX_LENGTH', value: '255' },
            ],
        }),
        exposure: aTagExposure(),
        deleted: true,
    }, overrideObject);
}
export function aTagExposure(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = TagExposure.UNKNOWN; }
    return enumFirstItem;
}
export function aUpdateGlobalTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aUpdateGlobalTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aUpdateTagForAccountRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aUpdateTagForAccountResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aUpdateTagRequest(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aUpdateTagResponse(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        tag: aTag(),
    }, overrideObject);
}
export function aCursorPaging(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        limit: someNumber({
            validations: [
                { type: 'MIN' },
                { type: 'MAX', value: '100' },
            ],
        }),
        cursor: someString({
            validations: [
                { type: 'MAX_LENGTH', value: '16000' },
            ],
        }),
    }, overrideObject);
}
export function aCursorPagingMetadata(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        count: someNumber(),
        cursors: aCursors(),
        hasNext: true,
    }, overrideObject);
}
export function aCursorQuery(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        cursorPaging: aCursorPaging(),
        filter: {},
        sort: [aSorting(), aSorting(), aSorting(), aSorting(), aSorting()],
    }, overrideObject);
}
export function aCursors(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    return mergeDeep({
        next: someString({
            validations: [
                { type: 'MAX_LENGTH', value: '16000' },
            ],
        }),
        prev: someString({
            validations: [
                { type: 'MAX_LENGTH', value: '16000' },
            ],
        }),
    }, overrideObject);
}
export function aSorting(overrideObject) {
    if (overrideObject === void 0) { overrideObject = {}; }
    if (isCurrentBuilderWasPreviouslyCalled()) {
        return {};
    }
    return mergeDeep({
        fieldName: someString({
            validations: [{ type: 'MAX_LENGTH', value: '512' }],
        }),
        order: aSortOrder(),
    }, overrideObject);
}
export function aSortOrder(enumFirstItem) {
    if (enumFirstItem === void 0) { enumFirstItem = SortOrder.ASC; }
    return enumFirstItem;
}
function isCurrentBuilderWasPreviouslyCalled() {
    var callChainFunctionNames = stack().map(function (item) {
        return item.getFunctionName();
    });
    var callChainWithoutCurrentBuilder = callChainFunctionNames.splice(2);
    var currentBuilderName = callChainFunctionNames[1];
    return callChainWithoutCurrentBuilder.some(function (functionName) { return functionName === currentBuilderName; });
}
export * from '@wix/metro-common-builders';
//# sourceMappingURL=builders.impl.js.map