cloudflare
Version:
The official TypeScript library for the Cloudflare API
32 lines • 1.34 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.IPGeolocation = void 0;
const resource_1 = require("cloudflare/resource");
class IPGeolocation extends resource_1.APIResource {
/**
* Enable IP Geolocation to have Cloudflare geolocate visitors to your website and
* pass the country code to you.
* (https://support.cloudflare.com/hc/en-us/articles/200168236).
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(`/zones/${zone_id}/settings/ip_geolocation`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Enable IP Geolocation to have Cloudflare geolocate visitors to your website and
* pass the country code to you.
* (https://support.cloudflare.com/hc/en-us/articles/200168236).
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/settings/ip_geolocation`, options)._thenUnwrap((obj) => obj.result);
}
}
exports.IPGeolocation = IPGeolocation;
(function (IPGeolocation) {
})(IPGeolocation = exports.IPGeolocation || (exports.IPGeolocation = {}));
//# sourceMappingURL=ip-geolocation.js.map