cloudflare
Version:
The official TypeScript library for the Cloudflare API
33 lines • 1.33 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Memberships extends APIResource {
/**
* Accept or reject this account invitation.
*/
update(membershipId, body, options) {
return this._client.put(`/memberships/${membershipId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
list(query = {}, options) {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/memberships', MembershipsV4PagePaginationArray, { query, ...options });
}
/**
* Remove the associated member from an account.
*/
delete(membershipId, body, options) {
return this._client.delete(`/memberships/${membershipId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Get a specific membership.
*/
get(membershipId, options) {
return this._client.get(`/memberships/${membershipId}`, options)._thenUnwrap((obj) => obj.result);
}
}
export class MembershipsV4PagePaginationArray extends V4PagePaginationArray {
}
//# sourceMappingURL=memberships.mjs.map