import { __esDecorate, __runInitializers } from "tslib";
import { Action } from './Action.js';
import { observed } from '../../decorators/observed.js';
/**
 * Enables adding a new resource to a collection.
 * Endpoint: POST /[entity-collection-name]
 */
let CreateAction = (() => {
    let _classSuper = Action;
    let _kind_decorators;
    let _kind_initializers = [];
    let _kind_extraInitializers = [];
    return class CreateAction extends _classSuper {
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _kind_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);
            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; }
        constructor(state = {}) {
            super(state);
            __runInitializers(this, _kind_extraInitializers);
            this.kind = 'create';
        }
        toJSON() {
            return {
                ...super.toJSON(),
                kind: 'create',
            };
        }
        static isCreateAction(action) {
            return action.kind === 'create';
        }
        static isCreateActionSchema(schema) {
            return schema.kind === 'create';
        }
    };
})();
export { CreateAction };
//# sourceMappingURL=CreateAction.js.map