/* 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 { CollectionActivityWithoutTracksFromJSONTyped, TrackActivityFromJSONTyped } from './'; /** * * @export * @interface Activity */ export interface Activity { /** * * @type {string} * @memberof Activity */ timestamp: string; /** * * @type {string} * @memberof Activity */ itemType: ActivityItemTypeEnum; /** * * @type {object} * @memberof Activity */ item: object; /** * * @type {string} * @memberof Activity */ _class: string; } /** * @export */ export const ActivityItemTypeEnum = { Track: 'track', Playlist: 'playlist' } as const; export type ActivityItemTypeEnum = typeof ActivityItemTypeEnum[keyof typeof ActivityItemTypeEnum]; /** * Check if a given object implements the Activity interface. */ export function instanceOfActivity(value: object): value is Activity { let isInstance = true; isInstance = isInstance && "timestamp" in value && value["timestamp"] !== undefined; isInstance = isInstance && "itemType" in value && value["itemType"] !== undefined; isInstance = isInstance && "item" in value && value["item"] !== undefined; isInstance = isInstance && "_class" in value && value["_class"] !== undefined; return isInstance; } export function ActivityFromJSON(json: any): Activity { return ActivityFromJSONTyped(json, false); } export function ActivityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Activity { if ((json === undefined) || (json === null)) { return json; } if (!ignoreDiscriminator) { if (json['_class'] === 'collection_activity_without_tracks') { return CollectionActivityWithoutTracksFromJSONTyped(json, true); } if (json['_class'] === 'track_activity') { return TrackActivityFromJSONTyped(json, true); } } return { 'timestamp': json['timestamp'], 'itemType': json['item_type'], 'item': json['item'], '_class': json['class'], }; } export function ActivityToJSON(value?: Activity | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'timestamp': value.timestamp, 'item_type': value.itemType, 'item': value.item, 'class': value._class, }; }