import { a as Card$1, C as Connection } from './index.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 };
