/**
* Retrieve a Shipping Zone by it's ID.
*
* @param int $zone_id Shipping Zone ID.
* @return WC_Shipping_Zone|WP_Error
*/
protected function get_zone($zone_id)
{
$zone = WC_Shipping_Zones::get_zone_by('zone_id', $zone_id);
if (false === $zone) {
return new WP_Error('woocommerce_rest_shipping_zone_invalid', __("Resource doesn't exist.", 'woocommerce'), array('status' => 404));
}
return $zone;
}