/* 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 { Access } from './Access'; import { AccessFromJSON, AccessFromJSONTyped, AccessToJSON, } from './Access'; import type { AccessGate } from './AccessGate'; import { AccessGateFromJSON, AccessGateFromJSONTyped, AccessGateToJSON, } from './AccessGate'; import type { AlbumBacklink } from './AlbumBacklink'; import { AlbumBacklinkFromJSON, AlbumBacklinkFromJSONTyped, AlbumBacklinkToJSON, } from './AlbumBacklink'; import type { CoverArt } from './CoverArt'; import { CoverArtFromJSON, CoverArtFromJSONTyped, CoverArtToJSON, } from './CoverArt'; import type { DdexCopyright } from './DdexCopyright'; import { DdexCopyrightFromJSON, DdexCopyrightFromJSONTyped, DdexCopyrightToJSON, } from './DdexCopyright'; import type { DdexResourceContributor } from './DdexResourceContributor'; import { DdexResourceContributorFromJSON, DdexResourceContributorFromJSONTyped, DdexResourceContributorToJSON, } from './DdexResourceContributor'; import type { DdexRightsController } from './DdexRightsController'; import { DdexRightsControllerFromJSON, DdexRightsControllerFromJSONTyped, DdexRightsControllerToJSON, } from './DdexRightsController'; import type { Favorite } from './Favorite'; import { FavoriteFromJSON, FavoriteFromJSONTyped, FavoriteToJSON, } from './Favorite'; import type { FieldVisibility } from './FieldVisibility'; import { FieldVisibilityFromJSON, FieldVisibilityFromJSONTyped, FieldVisibilityToJSON, } from './FieldVisibility'; import type { RemixParent } from './RemixParent'; import { RemixParentFromJSON, RemixParentFromJSONTyped, RemixParentToJSON, } from './RemixParent'; import type { Repost } from './Repost'; import { RepostFromJSON, RepostFromJSONTyped, RepostToJSON, } from './Repost'; import type { StemParent } from './StemParent'; import { StemParentFromJSON, StemParentFromJSONTyped, StemParentToJSON, } from './StemParent'; import type { TrackArtwork } from './TrackArtwork'; import { TrackArtworkFromJSON, TrackArtworkFromJSONTyped, TrackArtworkToJSON, } from './TrackArtwork'; import type { TrackSegment } from './TrackSegment'; import { TrackSegmentFromJSON, TrackSegmentFromJSONTyped, TrackSegmentToJSON, } from './TrackSegment'; import type { UrlWithMirrors } from './UrlWithMirrors'; import { UrlWithMirrorsFromJSON, UrlWithMirrorsFromJSONTyped, UrlWithMirrorsToJSON, } from './UrlWithMirrors'; import type { User } from './User'; import { UserFromJSON, UserFromJSONTyped, UserToJSON, } from './User'; /** * * @export * @interface SearchTrack */ export interface SearchTrack { /** * * @type {TrackArtwork} * @memberof SearchTrack */ artwork: TrackArtwork; /** * * @type {string} * @memberof SearchTrack */ description?: string; /** * * @type {string} * @memberof SearchTrack */ genre: string; /** * * @type {string} * @memberof SearchTrack */ id: string; /** * * @type {string} * @memberof SearchTrack */ trackCid?: string; /** * * @type {string} * @memberof SearchTrack */ previewCid?: string; /** * * @type {string} * @memberof SearchTrack */ origFileCid?: string; /** * * @type {string} * @memberof SearchTrack */ origFilename?: string; /** * * @type {boolean} * @memberof SearchTrack */ isOriginalAvailable: boolean; /** * * @type {string} * @memberof SearchTrack */ mood?: string; /** * * @type {Date} * @memberof SearchTrack */ releaseDate?: Date; /** * * @type {RemixParent} * @memberof SearchTrack */ remixOf: RemixParent; /** * * @type {number} * @memberof SearchTrack */ repostCount: number; /** * * @type {number} * @memberof SearchTrack */ favoriteCount: number; /** * * @type {number} * @memberof SearchTrack */ commentCount: number; /** * * @type {string} * @memberof SearchTrack */ tags?: string; /** * * @type {string} * @memberof SearchTrack */ title: string; /** * * @type {User} * @memberof SearchTrack */ user: User; /** * * @type {number} * @memberof SearchTrack */ duration: number; /** * * @type {boolean} * @memberof SearchTrack */ isDownloadable: boolean; /** * * @type {number} * @memberof SearchTrack */ playCount: number; /** * * @type {string} * @memberof SearchTrack */ permalink: string; /** * * @type {boolean} * @memberof SearchTrack */ isStreamable?: boolean; /** * * @type {string} * @memberof SearchTrack */ ddexApp?: string; /** * * @type {Array} * @memberof SearchTrack */ playlistsContainingTrack?: Array; /** * * @type {number} * @memberof SearchTrack */ pinnedCommentId?: number; /** * * @type {AlbumBacklink} * @memberof SearchTrack */ albumBacklink?: AlbumBacklink; /** * Describes what access the given user has * @type {Access} * @memberof SearchTrack */ access: Access; /** * The blocknumber this track was last updated * @type {number} * @memberof SearchTrack */ blocknumber: number; /** * * @type {string} * @memberof SearchTrack */ createDate?: string; /** * * @type {string} * @memberof SearchTrack */ coverArtSizes: string; /** * * @type {CoverArt} * @memberof SearchTrack */ coverArtCids?: CoverArt; /** * * @type {string} * @memberof SearchTrack */ createdAt: string; /** * * @type {string} * @memberof SearchTrack */ creditsSplits?: string; /** * * @type {string} * @memberof SearchTrack */ isrc?: string; /** * * @type {string} * @memberof SearchTrack */ license?: string; /** * * @type {string} * @memberof SearchTrack */ iswc?: string; /** * * @type {FieldVisibility} * @memberof SearchTrack */ fieldVisibility: FieldVisibility; /** * * @type {Array} * @memberof SearchTrack */ followeeReposts?: Array; /** * * @type {boolean} * @memberof SearchTrack */ hasCurrentUserReposted: boolean; /** * * @type {boolean} * @memberof SearchTrack */ isScheduledRelease: boolean; /** * * @type {boolean} * @memberof SearchTrack */ isUnlisted: boolean; /** * * @type {boolean} * @memberof SearchTrack */ hasCurrentUserSaved: boolean; /** * * @type {Array} * @memberof SearchTrack */ followeeFavorites?: Array; /** * * @type {string} * @memberof SearchTrack */ routeId: string; /** * * @type {StemParent} * @memberof SearchTrack */ stemOf?: StemParent; /** * * @type {Array} * @memberof SearchTrack */ trackSegments: Array; /** * * @type {string} * @memberof SearchTrack */ updatedAt: string; /** * * @type {string} * @memberof SearchTrack */ userId: string; /** * * @type {boolean} * @memberof SearchTrack */ isDelete: boolean; /** * * @type {string} * @memberof SearchTrack */ coverArt?: string; /** * * @type {boolean} * @memberof SearchTrack */ isAvailable: boolean; /** * * @type {number} * @memberof SearchTrack */ aiAttributionUserId?: number; /** * * @type {Array} * @memberof SearchTrack */ allowedApiKeys?: Array; /** * * @type {string} * @memberof SearchTrack */ audioUploadId?: string; /** * * @type {number} * @memberof SearchTrack */ previewStartSeconds?: number; /** * * @type {number} * @memberof SearchTrack */ bpm?: number; /** * * @type {boolean} * @memberof SearchTrack */ isCustomBpm?: boolean; /** * * @type {string} * @memberof SearchTrack */ musicalKey?: string; /** * * @type {boolean} * @memberof SearchTrack */ isCustomMusicalKey?: boolean; /** * * @type {number} * @memberof SearchTrack */ audioAnalysisErrorCount?: number; /** * * @type {boolean} * @memberof SearchTrack */ commentsDisabled?: boolean; /** * * @type {object} * @memberof SearchTrack */ ddexReleaseIds?: object; /** * * @type {Array} * @memberof SearchTrack */ artists?: Array; /** * * @type {Array} * @memberof SearchTrack */ resourceContributors?: Array | null; /** * * @type {Array} * @memberof SearchTrack */ indirectResourceContributors?: Array | null; /** * * @type {DdexRightsController} * @memberof SearchTrack */ rightsController?: DdexRightsController; /** * * @type {DdexCopyright} * @memberof SearchTrack */ copyrightLine?: DdexCopyright | null; /** * * @type {DdexCopyright} * @memberof SearchTrack */ producerCopyrightLine?: DdexCopyright | null; /** * * @type {string} * @memberof SearchTrack */ parentalWarningType?: string | null; /** * Whether or not the owner has restricted streaming behind an access gate * @type {boolean} * @memberof SearchTrack */ isStreamGated: boolean; /** * How to unlock stream access to the track * @type {AccessGate} * @memberof SearchTrack */ streamConditions?: AccessGate; /** * Whether or not the owner has restricted downloading behind an access gate * @type {boolean} * @memberof SearchTrack */ isDownloadGated: boolean; /** * How to unlock the track download * @type {AccessGate} * @memberof SearchTrack */ downloadConditions?: AccessGate; /** * * @type {string} * @memberof SearchTrack */ coverOriginalSongTitle?: string; /** * * @type {string} * @memberof SearchTrack */ coverOriginalArtist?: string; /** * Indicates whether the track is owned by the user for MRI sake * @type {boolean} * @memberof SearchTrack */ isOwnedByUser: boolean; /** * * @type {UrlWithMirrors} * @memberof SearchTrack */ stream: UrlWithMirrors; /** * * @type {UrlWithMirrors} * @memberof SearchTrack */ download: UrlWithMirrors; /** * * @type {UrlWithMirrors} * @memberof SearchTrack */ preview: UrlWithMirrors; } /** * Check if a given object implements the SearchTrack interface. */ export function instanceOfSearchTrack(value: object): value is SearchTrack { let isInstance = true; isInstance = isInstance && "artwork" in value && value["artwork"] !== undefined; isInstance = isInstance && "genre" in value && value["genre"] !== undefined; isInstance = isInstance && "id" in value && value["id"] !== undefined; isInstance = isInstance && "isOriginalAvailable" in value && value["isOriginalAvailable"] !== undefined; isInstance = isInstance && "remixOf" in value && value["remixOf"] !== undefined; isInstance = isInstance && "repostCount" in value && value["repostCount"] !== undefined; isInstance = isInstance && "favoriteCount" in value && value["favoriteCount"] !== undefined; isInstance = isInstance && "commentCount" in value && value["commentCount"] !== undefined; isInstance = isInstance && "title" in value && value["title"] !== undefined; isInstance = isInstance && "user" in value && value["user"] !== undefined; isInstance = isInstance && "duration" in value && value["duration"] !== undefined; isInstance = isInstance && "isDownloadable" in value && value["isDownloadable"] !== undefined; isInstance = isInstance && "playCount" in value && value["playCount"] !== undefined; isInstance = isInstance && "permalink" in value && value["permalink"] !== undefined; isInstance = isInstance && "access" in value && value["access"] !== undefined; isInstance = isInstance && "blocknumber" in value && value["blocknumber"] !== undefined; isInstance = isInstance && "coverArtSizes" in value && value["coverArtSizes"] !== undefined; isInstance = isInstance && "createdAt" in value && value["createdAt"] !== undefined; isInstance = isInstance && "fieldVisibility" in value && value["fieldVisibility"] !== undefined; isInstance = isInstance && "hasCurrentUserReposted" in value && value["hasCurrentUserReposted"] !== undefined; isInstance = isInstance && "isScheduledRelease" in value && value["isScheduledRelease"] !== undefined; isInstance = isInstance && "isUnlisted" in value && value["isUnlisted"] !== undefined; isInstance = isInstance && "hasCurrentUserSaved" in value && value["hasCurrentUserSaved"] !== undefined; isInstance = isInstance && "routeId" in value && value["routeId"] !== undefined; isInstance = isInstance && "trackSegments" in value && value["trackSegments"] !== undefined; isInstance = isInstance && "updatedAt" in value && value["updatedAt"] !== undefined; isInstance = isInstance && "userId" in value && value["userId"] !== undefined; isInstance = isInstance && "isDelete" in value && value["isDelete"] !== undefined; isInstance = isInstance && "isAvailable" in value && value["isAvailable"] !== undefined; isInstance = isInstance && "isStreamGated" in value && value["isStreamGated"] !== undefined; isInstance = isInstance && "isDownloadGated" in value && value["isDownloadGated"] !== undefined; isInstance = isInstance && "isOwnedByUser" in value && value["isOwnedByUser"] !== undefined; isInstance = isInstance && "stream" in value && value["stream"] !== undefined; isInstance = isInstance && "download" in value && value["download"] !== undefined; isInstance = isInstance && "preview" in value && value["preview"] !== undefined; return isInstance; } export function SearchTrackFromJSON(json: any): SearchTrack { return SearchTrackFromJSONTyped(json, false); } export function SearchTrackFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchTrack { if ((json === undefined) || (json === null)) { return json; } return { 'artwork': TrackArtworkFromJSON(json['artwork']), 'description': !exists(json, 'description') ? undefined : json['description'], 'genre': json['genre'], 'id': json['id'], 'trackCid': !exists(json, 'track_cid') ? undefined : json['track_cid'], 'previewCid': !exists(json, 'preview_cid') ? undefined : json['preview_cid'], 'origFileCid': !exists(json, 'orig_file_cid') ? undefined : json['orig_file_cid'], 'origFilename': !exists(json, 'orig_filename') ? undefined : json['orig_filename'], 'isOriginalAvailable': json['is_original_available'], 'mood': !exists(json, 'mood') ? undefined : json['mood'], 'releaseDate': !exists(json, 'release_date') ? undefined : (new Date(json['release_date'])), 'remixOf': RemixParentFromJSON(json['remix_of']), 'repostCount': json['repost_count'], 'favoriteCount': json['favorite_count'], 'commentCount': json['comment_count'], 'tags': !exists(json, 'tags') ? undefined : json['tags'], 'title': json['title'], 'user': UserFromJSON(json['user']), 'duration': json['duration'], 'isDownloadable': json['is_downloadable'], 'playCount': json['play_count'], 'permalink': json['permalink'], 'isStreamable': !exists(json, 'is_streamable') ? undefined : json['is_streamable'], 'ddexApp': !exists(json, 'ddex_app') ? undefined : json['ddex_app'], 'playlistsContainingTrack': !exists(json, 'playlists_containing_track') ? undefined : json['playlists_containing_track'], 'pinnedCommentId': !exists(json, 'pinned_comment_id') ? undefined : json['pinned_comment_id'], 'albumBacklink': !exists(json, 'album_backlink') ? undefined : AlbumBacklinkFromJSON(json['album_backlink']), 'access': AccessFromJSON(json['access']), 'blocknumber': json['blocknumber'], 'createDate': !exists(json, 'create_date') ? undefined : json['create_date'], 'coverArtSizes': json['cover_art_sizes'], 'coverArtCids': !exists(json, 'cover_art_cids') ? undefined : CoverArtFromJSON(json['cover_art_cids']), 'createdAt': json['created_at'], 'creditsSplits': !exists(json, 'credits_splits') ? undefined : json['credits_splits'], 'isrc': !exists(json, 'isrc') ? undefined : json['isrc'], 'license': !exists(json, 'license') ? undefined : json['license'], 'iswc': !exists(json, 'iswc') ? undefined : json['iswc'], 'fieldVisibility': FieldVisibilityFromJSON(json['field_visibility']), 'followeeReposts': !exists(json, 'followee_reposts') ? undefined : ((json['followee_reposts'] as Array).map(RepostFromJSON)), 'hasCurrentUserReposted': json['has_current_user_reposted'], 'isScheduledRelease': json['is_scheduled_release'], 'isUnlisted': json['is_unlisted'], 'hasCurrentUserSaved': json['has_current_user_saved'], 'followeeFavorites': !exists(json, 'followee_favorites') ? undefined : ((json['followee_favorites'] as Array).map(FavoriteFromJSON)), 'routeId': json['route_id'], 'stemOf': !exists(json, 'stem_of') ? undefined : StemParentFromJSON(json['stem_of']), 'trackSegments': ((json['track_segments'] as Array).map(TrackSegmentFromJSON)), 'updatedAt': json['updated_at'], 'userId': json['user_id'], 'isDelete': json['is_delete'], 'coverArt': !exists(json, 'cover_art') ? undefined : json['cover_art'], 'isAvailable': json['is_available'], 'aiAttributionUserId': !exists(json, 'ai_attribution_user_id') ? undefined : json['ai_attribution_user_id'], 'allowedApiKeys': !exists(json, 'allowed_api_keys') ? undefined : json['allowed_api_keys'], 'audioUploadId': !exists(json, 'audio_upload_id') ? undefined : json['audio_upload_id'], 'previewStartSeconds': !exists(json, 'preview_start_seconds') ? undefined : json['preview_start_seconds'], 'bpm': !exists(json, 'bpm') ? undefined : json['bpm'], 'isCustomBpm': !exists(json, 'is_custom_bpm') ? undefined : json['is_custom_bpm'], 'musicalKey': !exists(json, 'musical_key') ? undefined : json['musical_key'], 'isCustomMusicalKey': !exists(json, 'is_custom_musical_key') ? undefined : json['is_custom_musical_key'], 'audioAnalysisErrorCount': !exists(json, 'audio_analysis_error_count') ? undefined : json['audio_analysis_error_count'], 'commentsDisabled': !exists(json, 'comments_disabled') ? undefined : json['comments_disabled'], 'ddexReleaseIds': !exists(json, 'ddex_release_ids') ? undefined : json['ddex_release_ids'], 'artists': !exists(json, 'artists') ? undefined : json['artists'], 'resourceContributors': !exists(json, 'resource_contributors') ? undefined : (json['resource_contributors'] === null ? null : (json['resource_contributors'] as Array).map(DdexResourceContributorFromJSON)), 'indirectResourceContributors': !exists(json, 'indirect_resource_contributors') ? undefined : (json['indirect_resource_contributors'] === null ? null : (json['indirect_resource_contributors'] as Array).map(DdexResourceContributorFromJSON)), 'rightsController': !exists(json, 'rights_controller') ? undefined : DdexRightsControllerFromJSON(json['rights_controller']), 'copyrightLine': !exists(json, 'copyright_line') ? undefined : DdexCopyrightFromJSON(json['copyright_line']), 'producerCopyrightLine': !exists(json, 'producer_copyright_line') ? undefined : DdexCopyrightFromJSON(json['producer_copyright_line']), 'parentalWarningType': !exists(json, 'parental_warning_type') ? undefined : json['parental_warning_type'], 'isStreamGated': json['is_stream_gated'], 'streamConditions': !exists(json, 'stream_conditions') ? undefined : AccessGateFromJSON(json['stream_conditions']), 'isDownloadGated': json['is_download_gated'], 'downloadConditions': !exists(json, 'download_conditions') ? undefined : AccessGateFromJSON(json['download_conditions']), 'coverOriginalSongTitle': !exists(json, 'cover_original_song_title') ? undefined : json['cover_original_song_title'], 'coverOriginalArtist': !exists(json, 'cover_original_artist') ? undefined : json['cover_original_artist'], 'isOwnedByUser': json['is_owned_by_user'], 'stream': UrlWithMirrorsFromJSON(json['stream']), 'download': UrlWithMirrorsFromJSON(json['download']), 'preview': UrlWithMirrorsFromJSON(json['preview']), }; } export function SearchTrackToJSON(value?: SearchTrack | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'artwork': TrackArtworkToJSON(value.artwork), 'description': value.description, 'genre': value.genre, 'id': value.id, 'track_cid': value.trackCid, 'preview_cid': value.previewCid, 'orig_file_cid': value.origFileCid, 'orig_filename': value.origFilename, 'is_original_available': value.isOriginalAvailable, 'mood': value.mood, 'release_date': value.releaseDate === undefined ? undefined : (value.releaseDate.toISOString().substr(0,10)), 'remix_of': RemixParentToJSON(value.remixOf), 'repost_count': value.repostCount, 'favorite_count': value.favoriteCount, 'comment_count': value.commentCount, 'tags': value.tags, 'title': value.title, 'user': UserToJSON(value.user), 'duration': value.duration, 'is_downloadable': value.isDownloadable, 'play_count': value.playCount, 'permalink': value.permalink, 'is_streamable': value.isStreamable, 'ddex_app': value.ddexApp, 'playlists_containing_track': value.playlistsContainingTrack, 'pinned_comment_id': value.pinnedCommentId, 'album_backlink': AlbumBacklinkToJSON(value.albumBacklink), 'access': AccessToJSON(value.access), 'blocknumber': value.blocknumber, 'create_date': value.createDate, 'cover_art_sizes': value.coverArtSizes, 'cover_art_cids': CoverArtToJSON(value.coverArtCids), 'created_at': value.createdAt, 'credits_splits': value.creditsSplits, 'isrc': value.isrc, 'license': value.license, 'iswc': value.iswc, 'field_visibility': FieldVisibilityToJSON(value.fieldVisibility), 'followee_reposts': value.followeeReposts === undefined ? undefined : ((value.followeeReposts as Array).map(RepostToJSON)), 'has_current_user_reposted': value.hasCurrentUserReposted, 'is_scheduled_release': value.isScheduledRelease, 'is_unlisted': value.isUnlisted, 'has_current_user_saved': value.hasCurrentUserSaved, 'followee_favorites': value.followeeFavorites === undefined ? undefined : ((value.followeeFavorites as Array).map(FavoriteToJSON)), 'route_id': value.routeId, 'stem_of': StemParentToJSON(value.stemOf), 'track_segments': ((value.trackSegments as Array).map(TrackSegmentToJSON)), 'updated_at': value.updatedAt, 'user_id': value.userId, 'is_delete': value.isDelete, 'cover_art': value.coverArt, 'is_available': value.isAvailable, 'ai_attribution_user_id': value.aiAttributionUserId, 'allowed_api_keys': value.allowedApiKeys, 'audio_upload_id': value.audioUploadId, 'preview_start_seconds': value.previewStartSeconds, 'bpm': value.bpm, 'is_custom_bpm': value.isCustomBpm, 'musical_key': value.musicalKey, 'is_custom_musical_key': value.isCustomMusicalKey, 'audio_analysis_error_count': value.audioAnalysisErrorCount, 'comments_disabled': value.commentsDisabled, 'ddex_release_ids': value.ddexReleaseIds, 'artists': value.artists, 'resource_contributors': value.resourceContributors === undefined ? undefined : (value.resourceContributors === null ? null : (value.resourceContributors as Array).map(DdexResourceContributorToJSON)), 'indirect_resource_contributors': value.indirectResourceContributors === undefined ? undefined : (value.indirectResourceContributors === null ? null : (value.indirectResourceContributors as Array).map(DdexResourceContributorToJSON)), 'rights_controller': DdexRightsControllerToJSON(value.rightsController), 'copyright_line': DdexCopyrightToJSON(value.copyrightLine), 'producer_copyright_line': DdexCopyrightToJSON(value.producerCopyrightLine), 'parental_warning_type': value.parentalWarningType, 'is_stream_gated': value.isStreamGated, 'stream_conditions': AccessGateToJSON(value.streamConditions), 'is_download_gated': value.isDownloadGated, 'download_conditions': AccessGateToJSON(value.downloadConditions), 'cover_original_song_title': value.coverOriginalSongTitle, 'cover_original_artist': value.coverOriginalArtist, 'is_owned_by_user': value.isOwnedByUser, 'stream': UrlWithMirrorsToJSON(value.stream), 'download': UrlWithMirrorsToJSON(value.download), 'preview': UrlWithMirrorsToJSON(value.preview), }; }