balena-sdk
Version:
The Balena JavaScript SDK
46 lines (45 loc) • 1.84 kB
TypeScript
import type { CreditBundle, InjectedDependenciesParam, PineOptions, PinePostResult } from '..';
declare const getCreditBundleModel: ({ pine, sdkInstance, }: InjectedDependenciesParam) => {
/**
* @summary Get all of the credit bundles purchased by the given org
* @name getAllByOrg
* @public
* @function
* @memberof balena.models.creditBundle
*
* @param {(String|Number)} organization - handle (string) or id (number) of the target organization.
* @param {Object} [options={}] - extra pine options to use
*
* @fulfil {Object[]} - credit bundles
* @returns {Promise}
*
* @example
* balena.models.creditBundle.getAllByOrg(orgId).then(function(creditBundles) {
* console.log(creditBundles);
* });
*
*/
getAllByOrg: (organization: string | number, options?: PineOptions<CreditBundle>) => Promise<CreditBundle[]>;
/**
* @summary Purchase a credit bundle for the given feature and org of the given quantity
* @name create
* @public
* @function
* @memberof balena.models.creditBundle
*
* @param {(String|Number)} organization - handle (string) or id (number) of the target organization.
* @param {Number} featureId - id (number) of the feature for which credits are being purchased.
* @param {Number} creditsToPurchase - number of credits being purchased.
*
* @fulfil {Object[]} - credit bundles
* @returns {Promise}
*
* @example
* balena.models.creditBundle.create(orgId, featureId, creditsToPurchase).then(function(creditBundle) {
* console.log(creditBundle);
* });
*
*/
create: (organization: string | number, featureId: number, creditsToPurchase: number) => Promise<PinePostResult<CreditBundle>>;
};
export default getCreditBundleModel;