/* 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'; import type { SiteLiteResource } from './SiteLiteResource'; import { SiteLiteResourceFromJSON, SiteLiteResourceFromJSONTyped, SiteLiteResourceToJSON, SiteLiteResourceToJSONTyped, } from './SiteLiteResource'; /** * * @export * @interface CouponListResource */ export interface CouponListResource { /** * * @type {number} * @memberof CouponListResource */ id?: number | null; /** * * @type {string} * @memberof CouponListResource */ name: string; /** * * @type {string} * @memberof CouponListResource */ code: string; /** * * @type {string} * @memberof CouponListResource */ type: string; /** * * @type {string} * @memberof CouponListResource */ discountType: string; /** * * @type {number} * @memberof CouponListResource */ discountAmount: number; /** * * @type {Date} * @memberof CouponListResource */ startDate?: Date | null; /** * * @type {Date} * @memberof CouponListResource */ endDate?: Date | null; /** * * @type {boolean} * @memberof CouponListResource */ isAbandonedCart: boolean; /** * * @type {SiteLiteResource} * @memberof CouponListResource */ site: SiteLiteResource | null; /** * * @type {number} * @memberof CouponListResource */ ordersCount: number; /** * * @type {number} * @memberof CouponListResource */ cartsCount: number; } /** * Check if a given object implements the CouponListResource interface. */ export function instanceOfCouponListResource(value: object): value is CouponListResource { if (!('name' in value) || value['name'] === undefined) return false; if (!('code' in value) || value['code'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('discountType' in value) || value['discountType'] === undefined) return false; if (!('discountAmount' in value) || value['discountAmount'] === undefined) return false; if (!('isAbandonedCart' in value) || value['isAbandonedCart'] === undefined) return false; if (!('site' in value) || value['site'] === undefined) return false; if (!('ordersCount' in value) || value['ordersCount'] === undefined) return false; if (!('cartsCount' in value) || value['cartsCount'] === undefined) return false; return true; } export function CouponListResourceFromJSON(json: any): CouponListResource { return CouponListResourceFromJSONTyped(json, false); } export function CouponListResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CouponListResource { if (json == null) { return json; } return { 'id': json['id'] == null ? undefined : json['id'], 'name': json['name'], 'code': json['code'], 'type': json['type'], 'discountType': json['discountType'], 'discountAmount': json['discountAmount'], 'startDate': json['startDate'] == null ? undefined : (new Date(json['startDate'])), 'endDate': json['endDate'] == null ? undefined : (new Date(json['endDate'])), 'isAbandonedCart': json['isAbandonedCart'], 'site': SiteLiteResourceFromJSON(json['site']), 'ordersCount': json['ordersCount'], 'cartsCount': json['cartsCount'], }; } export function CouponListResourceToJSON(json: any): CouponListResource { return CouponListResourceToJSONTyped(json, false); } export function CouponListResourceToJSONTyped(value?: CouponListResource | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'name': value['name'], 'code': value['code'], 'type': value['type'], 'discountType': value['discountType'], 'discountAmount': value['discountAmount'], 'startDate': value['startDate'] === null ? null : ((value['startDate'] as any)?.toISOString()), 'endDate': value['endDate'] === null ? null : ((value['endDate'] as any)?.toISOString()), 'isAbandonedCart': value['isAbandonedCart'], 'site': SiteLiteResourceToJSON(value['site']), 'ordersCount': value['ordersCount'], 'cartsCount': value['cartsCount'], }; }