// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as SitesAPI from 'cloudflaredev/resources/magic-transit/sites/sites';
import * as ACLsAPI from 'cloudflaredev/resources/magic-transit/sites/acls';
import * as LANsAPI from 'cloudflaredev/resources/magic-transit/sites/lans';
import * as WANsAPI from 'cloudflaredev/resources/magic-transit/sites/wans';
import { SinglePage } from 'cloudflaredev/pagination';
export class Sites extends APIResource {
    constructor() {
        super(...arguments);
        this.acls = new ACLsAPI.ACLs(this._client);
        this.lans = new LANsAPI.LANs(this._client);
        this.wans = new WANsAPI.WANs(this._client);
    }
    /**
     * Creates a new Site
     */
    create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/magic/sites`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Update a specific Site.
     */
    update(siteId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/magic/sites/${siteId}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Lists Sites associated with an account. Use connector_identifier query param to
     * return sites where connector_identifier matches either site.ConnectorID or
     * site.SecondaryConnectorID.
     */
    list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/magic/sites`, SitesSinglePage, {
            query,
            ...options,
        });
    }
    /**
     * Remove a specific Site.
     */
    delete(siteId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/magic/sites/${siteId}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Get a specific Site.
     */
    get(siteId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/magic/sites/${siteId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class SitesSinglePage extends SinglePage {
}
(function (Sites) {
    Sites.SitesSinglePage = SitesAPI.SitesSinglePage;
    Sites.ACLs = ACLsAPI.ACLs;
    Sites.ACLsSinglePage = ACLsAPI.ACLsSinglePage;
    Sites.LANs = LANsAPI.LANs;
    Sites.LANsSinglePage = LANsAPI.LANsSinglePage;
    Sites.WANs = WANsAPI.WANs;
    Sites.WANsSinglePage = WANsAPI.WANsSinglePage;
})(Sites || (Sites = {}));
//# sourceMappingURL=sites.mjs.map