cloudflare
Version:
The official TypeScript library for the Cloudflare API
24 lines • 1.2 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
export class WebsocketResource extends APIResource {
/**
* Changes Websockets setting. For more information about Websockets, please refer
* to
* [Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets).
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(`/zones/${zone_id}/settings/websockets`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Gets Websockets setting. For more information about Websockets, please refer to
* [Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets).
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/settings/websockets`, options)._thenUnwrap((obj) => obj.result);
}
}
(function (WebsocketResource) {
})(WebsocketResource || (WebsocketResource = {}));
//# sourceMappingURL=websocket.mjs.map