/* 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 { AccessGate } from './AccessGate'; import { AccessGateFromJSON, AccessGateFromJSONTyped, AccessGateToJSON, } from './AccessGate'; import type { FieldVisibility } from './FieldVisibility'; import { FieldVisibilityFromJSON, FieldVisibilityFromJSONTyped, FieldVisibilityToJSON, } from './FieldVisibility'; import type { Genre } from './Genre'; import { GenreFromJSON, GenreFromJSONTyped, GenreToJSON, } from './Genre'; import type { Mood } from './Mood'; import { MoodFromJSON, MoodFromJSONTyped, MoodToJSON, } from './Mood'; import type { RemixParentWrite } from './RemixParentWrite'; import { RemixParentWriteFromJSON, RemixParentWriteFromJSONTyped, RemixParentWriteToJSON, } from './RemixParentWrite'; import type { StemParent } from './StemParent'; import { StemParentFromJSON, StemParentFromJSONTyped, StemParentToJSON, } from './StemParent'; /** * Request body for updating track information. All fields are optional. * @export * @interface UpdateTrackRequestBody */ export interface UpdateTrackRequestBody { /** * Track title * @type {string} * @memberof UpdateTrackRequestBody */ title?: string; /** * * @type {Genre} * @memberof UpdateTrackRequestBody */ genre?: Genre; /** * Track description * @type {string} * @memberof UpdateTrackRequestBody */ description?: string | null; /** * * @type {Mood} * @memberof UpdateTrackRequestBody */ mood?: Mood | null; /** * Beats per minute (tempo) * @type {number} * @memberof UpdateTrackRequestBody */ bpm?: number | null; /** * Musical key of the track * @type {string} * @memberof UpdateTrackRequestBody */ musicalKey?: string | null; /** * Comma-separated tags * @type {string} * @memberof UpdateTrackRequestBody */ tags?: string | null; /** * License type * @type {string} * @memberof UpdateTrackRequestBody */ license?: string | null; /** * International Standard Recording Code * @type {string} * @memberof UpdateTrackRequestBody */ isrc?: string | null; /** * International Standard Musical Work Code * @type {string} * @memberof UpdateTrackRequestBody */ iswc?: string | null; /** * Release date * @type {Date} * @memberof UpdateTrackRequestBody */ releaseDate?: Date; /** * CID for the track audio file * @type {string} * @memberof UpdateTrackRequestBody */ trackCid?: string; /** * CID for the original track file * @type {string} * @memberof UpdateTrackRequestBody */ origFileCid?: string; /** * Original filename of the track * @type {string} * @memberof UpdateTrackRequestBody */ origFilename?: string; /** * CID for the track cover art * @type {string} * @memberof UpdateTrackRequestBody */ coverArtSizes?: string; /** * CID for the track preview * @type {string} * @memberof UpdateTrackRequestBody */ previewCid?: string; /** * Preview start time in seconds * @type {number} * @memberof UpdateTrackRequestBody */ previewStartSeconds?: number; /** * Track duration in seconds * @type {number} * @memberof UpdateTrackRequestBody */ duration?: number; /** * Whether the track is downloadable * @type {boolean} * @memberof UpdateTrackRequestBody */ isDownloadable?: boolean; /** * Whether the track is unlisted * @type {boolean} * @memberof UpdateTrackRequestBody */ isUnlisted?: boolean; /** * Whether streaming is restricted behind an access gate * @type {boolean} * @memberof UpdateTrackRequestBody */ isStreamGated?: boolean; /** * Wallet addresses that can sign to authorize stream access (programmable distribution). When empty or omitted, the track is public and validator/creator nodes can serve it. * @type {Array} * @memberof UpdateTrackRequestBody */ accessAuthorities?: Array | null; /** * * @type {AccessGate} * @memberof UpdateTrackRequestBody */ streamConditions?: AccessGate | null; /** * * @type {AccessGate} * @memberof UpdateTrackRequestBody */ downloadConditions?: AccessGate | null; /** * * @type {FieldVisibility} * @memberof UpdateTrackRequestBody */ fieldVisibility?: FieldVisibility; /** * Placement hosts for the track * @type {string} * @memberof UpdateTrackRequestBody */ placementHosts?: string; /** * * @type {StemParent} * @memberof UpdateTrackRequestBody */ stemOf?: StemParent; /** * * @type {RemixParentWrite} * @memberof UpdateTrackRequestBody */ remixOf?: RemixParentWrite; /** * DDEX application identifier * @type {string} * @memberof UpdateTrackRequestBody */ ddexApp?: string | null; /** * Parental warning type * @type {string} * @memberof UpdateTrackRequestBody */ parentalWarningType?: string | null; } /** * Check if a given object implements the UpdateTrackRequestBody interface. */ export function instanceOfUpdateTrackRequestBody(value: object): value is UpdateTrackRequestBody { let isInstance = true; return isInstance; } export function UpdateTrackRequestBodyFromJSON(json: any): UpdateTrackRequestBody { return UpdateTrackRequestBodyFromJSONTyped(json, false); } export function UpdateTrackRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateTrackRequestBody { if ((json === undefined) || (json === null)) { return json; } return { 'title': !exists(json, 'title') ? undefined : json['title'], 'genre': !exists(json, 'genre') ? undefined : GenreFromJSON(json['genre']), 'description': !exists(json, 'description') ? undefined : json['description'], 'mood': !exists(json, 'mood') ? undefined : MoodFromJSON(json['mood']), 'bpm': !exists(json, 'bpm') ? undefined : json['bpm'], 'musicalKey': !exists(json, 'musical_key') ? undefined : json['musical_key'], 'tags': !exists(json, 'tags') ? undefined : json['tags'], 'license': !exists(json, 'license') ? undefined : json['license'], 'isrc': !exists(json, 'isrc') ? undefined : json['isrc'], 'iswc': !exists(json, 'iswc') ? undefined : json['iswc'], 'releaseDate': !exists(json, 'release_date') ? undefined : (new Date(json['release_date'])), 'trackCid': !exists(json, 'track_cid') ? undefined : json['track_cid'], 'origFileCid': !exists(json, 'orig_file_cid') ? undefined : json['orig_file_cid'], 'origFilename': !exists(json, 'orig_filename') ? undefined : json['orig_filename'], 'coverArtSizes': !exists(json, 'cover_art_sizes') ? undefined : json['cover_art_sizes'], 'previewCid': !exists(json, 'preview_cid') ? undefined : json['preview_cid'], 'previewStartSeconds': !exists(json, 'preview_start_seconds') ? undefined : json['preview_start_seconds'], 'duration': !exists(json, 'duration') ? undefined : json['duration'], 'isDownloadable': !exists(json, 'is_downloadable') ? undefined : json['is_downloadable'], 'isUnlisted': !exists(json, 'is_unlisted') ? undefined : json['is_unlisted'], 'isStreamGated': !exists(json, 'is_stream_gated') ? undefined : json['is_stream_gated'], 'accessAuthorities': !exists(json, 'access_authorities') ? undefined : json['access_authorities'], 'streamConditions': !exists(json, 'stream_conditions') ? undefined : AccessGateFromJSON(json['stream_conditions']), 'downloadConditions': !exists(json, 'download_conditions') ? undefined : AccessGateFromJSON(json['download_conditions']), 'fieldVisibility': !exists(json, 'field_visibility') ? undefined : FieldVisibilityFromJSON(json['field_visibility']), 'placementHosts': !exists(json, 'placement_hosts') ? undefined : json['placement_hosts'], 'stemOf': !exists(json, 'stem_of') ? undefined : StemParentFromJSON(json['stem_of']), 'remixOf': !exists(json, 'remix_of') ? undefined : RemixParentWriteFromJSON(json['remix_of']), 'ddexApp': !exists(json, 'ddex_app') ? undefined : json['ddex_app'], 'parentalWarningType': !exists(json, 'parental_warning_type') ? undefined : json['parental_warning_type'], }; } export function UpdateTrackRequestBodyToJSON(value?: UpdateTrackRequestBody | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'title': value.title, 'genre': GenreToJSON(value.genre), 'description': value.description, 'mood': MoodToJSON(value.mood), 'bpm': value.bpm, 'musical_key': value.musicalKey, 'tags': value.tags, 'license': value.license, 'isrc': value.isrc, 'iswc': value.iswc, 'release_date': value.releaseDate === undefined ? undefined : (value.releaseDate.toISOString().substr(0,10)), 'track_cid': value.trackCid, 'orig_file_cid': value.origFileCid, 'orig_filename': value.origFilename, 'cover_art_sizes': value.coverArtSizes, 'preview_cid': value.previewCid, 'preview_start_seconds': value.previewStartSeconds, 'duration': value.duration, 'is_downloadable': value.isDownloadable, 'is_unlisted': value.isUnlisted, 'is_stream_gated': value.isStreamGated, 'access_authorities': value.accessAuthorities, 'stream_conditions': AccessGateToJSON(value.streamConditions), 'download_conditions': AccessGateToJSON(value.downloadConditions), 'field_visibility': FieldVisibilityToJSON(value.fieldVisibility), 'placement_hosts': value.placementHosts, 'stem_of': StemParentToJSON(value.stemOf), 'remix_of': RemixParentWriteToJSON(value.remixOf), 'ddex_app': value.ddexApp, 'parental_warning_type': value.parentalWarningType, }; }