cloudflare
Version:
The official TypeScript library for the Cloudflare API
37 lines • 1.65 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseFieldExtractors = /* @__PURE__ */ (() => {
class BaseFieldExtractors extends APIResource {
/**
* Replaces all custom extraction rules for an extractor type. Omitted rules are
* deleted.
*/
update(extractor, params, options) {
const { account_id, ...body } = params;
return this._client.put(path `/accounts/${account_id}/field_extractors/${extractor}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Deletes all custom extraction rules for an extractor type.
*/
delete(extractor, params, options) {
const { account_id } = params;
return this._client.delete(path `/accounts/${account_id}/field_extractors/${extractor}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves the custom extraction rules configured for a given extractor type.
*/
get(extractor, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/field_extractors/${extractor}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseFieldExtractors._key = Object.freeze(['fieldExtractors']);
return BaseFieldExtractors;
})();
export class FieldExtractors extends BaseFieldExtractors {
}
//# sourceMappingURL=field-extractors.mjs.map