UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

48 lines 1.76 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../resource.mjs"; import { MembersV4PagePaginationArray } from "../shared.mjs"; export class Members extends APIResource { /** * Add a user to the list of members for this account. */ create(params, options) { const { account_id, ...body } = params; return this._client.post(`/accounts/${account_id}/members`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * Modify an account member. */ update(memberId, params, options) { const { account_id, ...body } = params; return this._client.put(`/accounts/${account_id}/members/${memberId}`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * List all members of an account. */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList(`/accounts/${account_id}/members`, MembersV4PagePaginationArray, { query, ...options, }); } /** * Remove a member from an account. */ delete(memberId, params, options) { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/members/${memberId}`, options)._thenUnwrap((obj) => obj.result); } /** * Get information about a specific member of an account. */ get(memberId, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/members/${memberId}`, options)._thenUnwrap((obj) => obj.result); } } export { MembersV4PagePaginationArray }; //# sourceMappingURL=members.mjs.map