@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
51 lines (48 loc) • 2.35 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/gift_card_recipients.ts
var GiftCardRecipients = class _GiftCardRecipients extends chunkU22VLCMN_cjs.ApiResource {
static TYPE = "gift_card_recipients";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _GiftCardRecipients.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _GiftCardRecipients.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _GiftCardRecipients.TYPE } : id, options);
}
async customer(giftCardRecipientId, params, options) {
const _giftCardRecipientId = giftCardRecipientId.id || giftCardRecipientId;
return this.resources.fetch({ type: "customers" }, `gift_card_recipients/${_giftCardRecipientId}/customer`, params, options);
}
async event_stores(giftCardRecipientId, params, options) {
const _giftCardRecipientId = giftCardRecipientId.id || giftCardRecipientId;
return this.resources.fetch({ type: "event_stores" }, `gift_card_recipients/${_giftCardRecipientId}/event_stores`, params, options);
}
async attachments(giftCardRecipientId, params, options) {
const _giftCardRecipientId = giftCardRecipientId.id || giftCardRecipientId;
return this.resources.fetch({ type: "attachments" }, `gift_card_recipients/${_giftCardRecipientId}/attachments`, params, options);
}
async versions(giftCardRecipientId, params, options) {
const _giftCardRecipientId = giftCardRecipientId.id || giftCardRecipientId;
return this.resources.fetch({ type: "versions" }, `gift_card_recipients/${_giftCardRecipientId}/versions`, params, options);
}
isGiftCardRecipient(resource) {
return resource.type && resource.type === _GiftCardRecipients.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _GiftCardRecipients.TYPE;
}
};
var instance = new GiftCardRecipients();
var gift_card_recipients_default = instance;
exports.gift_card_recipients_default = gift_card_recipients_default;
//# sourceMappingURL=chunk-2CPNHJAZ.cjs.map
//# sourceMappingURL=chunk-2CPNHJAZ.cjs.map
;