MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / _isBillingEnabled

Function _isBillingEnabled

functions/billing/index.js:78–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 * @return {bool} Whether project has billing enabled or not
77 */
78const _isBillingEnabled = async projectName => {
79 try {
80 const [res] = await billing.getProjectBillingInfo({name: projectName});
81 return res.billingEnabled;
82 } catch (e) {
83 console.log(
84 'Unable to determine if billing is enabled on specified project, assuming billing is enabled'
85 );
86 return true;
87 }
88};
89
90/**
91 * Disable billing for a project by removing its billing account

Callers 1

index.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected