Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Combine the AxiosRequestConfig options passed with this specific
// API call witht the global options configured at the API Context
// level, or at the global level.
const mergedOptions = Object.assign(
{}, (parameters.context.google ? parameters.context.google._options : {}),
parameters.context._options, options);
delete mergedOptions.auth; // is overridden by our auth code
// Perform the HTTP request. NOTE: this function used to return a
// mikeal/request object. Since the transition to Axios, the method is
// now void. This may be a source of confusion for users upgrading from
// version 24.0 -> 25.0 or up.
if (authClient && typeof authClient === 'object') {
return (authClient as OAuth2Client).request(mergedOptions);
} else {
return (new DefaultTransporter()).request(mergedOptions);
}
}
true,
{},
parameters.context.google ? parameters.context.google._options : {},
parameters.context._options,
options
);
delete mergedOptions.auth; // is overridden by our auth code
// Perform the HTTP request. NOTE: this function used to return a
// mikeal/request object. Since the transition to Axios, the method is
// now void. This may be a source of confusion for users upgrading from
// version 24.0 -> 25.0 or up.
if (authClient && typeof authClient === 'object') {
return (authClient as OAuth2Client).request(mergedOptions);
} else {
return new DefaultTransporter().request(mergedOptions);
}
}