update models

This commit is contained in:
Damodar Lohani
2024-12-22 13:14:06 +05:45
parent 660bddd799
commit 867320911c
2 changed files with 20 additions and 6 deletions
+18 -6
View File
@@ -174,6 +174,10 @@ export type Aggregation = {
* Usage logs for the billing period.
*/
resources: OrganizationUsage;
/**
* Aggregation billing plan
*/
plan: string;
};
export type OrganizationUsage = {
@@ -388,19 +392,27 @@ export class Billing {
);
}
async getPlan(organizationId: string): Promise<Plan> {
async getOrganizationPlan(organizationId: string): Promise<Plan> {
const path = `/organizations/${organizationId}/plan`;
const params = {
organizationId
};
const uri = new URL(this.client.config.endpoint + path);
return await this.client.call(
'get',
uri,
{
'content-type': 'application/json'
},
params
}
);
}
async getPlan(planId: string): Promise<Plan> {
const path = `/console/plans/${planId}`;
const uri = new URL(this.client.config.endpoint + path);
return await this.client.call(
'get',
uri,
{
'content-type': 'application/json'
}
);
}
+2
View File
@@ -29,6 +29,8 @@ export type Organization = Models.Team<Record<string, unknown>> & {
amount: number;
billingTaxId?: string;
billingPlanDowngrade?: Tier;
billingAggregationId: string;
billingInvoiceId: string;
};
export type OrganizationList = {