cloudflare
Version:
The official TypeScript library for the Cloudflare API
32 lines • 1.4 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.IPGeolocationResource = void 0;
const resource_1 = require("cloudflare/resource");
class IPGeolocationResource 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.IPGeolocationResource = IPGeolocationResource;
(function (IPGeolocationResource) {
})(IPGeolocationResource = exports.IPGeolocationResource || (exports.IPGeolocationResource = {}));
//# sourceMappingURL=ip-geolocation.js.map