/* tslint:disable */ /* eslint-disable */ /** * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: * * * 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 { LiqTrade } from './LiqTrade'; import { LiqTradeFromJSON, LiqTradeFromJSONTyped, LiqTradeToJSON, } from './LiqTrade'; import type { LiquidationInfo } from './LiquidationInfo'; import { LiquidationInfoFromJSON, LiquidationInfoFromJSONTyped, LiquidationInfoToJSON, } from './LiquidationInfo'; /** * * @export * @interface Liquidation */ export interface Liquidation { /** * * @type {number} * @memberof Liquidation */ id: number; /** * * @type {number} * @memberof Liquidation */ market_id: number; /** * * @type {string} * @memberof Liquidation */ type: LiquidationTypeEnum; /** * * @type {LiqTrade} * @memberof Liquidation */ trade: LiqTrade; /** * * @type {LiquidationInfo} * @memberof Liquidation */ info: LiquidationInfo; /** * * @type {number} * @memberof Liquidation */ executed_at: number; } /** * @export */ export const LiquidationTypeEnum = { Partial: 'partial', Deleverage: 'deleverage' } as const; export type LiquidationTypeEnum = typeof LiquidationTypeEnum[keyof typeof LiquidationTypeEnum]; /** * Check if a given object implements the Liquidation interface. */ export function instanceOfLiquidation(value: object): value is Liquidation { if (!('id' in value) || value['id'] === undefined) return false; if (!('market_id' in value) || value['market_id'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('trade' in value) || value['trade'] === undefined) return false; if (!('info' in value) || value['info'] === undefined) return false; if (!('executed_at' in value) || value['executed_at'] === undefined) return false; return true; } export function LiquidationFromJSON(json: any): Liquidation { return LiquidationFromJSONTyped(json, false); } export function LiquidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Liquidation { if (json == null) { return json; } return { 'id': json['id'], 'market_id': json['market_id'], 'type': json['type'], 'trade': LiqTradeFromJSON(json['trade']), 'info': LiquidationInfoFromJSON(json['info']), 'executed_at': json['executed_at'], }; } export function LiquidationToJSON(value?: Liquidation | null): any { if (value == null) { return value; } return { 'id': value['id'], 'market_id': value['market_id'], 'type': value['type'], 'trade': LiqTradeToJSON(value['trade']), 'info': LiquidationInfoToJSON(value['info']), 'executed_at': value['executed_at'], }; }