Skip to content

Commit

Permalink
Merge pull request #352 from platformsh/subscription-type-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
shakaman authored Oct 11, 2024
2 parents d07a923 + baa8575 commit f15e3d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 45 deletions.
2 changes: 2 additions & 0 deletions src/model/Cost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ export type FormattedCostWithTitle = FormattedCost & {
export type FormattedCostMeasure = FormattedCostWithQuantity & {
usage_type: "measure";
current_usage: number;
current_usage_formatted: string;
};

export type FormattedCostCounter = FormattedCostWithQuantity & {
usage_type: "counter";
current_usage: number;
current_usage_formatted: string;
daily_average: number;
};

Expand Down
45 changes: 1 addition & 44 deletions src/model/OrganizationSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,14 @@ export type OrganizationSubscriptionQueryParams = {
// @ts-expect-error solve the query function inheritance ts error
export class OrganizationSubscription extends Subscription {
agency_site: boolean;
big_dev: null;
big_dev_service: null;
continuous_profiling: null;
created_at: string;
enterprise_tag: string;
environments: number;
fastly_service_ids: null;
green: boolean;
fastly_service_ids: string[] | null;
hipaa: boolean;
id: string;
invoiced: boolean;
is_trial_plan: boolean;
locked: null;
options_url: string;
owner: string;
owner_info: {
type: string;
};

plan: string;
project_id: string;
project_notes: string;
project_region_label: string;
project_title: string;
project_ui: string;
services: unknown[];
storage: number;
support_tier: string;
updated_at: string;
user_licenses: number;
vendor: string;

constructor(subscription: APIObject, customUrl?: string) {
const { organizationId } = subscription;
Expand All @@ -70,34 +47,14 @@ export class OrganizationSubscription extends Subscription {
this._creatableField.push("organizationId");

this.agency_site = subscription.agency_site;
this.big_dev = subscription.big_dev;
this.big_dev_service = subscription.big_dev_service;
this.continuous_profiling = subscription.continuous_profiling;
this.created_at = subscription.created_at;
this.enterprise_tag = subscription.enterprise_tag;
this.environments = subscription.environments;
this.fastly_service_ids = subscription.fastly_service_ids;
this.green = subscription.green;
this.hipaa = subscription.hipaa;
this.id = subscription.id;
this.invoiced = subscription.invoiced;
this.is_trial_plan = subscription.is_trial_plan;
this.locked = subscription.locked;
this.options_url = subscription.options_url;
this.owner = subscription.owner;
this.owner_info = subscription.owner_info;
this.plan = subscription.plan;
this.project_id = subscription.project_id;
this.project_notes = subscription.project_notes;
this.project_region_label = subscription.project_region_label;
this.project_title = subscription.project_title;
this.project_ui = subscription.project_ui;
this.services = subscription.services;
this.storage = subscription.storage;
this.support_tier = subscription.support_tier;
this.updated_at = subscription.updated_at;
this.user_licenses = subscription.user_licenses;
this.vendor = subscription.vendor;
}

static async get(
Expand Down
4 changes: 3 additions & 1 deletion src/model/Subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export class Subscription extends Ressource {
id: string;
status: SubscriptionStatusEnum;
created_at: string;
updated_at: string;
owner_info: {
type: string;
username?: string;
Expand Down Expand Up @@ -274,7 +275,7 @@ export class Subscription extends Ressource {
enterprise_tag: string;
support_tier: string;
continuous_profiling: null | "UPSUN-FEATURE-CONTINUOUS-PROFILING";
options_url?: unknown;
options_url?: string;
options_custom?: unknown;
default_branch?: unknown;

Expand Down Expand Up @@ -313,6 +314,7 @@ export class Subscription extends Ressource {
};
this.organization = subscription.organization;
this.created_at = subscription.created_at;
this.updated_at = subscription.updated_at;
this.users_licenses = subscription.users_licenses;
this.license_uri = subscription.license_uri;
this.organization_id = subscription.organization_id;
Expand Down

0 comments on commit f15e3d2

Please sign in to comment.