Skip to content

Commit

Permalink
Update subscription API types (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpapillon authored Oct 8, 2024
1 parent f0233ed commit 5185860
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@schematichq/schematic-components",
"version": "0.3.1",
"version": "0.3.2",
"main": "dist/schematic-components.cjs.js",
"module": "dist/schematic-components.esm.js",
"types": "dist/schematic-components.d.ts",
Expand Down
30 changes: 29 additions & 1 deletion components/src/api/models/BillingSubscriptionResponseData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ import { mapValues } from "../runtime";
* @interface BillingSubscriptionResponseData
*/
export interface BillingSubscriptionResponseData {
/**
*
* @type {string}
* @memberof BillingSubscriptionResponseData
*/
currency: string;
/**
*
* @type {Date}
Expand All @@ -31,12 +37,24 @@ export interface BillingSubscriptionResponseData {
* @memberof BillingSubscriptionResponseData
*/
externalId: string;
/**
*
* @type {string}
* @memberof BillingSubscriptionResponseData
*/
id: string;
/**
*
* @type {string}
* @memberof BillingSubscriptionResponseData
*/
interval: string;
/**
*
* @type {number}
* @memberof BillingSubscriptionResponseData
*/
id: number;
totalPrice: number;
/**
*
* @type {Date}
Expand All @@ -51,9 +69,13 @@ export interface BillingSubscriptionResponseData {
export function instanceOfBillingSubscriptionResponseData(
value: object,
): value is BillingSubscriptionResponseData {
if (!("currency" in value) || value["currency"] === undefined) return false;
if (!("externalId" in value) || value["externalId"] === undefined)
return false;
if (!("id" in value) || value["id"] === undefined) return false;
if (!("interval" in value) || value["interval"] === undefined) return false;
if (!("totalPrice" in value) || value["totalPrice"] === undefined)
return false;
if (!("updatedAt" in value) || value["updatedAt"] === undefined) return false;
return true;
}
Expand All @@ -72,10 +94,13 @@ export function BillingSubscriptionResponseDataFromJSONTyped(
return json;
}
return {
currency: json["currency"],
expiredAt:
json["expired_at"] == null ? undefined : new Date(json["expired_at"]),
externalId: json["external_id"],
id: json["id"],
interval: json["interval"],
totalPrice: json["total_price"],
updatedAt: new Date(json["updated_at"]),
};
}
Expand All @@ -87,12 +112,15 @@ export function BillingSubscriptionResponseDataToJSON(
return value;
}
return {
currency: value["currency"],
expired_at:
value["expiredAt"] == null
? undefined
: (value["expiredAt"] as any).toISOString(),
external_id: value["externalId"],
id: value["id"],
interval: value["interval"],
total_price: value["totalPrice"],
updated_at: value["updatedAt"].toISOString(),
};
}

0 comments on commit 5185860

Please sign in to comment.