GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
File: //usr/local/lib/node_modules/firebase-tools/lib/gcp/cloudbilling.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listBillingAccounts = exports.setBillingAccount = exports.checkBillingEnabled = void 0;
const api_1 = require("../api");
const apiv2_1 = require("../apiv2");
const utils = require("../utils");
const API_VERSION = "v1";
const client = new apiv2_1.Client({ urlPrefix: (0, api_1.cloudbillingOrigin)(), apiVersion: API_VERSION });
async function checkBillingEnabled(projectId) {
    const res = await client.get(utils.endpoint(["projects", projectId, "billingInfo"]), { retryCodes: [500, 503] });
    return res.body.billingEnabled;
}
exports.checkBillingEnabled = checkBillingEnabled;
async function setBillingAccount(projectId, billingAccountName) {
    const res = await client.put(utils.endpoint(["projects", projectId, "billingInfo"]), {
        billingAccountName: billingAccountName,
    }, { retryCodes: [500, 503] });
    return res.body.billingEnabled;
}
exports.setBillingAccount = setBillingAccount;
async function listBillingAccounts() {
    const res = await client.get(utils.endpoint(["billingAccounts"]), { retryCodes: [500, 503] });
    return res.body.billingAccounts || [];
}
exports.listBillingAccounts = listBillingAccounts;