// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as OrganizationsAPI from 'cloudflare/resources/user/organizations';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Organizations extends APIResource {
    list(query = {}, options) {
        if (isRequestOptions(query)) {
            return this.list({}, query);
        }
        return this._client.getAPIList('/user/organizations', IamOrganizationsV4PagePaginationArray, {
            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 IamOrganizationsV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Organizations) {
    Organizations.IamOrganizationsV4PagePaginationArray = OrganizationsAPI.IamOrganizationsV4PagePaginationArray;
})(Organizations || (Organizations = {}));
//# sourceMappingURL=organizations.mjs.map