import { a as Connection } from './Item-f4cbd6f4.js';
import { C as Card$1 } from './index-063af7ee.js';
import './_commonjsHelpers-9943807e.js';
import './index-1f953d81.js';
import './Token-ba2c5d5c.js';
import './TextDecoder-357ac2ce.js';

class Card {
    constructor(connection) {
        this.connection = connection;
    }
    async create(request) {
        return await this.connection.post(`card`, request);
    }
    async update(request, card) {
        return await (Card$1.Creatable.is(request)
            ? this.connection.put(`card/${card}`, request)
            : this.connection.patch(`card/${card}`, request));
    }
    async get(card) {
        return await this.connection.get(`card/${card}`);
    }
    static open(url, key) {
        const connection = Connection.open(url, key);
        return connection && new Card(connection);
    }
}

export { Card };
