UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

28 lines 1.16 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; export class IPGeolocation extends 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); } } (function (IPGeolocation) { })(IPGeolocation || (IPGeolocation = {})); //# sourceMappingURL=ip-geolocation.mjs.map