/* tslint:disable */ /* eslint-disable */ // @ts-nocheck /** * Audius API * * The version of the OpenAPI document: 1.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 { exists, mapValues } from '../runtime'; import type { PurchaseSplit } from './PurchaseSplit'; import { PurchaseSplitFromJSON, PurchaseSplitFromJSONTyped, PurchaseSplitToJSON, } from './PurchaseSplit'; import { } from './'; /** * * @export * @interface Purchase */ export interface Purchase { /** * * @type {number} * @memberof Purchase */ slot: number; /** * * @type {string} * @memberof Purchase */ signature: string; /** * * @type {string} * @memberof Purchase */ sellerUserId: string; /** * * @type {string} * @memberof Purchase */ buyerUserId: string; /** * * @type {string} * @memberof Purchase */ amount: string; /** * * @type {string} * @memberof Purchase */ extraAmount: string; /** * * @type {string} * @memberof Purchase */ contentType: string; /** * * @type {string} * @memberof Purchase */ contentId: string; /** * * @type {string} * @memberof Purchase */ createdAt: string; /** * * @type {string} * @memberof Purchase */ updatedAt: string; /** * * @type {string} * @memberof Purchase */ access: string; /** * * @type {Array} * @memberof Purchase */ splits: Array; } /** * Check if a given object implements the Purchase interface. */ export function instanceOfPurchase(value: object): value is Purchase { let isInstance = true; isInstance = isInstance && "slot" in value && value["slot"] !== undefined; isInstance = isInstance && "signature" in value && value["signature"] !== undefined; isInstance = isInstance && "sellerUserId" in value && value["sellerUserId"] !== undefined; isInstance = isInstance && "buyerUserId" in value && value["buyerUserId"] !== undefined; isInstance = isInstance && "amount" in value && value["amount"] !== undefined; isInstance = isInstance && "extraAmount" in value && value["extraAmount"] !== undefined; isInstance = isInstance && "contentType" in value && value["contentType"] !== undefined; isInstance = isInstance && "contentId" in value && value["contentId"] !== undefined; isInstance = isInstance && "createdAt" in value && value["createdAt"] !== undefined; isInstance = isInstance && "updatedAt" in value && value["updatedAt"] !== undefined; isInstance = isInstance && "access" in value && value["access"] !== undefined; isInstance = isInstance && "splits" in value && value["splits"] !== undefined; return isInstance; } export function PurchaseFromJSON(json: any): Purchase { return PurchaseFromJSONTyped(json, false); } export function PurchaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Purchase { if ((json === undefined) || (json === null)) { return json; } if (!ignoreDiscriminator) { } return { 'slot': json['slot'], 'signature': json['signature'], 'sellerUserId': json['seller_user_id'], 'buyerUserId': json['buyer_user_id'], 'amount': json['amount'], 'extraAmount': json['extra_amount'], 'contentType': json['content_type'], 'contentId': json['content_id'], 'createdAt': json['created_at'], 'updatedAt': json['updated_at'], 'access': json['access'], 'splits': ((json['splits'] as Array).map(PurchaseSplitFromJSON)), }; } export function PurchaseToJSON(value?: Purchase | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'slot': value.slot, 'signature': value.signature, 'seller_user_id': value.sellerUserId, 'buyer_user_id': value.buyerUserId, 'amount': value.amount, 'extra_amount': value.extraAmount, 'content_type': value.contentType, 'content_id': value.contentId, 'created_at': value.createdAt, 'updated_at': value.updatedAt, 'access': value.access, 'splits': ((value.splits as Array).map(PurchaseSplitToJSON)), }; }