// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import { isRequestOptions } from 'cloudflaredev/core';
import * as OrganizationsAPI from 'cloudflaredev/resources/user/organizations';
import { V4PagePaginationArray } from 'cloudflaredev/pagination';
export class Organizations extends APIResource {
    list(query = {}, options) {
        if (isRequestOptions(query)) {
            return this.list({}, query);
        }
        return this._client.getAPIList('/user/organizations', OrganizationsV4PagePaginationArray, {
            query,
            ...options,
        });
    }
    /**
     * Removes association to an organization.
     */
    delete(organizationId, options) {
        return this._client.delete(`/user/organizations/${organizationId}`, options);
    }
    /**
     * Gets a specific organization the user is associated with.
     */
    get(organizationId, options) {
        return this._client.get(`/user/organizations/${organizationId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class OrganizationsV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Organizations) {
    Organizations.OrganizationsV4PagePaginationArray = OrganizationsAPI.OrganizationsV4PagePaginationArray;
})(Organizations || (Organizations = {}));
//# sourceMappingURL=organizations.mjs.map