'use strict';

const Item = require('./Item-00ce8c24.js');
const index = require('./index-cc85865d.js');
require('./_commonjsHelpers-537d719a.js');
require('./index-09251373.js');
require('./Token-8c5ba5d9.js');
require('./TextDecoder-753156f3.js');

class Card {
    constructor(connection) {
        this.connection = connection;
    }
    async create(request) {
        return await this.connection.post(`card`, request);
    }
    async update(request, card) {
        return await (index.Card.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 = Item.Connection.open(url, key);
        return connection && new Card(connection);
    }
}

exports.Card = Card;
