/* 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 { ProductCategoryListResource } from './ProductCategoryListResource'; import { ProductCategoryListResourceFromJSON, ProductCategoryListResourceFromJSONTyped, ProductCategoryListResourceToJSON, ProductCategoryListResourceToJSONTyped, } from './ProductCategoryListResource'; import type { SiteLiteResource } from './SiteLiteResource'; import { SiteLiteResourceFromJSON, SiteLiteResourceFromJSONTyped, SiteLiteResourceToJSON, SiteLiteResourceToJSONTyped, } from './SiteLiteResource'; import type { SupplierListResource } from './SupplierListResource'; import { SupplierListResourceFromJSON, SupplierListResourceFromJSONTyped, SupplierListResourceToJSON, SupplierListResourceToJSONTyped, } from './SupplierListResource'; import type { ProductChildLiteResource } from './ProductChildLiteResource'; import { ProductChildLiteResourceFromJSON, ProductChildLiteResourceFromJSONTyped, ProductChildLiteResourceToJSON, ProductChildLiteResourceToJSONTyped, } from './ProductChildLiteResource'; import type { CustomerListResource } from './CustomerListResource'; import { CustomerListResourceFromJSON, CustomerListResourceFromJSONTyped, CustomerListResourceToJSON, CustomerListResourceToJSONTyped, } from './CustomerListResource'; /** * * @export * @interface CouponResource */ export interface CouponResource { /** * * @type {number} * @memberof CouponResource */ id?: number | null; /** * * @type {string} * @memberof CouponResource */ name: string; /** * * @type {string} * @memberof CouponResource */ code: string; /** * * @type {string} * @memberof CouponResource */ type: string; /** * * @type {string} * @memberof CouponResource */ discountType: string; /** * * @type {number} * @memberof CouponResource */ discountAmount: number; /** * * @type {number} * @memberof CouponResource */ minAmount: number; /** * * @type {number} * @memberof CouponResource */ minProducts: number; /** * * @type {number} * @memberof CouponResource */ totalUseLimit: number; /** * * @type {number} * @memberof CouponResource */ customerUseLimit: number; /** * * @type {boolean} * @memberof CouponResource */ isAbandonedCart: boolean; /** * * @type {boolean} * @memberof CouponResource */ isForAllProducts: boolean; /** * * @type {boolean} * @memberof CouponResource */ isForAllCustomers: boolean; /** * * @type {Date} * @memberof CouponResource */ startDate?: Date | null; /** * * @type {Date} * @memberof CouponResource */ endDate?: Date | null; /** * * @type {SiteLiteResource} * @memberof CouponResource */ site: SiteLiteResource | null; /** * * @type {Array} * @memberof CouponResource */ productChildren: Array | null; /** * * @type {Array} * @memberof CouponResource */ categories: Array | null; /** * * @type {Array} * @memberof CouponResource */ suppliers: Array | null; /** * * @type {Array} * @memberof CouponResource */ customers: Array | null; /** * * @type {number} * @memberof CouponResource */ ordersCount: number; /** * * @type {number} * @memberof CouponResource */ cartsCount: number; } /** * Check if a given object implements the CouponResource interface. */ export function instanceOfCouponResource(value: object): value is CouponResource { 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 (!('minAmount' in value) || value['minAmount'] === undefined) return false; if (!('minProducts' in value) || value['minProducts'] === undefined) return false; if (!('totalUseLimit' in value) || value['totalUseLimit'] === undefined) return false; if (!('customerUseLimit' in value) || value['customerUseLimit'] === undefined) return false; if (!('isAbandonedCart' in value) || value['isAbandonedCart'] === undefined) return false; if (!('isForAllProducts' in value) || value['isForAllProducts'] === undefined) return false; if (!('isForAllCustomers' in value) || value['isForAllCustomers'] === undefined) return false; if (!('site' in value) || value['site'] === undefined) return false; if (!('productChildren' in value) || value['productChildren'] === undefined) return false; if (!('categories' in value) || value['categories'] === undefined) return false; if (!('suppliers' in value) || value['suppliers'] === undefined) return false; if (!('customers' in value) || value['customers'] === 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 CouponResourceFromJSON(json: any): CouponResource { return CouponResourceFromJSONTyped(json, false); } export function CouponResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CouponResource { 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'], 'minAmount': json['minAmount'], 'minProducts': json['minProducts'], 'totalUseLimit': json['totalUseLimit'], 'customerUseLimit': json['customerUseLimit'], 'isAbandonedCart': json['isAbandonedCart'], 'isForAllProducts': json['isForAllProducts'], 'isForAllCustomers': json['isForAllCustomers'], 'startDate': json['startDate'] == null ? undefined : (new Date(json['startDate'])), 'endDate': json['endDate'] == null ? undefined : (new Date(json['endDate'])), 'site': SiteLiteResourceFromJSON(json['site']), 'productChildren': (json['productChildren'] == null ? null : (json['productChildren'] as Array).map(ProductChildLiteResourceFromJSON)), 'categories': (json['categories'] == null ? null : (json['categories'] as Array).map(ProductCategoryListResourceFromJSON)), 'suppliers': (json['suppliers'] == null ? null : (json['suppliers'] as Array).map(SupplierListResourceFromJSON)), 'customers': (json['customers'] == null ? null : (json['customers'] as Array).map(CustomerListResourceFromJSON)), 'ordersCount': json['ordersCount'], 'cartsCount': json['cartsCount'], }; } export function CouponResourceToJSON(json: any): CouponResource { return CouponResourceToJSONTyped(json, false); } export function CouponResourceToJSONTyped(value?: CouponResource | 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'], 'minAmount': value['minAmount'], 'minProducts': value['minProducts'], 'totalUseLimit': value['totalUseLimit'], 'customerUseLimit': value['customerUseLimit'], 'isAbandonedCart': value['isAbandonedCart'], 'isForAllProducts': value['isForAllProducts'], 'isForAllCustomers': value['isForAllCustomers'], 'startDate': value['startDate'] === null ? null : ((value['startDate'] as any)?.toISOString()), 'endDate': value['endDate'] === null ? null : ((value['endDate'] as any)?.toISOString()), 'site': SiteLiteResourceToJSON(value['site']), 'productChildren': (value['productChildren'] == null ? null : (value['productChildren'] as Array).map(ProductChildLiteResourceToJSON)), 'categories': (value['categories'] == null ? null : (value['categories'] as Array).map(ProductCategoryListResourceToJSON)), 'suppliers': (value['suppliers'] == null ? null : (value['suppliers'] as Array).map(SupplierListResourceToJSON)), 'customers': (value['customers'] == null ? null : (value['customers'] as Array).map(CustomerListResourceToJSON)), 'ordersCount': value['ordersCount'], 'cartsCount': value['cartsCount'], }; }