function createParseError(response, err) {
    var _a;
    const msg = `Error "${err}" occurred while parsing the response body - ${response.bodyAsText}.`;
    const errCode = (_a = err.code) !== null && _a !== void 0 ? _a : restError_js_1.RestError.PARSE_ERROR;
    return new restError_js_1.RestError(msg, {
        code: errCode,
        statusCode: response.status,
        request: response.request,
        response: response,
    });
}
Builds the request url, filling in query and path parameters
@param endpoint - base url which can be a template url
@param routePath - path to append to the endpoint
@param pathParameters - values of the path parameters
@param options - request parameters including query parameters
@returns a full url with path and query parameters