51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
"use strict";
|
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.SubscriptionsSinglePage = exports.Subscriptions = void 0;
|
|
const resource_1 = require("../../resource.js");
|
|
const shared_1 = require("../shared.js");
|
|
Object.defineProperty(exports, "SubscriptionsSinglePage", { enumerable: true, get: function () { return shared_1.SubscriptionsSinglePage; } });
|
|
class Subscriptions extends resource_1.APIResource {
|
|
/**
|
|
* Updates a user's subscriptions.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* const subscription = await client.user.subscriptions.update(
|
|
* '506e3185e9c882d175a2d0cb0093d9f2',
|
|
* );
|
|
* ```
|
|
*/
|
|
update(identifier, body, options) {
|
|
return this._client.put(`/user/subscriptions/${identifier}`, { body, ...options })._thenUnwrap((obj) => obj.result);
|
|
}
|
|
/**
|
|
* Deletes a user's subscription.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* const subscription = await client.user.subscriptions.delete(
|
|
* '506e3185e9c882d175a2d0cb0093d9f2',
|
|
* );
|
|
* ```
|
|
*/
|
|
delete(identifier, options) {
|
|
return this._client.delete(`/user/subscriptions/${identifier}`, options);
|
|
}
|
|
/**
|
|
* Lists all of a user's subscriptions.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* // Automatically fetches more pages as needed.
|
|
* for await (const subscription of client.user.subscriptions.get()) {
|
|
* // ...
|
|
* }
|
|
* ```
|
|
*/
|
|
get(options) {
|
|
return this._client.getAPIList('/user/subscriptions', shared_1.SubscriptionsSinglePage, options);
|
|
}
|
|
}
|
|
exports.Subscriptions = Subscriptions;
|
|
//# sourceMappingURL=subscriptions.js.map
|