"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("../utils");
const customerio_properties_1 = require("../customerio-properties");
const action = {
    title: 'Delete Object',
    description: 'Delete an object in Customer.io.',
    defaultSubscription: 'event = "Object Deleted"',
    fields: {
        object_id: {
            label: 'Object ID',
            description: 'An object ID used to identify an object.',
            type: 'string',
            default: {
                '@path': '$.properties.objectId'
            }
        },
        object_type_id: {
            label: 'Object Type ID',
            description: 'An object ID type used to identify the type of object.',
            type: 'string',
            default: {
                '@if': {
                    exists: { '@path': '$.properties.object_type_id' },
                    then: { '@path': '$.properties.object_type_id' },
                    else: { '@path': '$.properties.objectTypeId' }
                }
            }
        },
        ...customerio_properties_1.eventProperties
    },
    performBatch: (request, { payload: payloads, settings }) => {
        return (0, utils_1.sendBatch)(request, payloads.map((payload) => ({
            action: 'delete',
            payload,
            settings,
            type: 'object'
        })));
    },
    perform: (request, { payload, settings }) => {
        return (0, utils_1.sendSingle)(request, {
            action: 'delete',
            payload,
            settings,
            type: 'object'
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map