/* tslint:disable */ /* eslint-disable */ /** * My API * API documentation for my Laravel app * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; /** * * @export * @interface DiscountResource */ export interface DiscountResource { /** * * @type {number} * @memberof DiscountResource */ id: number; /** * * @type {string} * @memberof DiscountResource */ discountType: string; /** * * @type {string} * @memberof DiscountResource */ discountValueType: string; /** * * @type {number} * @memberof DiscountResource */ discountValue: number; /** * * @type {number} * @memberof DiscountResource */ itemId?: number | null; /** * * @type {string} * @memberof DiscountResource */ name: string; /** * * @type {string} * @memberof DiscountResource */ couponCode: string; } /** * Check if a given object implements the DiscountResource interface. */ export function instanceOfDiscountResource(value: object): value is DiscountResource { if (!('id' in value) || value['id'] === undefined) return false; if (!('discountType' in value) || value['discountType'] === undefined) return false; if (!('discountValueType' in value) || value['discountValueType'] === undefined) return false; if (!('discountValue' in value) || value['discountValue'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; if (!('couponCode' in value) || value['couponCode'] === undefined) return false; return true; } export function DiscountResourceFromJSON(json: any): DiscountResource { return DiscountResourceFromJSONTyped(json, false); } export function DiscountResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiscountResource { if (json == null) { return json; } return { 'id': json['id'], 'discountType': json['discountType'], 'discountValueType': json['discountValueType'], 'discountValue': json['discountValue'], 'itemId': json['itemId'] == null ? undefined : json['itemId'], 'name': json['name'], 'couponCode': json['couponCode'], }; } export function DiscountResourceToJSON(json: any): DiscountResource { return DiscountResourceToJSONTyped(json, false); } export function DiscountResourceToJSONTyped(value?: DiscountResource | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'discountType': value['discountType'], 'discountValueType': value['discountValueType'], 'discountValue': value['discountValue'], 'itemId': value['itemId'], 'name': value['name'], 'couponCode': value['couponCode'], }; }