import { __esDecorate, __runInitializers } from "tslib";
import { Action } from './Action.js';
import { observed } from '../../decorators/observed.js';
/**
 * Enables removing an existing resource.
 * Endpoint: DELETE /[entity-collection-name]/{id}
 */
let DeleteAction = (() => {
    let _classSuper = Action;
    let _kind_decorators;
    let _kind_initializers = [];
    let _kind_extraInitializers = [];
    let _strategy_decorators;
    let _strategy_initializers = [];
    let _strategy_extraInitializers = [];
    let _retentionPeriod_decorators;
    let _retentionPeriod_initializers = [];
    let _retentionPeriod_extraInitializers = [];
    return class DeleteAction extends _classSuper {
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _kind_decorators = [observed()];
            _strategy_decorators = [observed()];
            _retentionPeriod_decorators = [observed()];
            __esDecorate(this, null, _kind_decorators, { kind: "accessor", name: "kind", static: false, private: false, access: { has: obj => "kind" in obj, get: obj => obj.kind, set: (obj, value) => { obj.kind = value; } }, metadata: _metadata }, _kind_initializers, _kind_extraInitializers);
            __esDecorate(this, null, _strategy_decorators, { kind: "accessor", name: "strategy", static: false, private: false, access: { has: obj => "strategy" in obj, get: obj => obj.strategy, set: (obj, value) => { obj.strategy = value; } }, metadata: _metadata }, _strategy_initializers, _strategy_extraInitializers);
            __esDecorate(this, null, _retentionPeriod_decorators, { kind: "accessor", name: "retentionPeriod", static: false, private: false, access: { has: obj => "retentionPeriod" in obj, get: obj => obj.retentionPeriod, set: (obj, value) => { obj.retentionPeriod = value; } }, metadata: _metadata }, _retentionPeriod_initializers, _retentionPeriod_extraInitializers);
            if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
        }
        #kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
        get kind() { return this.#kind_accessor_storage; }
        set kind(value) { this.#kind_accessor_storage = value; }
        #strategy_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _strategy_initializers, void 0));
        get strategy() { return this.#strategy_accessor_storage; }
        set strategy(value) { this.#strategy_accessor_storage = value; }
        #retentionPeriod_accessor_storage = (__runInitializers(this, _strategy_extraInitializers), __runInitializers(this, _retentionPeriod_initializers, void 0));
        get retentionPeriod() { return this.#retentionPeriod_accessor_storage; }
        set retentionPeriod(value) { this.#retentionPeriod_accessor_storage = value; }
        constructor(state = {}) {
            super(state);
            __runInitializers(this, _retentionPeriod_extraInitializers);
            this.kind = 'delete';
            this.strategy = state.strategy || 'soft';
            this.retentionPeriod = state.retentionPeriod ?? 30;
        }
        toJSON() {
            return {
                ...super.toJSON(),
                kind: 'delete',
                strategy: this.strategy,
                retentionPeriod: this.retentionPeriod,
            };
        }
        static isDeleteAction(action) {
            return action.kind === 'delete';
        }
        static isDeleteActionSchema(schema) {
            return schema.kind === 'delete';
        }
    };
})();
export { DeleteAction };
//# sourceMappingURL=DeleteAction.js.map