Skip to content

Commit

Permalink
Merge pull request #340 from platformsh/add-missing-creatable-fields
Browse files Browse the repository at this point in the history
add missing creatable fields
  • Loading branch information
tlattimore authored Sep 13, 2024
2 parents d1aa005 + 0108de0 commit 208c70c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/model/OrganizationDiscount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export default class OrganizationDiscount extends Ressource {
};
}[];

code?: unknown;

constructor(discount: APIObject, customUrl?: string) {
const { api_url } = getConfig();

Expand All @@ -68,6 +70,7 @@ export default class OrganizationDiscount extends Ressource {
creatableField
);
this.items = discount.items ?? [];
this.code = discount.code;
}

static async get(params: OrganizationDiscountGetParams, customUrl?: string) {
Expand Down
2 changes: 2 additions & 0 deletions src/model/OrganizationVoucher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type VoucherResponse = {
};

export default class OrganizationVoucher extends Ressource {
code?: unknown;
currency: string;
discounted_orders: any[];
vouchers: any[];
Expand All @@ -38,6 +39,7 @@ export default class OrganizationVoucher extends Ressource {
voucher,
creatableField
);
this.code = voucher.code;
this.currency = voucher.currency;
this.discounted_orders = voucher.discounted_orders ?? [];
this.vouchers = voucher.vouchers ?? [];
Expand Down
5 changes: 5 additions & 0 deletions src/model/PaymentSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const creatableField = ["type", "token", "email", "chargeable"];
export default class PaymentSource extends Ressource {
id: string;
type: string;
token: string;
email?: string;
type_label: string;
payment_category: string;
name: string;
Expand Down Expand Up @@ -43,8 +45,11 @@ export default class PaymentSource extends Ressource {
paymentSource,
creatableField
);

this.id = paymentSource.id;
this.type = paymentSource.type;
this.token = paymentSource.token;
this.email = paymentSource.email;
this.type_label = paymentSource.type_label;
this.name = paymentSource.name;
this.number = paymentSource.number;
Expand Down
6 changes: 6 additions & 0 deletions src/model/Subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ export default class Subscription extends Ressource {
enterprise_tag: string;
support_tier: string;
continuous_profiling: null | "UPSUN-FEATURE-CONTINUOUS-PROFILING";
options_url?: unknown;
options_custom?: unknown;
default_branch?: unknown;

constructor(subscription: APIObject, customUrl?: string) {
const { api_url } = getConfig();
Expand Down Expand Up @@ -292,6 +295,9 @@ export default class Subscription extends Ressource {
this.observability_suite = subscription.observability_suite;
this.environment_options = subscription.environment_options ?? [];
this.continuous_profiling = subscription.continuous_profiling ?? null;
this.options_url = subscription.options_url;
this.options_custom = subscription.options_custom;
this.default_branch = subscription.default_branch;
}

static async get(params: SubscriptionGetParams, customUrl?: string) {
Expand Down
2 changes: 2 additions & 0 deletions src/model/TeamMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type TeamMemberQueryParams = {

export default class TeamMember extends Ressource {
user: string;
role?: unknown;

constructor(teamMember: APIObject, url?: string) {
const { teamId } = teamMember;
Expand All @@ -35,6 +36,7 @@ export default class TeamMember extends Ressource {
creatableField
);
this.user = teamMember.user;
this.role = teamMember.role;
}

static async get(params: TeamMemberGetParams, customUrl?: string) {
Expand Down

0 comments on commit 208c70c

Please sign in to comment.