cloudflare
Version:
The official TypeScript library for the Cloudflare API
25 lines • 1.11 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
export class WebP extends APIResource {
/**
* When the client requesting the image supports the WebP image codec, and WebP
* offers a performance advantage over the original image format, Cloudflare will
* serve a WebP version of the original image.
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(`/zones/${zone_id}/settings/webp`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* When the client requesting the image supports the WebP image codec, and WebP
* offers a performance advantage over the original image format, Cloudflare will
* serve a WebP version of the original image.
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/settings/webp`, options)._thenUnwrap((obj) => obj.result);
}
}
(function (WebP) {
})(WebP || (WebP = {}));
//# sourceMappingURL=webp.mjs.map