UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

50 lines 2.02 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; import * as MembersAPI from 'cloudflare/resources/accounts/members'; import { V4PagePaginationArray } from 'cloudflare/pagination'; 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`, MemberListResponsesV4PagePaginationArray, { 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 class MemberListResponsesV4PagePaginationArray extends V4PagePaginationArray { } (function (Members) { Members.MemberListResponsesV4PagePaginationArray = MembersAPI.MemberListResponsesV4PagePaginationArray; })(Members || (Members = {})); //# sourceMappingURL=members.mjs.map