// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as AccountsAPI from 'cloudflare/resources/accounts/accounts';
import * as MembersAPI from 'cloudflare/resources/accounts/members';
import * as RolesAPI from 'cloudflare/resources/accounts/roles';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Accounts extends APIResource {
    constructor() {
        super(...arguments);
        this.members = new MembersAPI.Members(this._client);
        this.roles = new RolesAPI.Roles(this._client);
    }
    /**
     * Update an existing account.
     */
    update(params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    list(query = {}, options) {
        if (isRequestOptions(query)) {
            return this.list({}, query);
        }
        return this._client.getAPIList('/accounts', AccountListResponsesV4PagePaginationArray, {
            query,
            ...options,
        });
    }
    /**
     * Get information about a specific account that you are a member of.
     */
    get(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class AccountListResponsesV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Accounts) {
    Accounts.AccountListResponsesV4PagePaginationArray = AccountsAPI.AccountListResponsesV4PagePaginationArray;
    Accounts.Members = MembersAPI.Members;
    Accounts.MemberListResponsesV4PagePaginationArray = MembersAPI.MemberListResponsesV4PagePaginationArray;
    Accounts.Roles = RolesAPI.Roles;
})(Accounts || (Accounts = {}));
//# sourceMappingURL=accounts.mjs.map