/* 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 { CreatePlaylistRequestBodyCopyrightLine } from './CreatePlaylistRequestBodyCopyrightLine'; import { CreatePlaylistRequestBodyCopyrightLineFromJSON, CreatePlaylistRequestBodyCopyrightLineFromJSONTyped, CreatePlaylistRequestBodyCopyrightLineToJSON, } from './CreatePlaylistRequestBodyCopyrightLine'; import type { CreatePlaylistRequestBodyProducerCopyrightLine } from './CreatePlaylistRequestBodyProducerCopyrightLine'; import { CreatePlaylistRequestBodyProducerCopyrightLineFromJSON, CreatePlaylistRequestBodyProducerCopyrightLineFromJSONTyped, CreatePlaylistRequestBodyProducerCopyrightLineToJSON, } from './CreatePlaylistRequestBodyProducerCopyrightLine'; import type { DdexResourceContributor } from './DdexResourceContributor'; import { DdexResourceContributorFromJSON, DdexResourceContributorFromJSONTyped, DdexResourceContributorToJSON, } from './DdexResourceContributor'; import type { DdexRightsController } from './DdexRightsController'; import { DdexRightsControllerFromJSON, DdexRightsControllerFromJSONTyped, DdexRightsControllerToJSON, } from './DdexRightsController'; 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'; /** * * @export * @interface CreateTrackRequestBody */ export interface CreateTrackRequestBody { /** * Optional track ID (will be generated if not provided) * @type {string} * @memberof CreateTrackRequestBody */ trackId?: string; /** * Track title * @type {string} * @memberof CreateTrackRequestBody */ title: string; /** * * @type {Genre} * @memberof CreateTrackRequestBody */ genre: Genre; /** * Track description * @type {string} * @memberof CreateTrackRequestBody */ description?: string | null; /** * * @type {Mood} * @memberof CreateTrackRequestBody */ mood?: Mood | null; /** * Beats per minute (tempo) * @type {number} * @memberof CreateTrackRequestBody */ bpm?: number | null; /** * Musical key of the track * @type {string} * @memberof CreateTrackRequestBody */ musicalKey?: string | null; /** * Comma-separated tags * @type {string} * @memberof CreateTrackRequestBody */ tags?: string | null; /** * License type * @type {string} * @memberof CreateTrackRequestBody */ license?: string | null; /** * International Standard Recording Code * @type {string} * @memberof CreateTrackRequestBody */ isrc?: string | null; /** * International Standard Musical Work Code * @type {string} * @memberof CreateTrackRequestBody */ iswc?: string | null; /** * Release date * @type {Date} * @memberof CreateTrackRequestBody */ releaseDate?: Date; /** * CID for the track audio file (required) * @type {string} * @memberof CreateTrackRequestBody */ trackCid: string; /** * CID for the original track file * @type {string} * @memberof CreateTrackRequestBody */ origFileCid?: string; /** * Original filename of the track * @type {string} * @memberof CreateTrackRequestBody */ origFilename?: string; /** * CID for the track cover art * @type {string} * @memberof CreateTrackRequestBody */ coverArtSizes?: string; /** * CID for the track preview * @type {string} * @memberof CreateTrackRequestBody */ previewCid?: string; /** * Preview start time in seconds * @type {number} * @memberof CreateTrackRequestBody */ previewStartSeconds?: number; /** * Track duration in seconds * @type {number} * @memberof CreateTrackRequestBody */ duration?: number; /** * Whether the track is downloadable * @type {boolean} * @memberof CreateTrackRequestBody */ isDownloadable?: boolean; /** * Whether the track is unlisted * @type {boolean} * @memberof CreateTrackRequestBody */ isUnlisted?: boolean; /** * Whether streaming is restricted behind an access gate * @type {boolean} * @memberof CreateTrackRequestBody */ isStreamGated?: boolean | null; /** * 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 CreateTrackRequestBody */ accessAuthorities?: Array | null; /** * * @type {AccessGate} * @memberof CreateTrackRequestBody */ streamConditions?: AccessGate | null; /** * * @type {AccessGate} * @memberof CreateTrackRequestBody */ downloadConditions?: AccessGate | null; /** * * @type {FieldVisibility} * @memberof CreateTrackRequestBody */ fieldVisibility?: FieldVisibility; /** * Placement hosts for the track * @type {string} * @memberof CreateTrackRequestBody */ placementHosts?: string; /** * * @type {StemParent} * @memberof CreateTrackRequestBody */ stemOf?: StemParent; /** * * @type {RemixParentWrite} * @memberof CreateTrackRequestBody */ remixOf?: RemixParentWrite; /** * DDEX application identifier * @type {string} * @memberof CreateTrackRequestBody */ ddexApp?: string | null; /** * DDEX release identifiers * @type {object} * @memberof CreateTrackRequestBody */ ddexReleaseIds?: object | null; /** * DDEX resource contributors / artists * @type {Array} * @memberof CreateTrackRequestBody */ artists?: Array | null; /** * DDEX resource contributors * @type {Array} * @memberof CreateTrackRequestBody */ resourceContributors?: Array | null; /** * DDEX indirect resource contributors * @type {Array} * @memberof CreateTrackRequestBody */ indirectResourceContributors?: Array | null; /** * * @type {DdexRightsController} * @memberof CreateTrackRequestBody */ rightsController?: DdexRightsController; /** * * @type {CreatePlaylistRequestBodyCopyrightLine} * @memberof CreateTrackRequestBody */ copyrightLine?: CreatePlaylistRequestBodyCopyrightLine | null; /** * * @type {CreatePlaylistRequestBodyProducerCopyrightLine} * @memberof CreateTrackRequestBody */ producerCopyrightLine?: CreatePlaylistRequestBodyProducerCopyrightLine | null; /** * Parental warning type * @type {string} * @memberof CreateTrackRequestBody */ parentalWarningType?: string | null; /** * Original song title for cover tracks * @type {string} * @memberof CreateTrackRequestBody */ coverOriginalSongTitle?: string | null; /** * Original artist for cover tracks * @type {string} * @memberof CreateTrackRequestBody */ coverOriginalArtist?: string | null; /** * Whether the track is owned by the user * @type {boolean} * @memberof CreateTrackRequestBody */ isOwnedByUser?: boolean; /** * Territory codes for distribution * @type {Array} * @memberof CreateTrackRequestBody */ territoryCodes?: Array | null; /** * Whether AI use is prohibited * @type {boolean} * @memberof CreateTrackRequestBody */ noAiUse?: boolean; } /** * Check if a given object implements the CreateTrackRequestBody interface. */ export function instanceOfCreateTrackRequestBody(value: object): value is CreateTrackRequestBody { let isInstance = true; isInstance = isInstance && "title" in value && value["title"] !== undefined; isInstance = isInstance && "genre" in value && value["genre"] !== undefined; isInstance = isInstance && "trackCid" in value && value["trackCid"] !== undefined; return isInstance; } export function CreateTrackRequestBodyFromJSON(json: any): CreateTrackRequestBody { return CreateTrackRequestBodyFromJSONTyped(json, false); } export function CreateTrackRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTrackRequestBody { if ((json === undefined) || (json === null)) { return json; } return { 'trackId': !exists(json, 'track_id') ? undefined : json['track_id'], 'title': json['title'], 'genre': 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': 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'], '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 : CreatePlaylistRequestBodyCopyrightLineFromJSON(json['copyright_line']), 'producerCopyrightLine': !exists(json, 'producer_copyright_line') ? undefined : CreatePlaylistRequestBodyProducerCopyrightLineFromJSON(json['producer_copyright_line']), 'parentalWarningType': !exists(json, 'parental_warning_type') ? undefined : json['parental_warning_type'], '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': !exists(json, 'is_owned_by_user') ? undefined : json['is_owned_by_user'], 'territoryCodes': !exists(json, 'territory_codes') ? undefined : json['territory_codes'], 'noAiUse': !exists(json, 'no_ai_use') ? undefined : json['no_ai_use'], }; } export function CreateTrackRequestBodyToJSON(value?: CreateTrackRequestBody | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'track_id': value.trackId, '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, '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': CreatePlaylistRequestBodyCopyrightLineToJSON(value.copyrightLine), 'producer_copyright_line': CreatePlaylistRequestBodyProducerCopyrightLineToJSON(value.producerCopyrightLine), 'parental_warning_type': value.parentalWarningType, 'cover_original_song_title': value.coverOriginalSongTitle, 'cover_original_artist': value.coverOriginalArtist, 'is_owned_by_user': value.isOwnedByUser, 'territory_codes': value.territoryCodes, 'no_ai_use': value.noAiUse, }; }