react-native-priv-sdk
Version:
Official MyCover.ai SDK. Supercharge your product with MyCover AI Insurance offerings. Create embedded insurance offerings or full white label insurance applications that excite your customers.
37 lines (30 loc) • 801 B
text/typescript
export class PolicyProvider {
companyName: string;
id: string;
constructor(data: { companyName: string; id: string }) {
this.companyName = data.companyName;
this.id = data.id;
}
static fromJson(json: any): PolicyProvider {
return new PolicyProvider({
companyName: json['company_name'],
id: json['id'],
});
}
toJson(): any {
return {
company_name: this.companyName,
id: this.id,
};
}
}
// const jsonResponse = {
// company_name: "Insurance Co.",
// id: "12345",
// };
// // Creating an instance from JSON
// const policyProvider = PolicyProvider.fromJson(jsonResponse);
// console.log(policyProvider);
// // Converting the instance back to JSON
// const json = policyProvider.toJson();
// console.log(json);