// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as MembershipsAPI from 'cloudflare/resources/memberships';
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, options) {
        return this._client.delete(`/memberships/${membershipId}`, 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 {
}
(function (Memberships) {
    Memberships.MembershipsV4PagePaginationArray = MembershipsAPI.MembershipsV4PagePaginationArray;
})(Memberships || (Memberships = {}));
//# sourceMappingURL=memberships.mjs.map