/* 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 { TransactionType } from './TransactionType'; import { TransactionTypeFromJSON, TransactionTypeFromJSONTyped, TransactionTypeToJSON, TransactionTypeToJSONTyped, } from './TransactionType'; import type { PaymentMethod } from './PaymentMethod'; import { PaymentMethodFromJSON, PaymentMethodFromJSONTyped, PaymentMethodToJSON, PaymentMethodToJSONTyped, } from './PaymentMethod'; import type { PaymentSource } from './PaymentSource'; import { PaymentSourceFromJSON, PaymentSourceFromJSONTyped, PaymentSourceToJSON, PaymentSourceToJSONTyped, } from './PaymentSource'; import type { PaymentStatus } from './PaymentStatus'; import { PaymentStatusFromJSON, PaymentStatusFromJSONTyped, PaymentStatusToJSON, PaymentStatusToJSONTyped, } from './PaymentStatus'; /** * * @export * @interface TransactionLiteResource */ export interface TransactionLiteResource { /** * * @type {number} * @memberof TransactionLiteResource */ id?: number | null; /** * * @type {PaymentSource} * @memberof TransactionLiteResource */ paymentSource: PaymentSource; /** * * @type {PaymentMethod} * @memberof TransactionLiteResource */ paymentMethod: PaymentMethod; /** * * @type {string} * @memberof TransactionLiteResource */ paymentMethodThumbnail: string; /** * * @type {TransactionType} * @memberof TransactionLiteResource */ type: TransactionType; /** * * @type {PaymentStatus} * @memberof TransactionLiteResource */ status: PaymentStatus; /** * * @type {number} * @memberof TransactionLiteResource */ amount: number; /** * * @type {number} * @memberof TransactionLiteResource */ surcharge: number; /** * * @type {number} * @memberof TransactionLiteResource */ totalAmount: number; /** * * @type {string} * @memberof TransactionLiteResource */ reference: string; /** * * @type {string} * @memberof TransactionLiteResource */ description?: string | null; /** * * @type {Date} * @memberof TransactionLiteResource */ createdAt?: Date | null; } /** * Check if a given object implements the TransactionLiteResource interface. */ export function instanceOfTransactionLiteResource(value: object): value is TransactionLiteResource { if (!('paymentSource' in value) || value['paymentSource'] === undefined) return false; if (!('paymentMethod' in value) || value['paymentMethod'] === undefined) return false; if (!('paymentMethodThumbnail' in value) || value['paymentMethodThumbnail'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('status' in value) || value['status'] === undefined) return false; if (!('amount' in value) || value['amount'] === undefined) return false; if (!('surcharge' in value) || value['surcharge'] === undefined) return false; if (!('totalAmount' in value) || value['totalAmount'] === undefined) return false; if (!('reference' in value) || value['reference'] === undefined) return false; return true; } export function TransactionLiteResourceFromJSON(json: any): TransactionLiteResource { return TransactionLiteResourceFromJSONTyped(json, false); } export function TransactionLiteResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionLiteResource { if (json == null) { return json; } return { 'id': json['id'] == null ? undefined : json['id'], 'paymentSource': PaymentSourceFromJSON(json['paymentSource']), 'paymentMethod': PaymentMethodFromJSON(json['paymentMethod']), 'paymentMethodThumbnail': json['paymentMethodThumbnail'], 'type': TransactionTypeFromJSON(json['type']), 'status': PaymentStatusFromJSON(json['status']), 'amount': json['amount'], 'surcharge': json['surcharge'], 'totalAmount': json['totalAmount'], 'reference': json['reference'], 'description': json['description'] == null ? undefined : json['description'], 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), }; } export function TransactionLiteResourceToJSON(json: any): TransactionLiteResource { return TransactionLiteResourceToJSONTyped(json, false); } export function TransactionLiteResourceToJSONTyped(value?: TransactionLiteResource | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'paymentSource': PaymentSourceToJSON(value['paymentSource']), 'paymentMethod': PaymentMethodToJSON(value['paymentMethod']), 'paymentMethodThumbnail': value['paymentMethodThumbnail'], 'type': TransactionTypeToJSON(value['type']), 'status': PaymentStatusToJSON(value['status']), 'amount': value['amount'], 'surcharge': value['surcharge'], 'totalAmount': value['totalAmount'], 'reference': value['reference'], 'description': value['description'], 'createdAt': value['createdAt'] === null ? null : ((value['createdAt'] as any)?.toISOString()), }; }