// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as CacheReserveAPI from 'cloudflare/resources/cache/cache-reserve';
import * as RegionalTieredCacheAPI from 'cloudflare/resources/cache/regional-tiered-cache';
import * as SmartTieredCacheAPI from 'cloudflare/resources/cache/smart-tiered-cache';
import * as VariantsAPI from 'cloudflare/resources/cache/variants';
export class Cache extends APIResource {
    constructor() {
        super(...arguments);
        this.cacheReserve = new CacheReserveAPI.CacheReserve(this._client);
        this.smartTieredCache = new SmartTieredCacheAPI.SmartTieredCache(this._client);
        this.variants = new VariantsAPI.Variants(this._client);
        this.regionalTieredCache = new RegionalTieredCacheAPI.RegionalTieredCache(this._client);
    }
    /**
     * ### Purge All Cached Content
     *
     * Removes ALL files from Cloudflare's cache. All tiers can purge everything.
     *
     * ### Purge Cached Content by URL
     *
     * Granularly removes one or more files from Cloudflare's cache by specifying URLs.
     * All tiers can purge by URL.
     *
     * To purge files with custom cache keys, include the headers used to compute the
     * cache key as in the example. If you have a device type or geo in your cache key,
     * you will need to include the CF-Device-Type or CF-IPCountry headers. If you have
     * lang in your cache key, you will need to include the Accept-Language header.
     *
     * **NB:** When including the Origin header, be sure to include the **scheme** and
     * **hostname**. The port number can be omitted if it is the default port (80 for
     * http, 443 for https), but must be included otherwise.
     *
     * ### Purge Cached Content by Tag, Host or Prefix
     *
     * Granularly removes one or more files from Cloudflare's cache either by
     * specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise
     * customers are permitted to purge by Tag, Host or Prefix.
     *
     * **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000
     * purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or
     * prefixes in one API call. This rate limit can be raised for customers who need
     * to purge at higher volume.
     */
    purge(params, options) {
        const { zone_id, ...body } = params;
        return this._client.post(`/zones/${zone_id}/purge_cache`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
}
(function (Cache) {
    Cache.CacheReserve = CacheReserveAPI.CacheReserve;
    Cache.SmartTieredCache = SmartTieredCacheAPI.SmartTieredCache;
    Cache.Variants = VariantsAPI.Variants;
    Cache.RegionalTieredCache = RegionalTieredCacheAPI.RegionalTieredCache;
})(Cache || (Cache = {}));
//# sourceMappingURL=cache.mjs.map