/* 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 { Genre } from './Genre'; import { GenreFromJSON, GenreFromJSONTyped, GenreToJSON, } from './Genre'; import type { Mood } from './Mood'; import { MoodFromJSON, MoodFromJSONTyped, MoodToJSON, } from './Mood'; import type { PlaylistAddedTimestamp } from './PlaylistAddedTimestamp'; import { PlaylistAddedTimestampFromJSON, PlaylistAddedTimestampFromJSONTyped, PlaylistAddedTimestampToJSON, } from './PlaylistAddedTimestamp'; /** * * @export * @interface CreatePlaylistRequestBody */ export interface CreatePlaylistRequestBody { /** * Optional playlist ID (will be generated if not provided) * @type {string} * @memberof CreatePlaylistRequestBody */ playlistId?: string; /** * Playlist or album name * @type {string} * @memberof CreatePlaylistRequestBody */ playlistName: string; /** * Playlist description * @type {string} * @memberof CreatePlaylistRequestBody */ description?: string; /** * Whether the playlist is private * @type {boolean} * @memberof CreatePlaylistRequestBody */ isPrivate?: boolean; /** * Whether this is an album * @type {boolean} * @memberof CreatePlaylistRequestBody */ isAlbum?: boolean; /** * * @type {Genre} * @memberof CreatePlaylistRequestBody */ genre?: Genre; /** * * @type {Mood} * @memberof CreatePlaylistRequestBody */ mood?: Mood; /** * Comma-separated tags * @type {string} * @memberof CreatePlaylistRequestBody */ tags?: string; /** * License type * @type {string} * @memberof CreatePlaylistRequestBody */ license?: string; /** * Universal Product Code (for albums) * @type {string} * @memberof CreatePlaylistRequestBody */ upc?: string; /** * Release date * @type {Date} * @memberof CreatePlaylistRequestBody */ releaseDate?: Date; /** * CID for the playlist cover art * @type {string} * @memberof CreatePlaylistRequestBody */ playlistImageSizesMultihash?: string; /** * Array of tracks in the playlist * @type {Array} * @memberof CreatePlaylistRequestBody */ playlistContents?: Array; /** * Whether streaming is restricted behind an access gate * @type {boolean} * @memberof CreatePlaylistRequestBody */ isStreamGated?: boolean | null; /** * Whether the playlist/album is a scheduled release * @type {boolean} * @memberof CreatePlaylistRequestBody */ isScheduledRelease?: boolean | null; /** * * @type {AccessGate} * @memberof CreatePlaylistRequestBody */ streamConditions?: AccessGate | null; /** * DDEX application identifier * @type {string} * @memberof CreatePlaylistRequestBody */ ddexApp?: string; /** * DDEX release identifiers * @type {{ [key: string]: string; }} * @memberof CreatePlaylistRequestBody */ ddexReleaseIds?: { [key: string]: string; } | null; /** * DDEX resource contributors / artists * @type {Array} * @memberof CreatePlaylistRequestBody */ artists?: Array | null; /** * * @type {CreatePlaylistRequestBodyCopyrightLine} * @memberof CreatePlaylistRequestBody */ copyrightLine?: CreatePlaylistRequestBodyCopyrightLine | null; /** * * @type {CreatePlaylistRequestBodyProducerCopyrightLine} * @memberof CreatePlaylistRequestBody */ producerCopyrightLine?: CreatePlaylistRequestBodyProducerCopyrightLine | null; /** * Parental warning type * @type {string} * @memberof CreatePlaylistRequestBody */ parentalWarningType?: string | null; /** * Whether the image is autogenerated * @type {boolean} * @memberof CreatePlaylistRequestBody */ isImageAutogenerated?: boolean | null; } /** * Check if a given object implements the CreatePlaylistRequestBody interface. */ export function instanceOfCreatePlaylistRequestBody(value: object): value is CreatePlaylistRequestBody { let isInstance = true; isInstance = isInstance && "playlistName" in value && value["playlistName"] !== undefined; return isInstance; } export function CreatePlaylistRequestBodyFromJSON(json: any): CreatePlaylistRequestBody { return CreatePlaylistRequestBodyFromJSONTyped(json, false); } export function CreatePlaylistRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreatePlaylistRequestBody { if ((json === undefined) || (json === null)) { return json; } return { 'playlistId': !exists(json, 'playlist_id') ? undefined : json['playlist_id'], 'playlistName': json['playlist_name'], 'description': !exists(json, 'description') ? undefined : json['description'], 'isPrivate': !exists(json, 'is_private') ? undefined : json['is_private'], 'isAlbum': !exists(json, 'is_album') ? undefined : json['is_album'], 'genre': !exists(json, 'genre') ? undefined : GenreFromJSON(json['genre']), 'mood': !exists(json, 'mood') ? undefined : MoodFromJSON(json['mood']), 'tags': !exists(json, 'tags') ? undefined : json['tags'], 'license': !exists(json, 'license') ? undefined : json['license'], 'upc': !exists(json, 'upc') ? undefined : json['upc'], 'releaseDate': !exists(json, 'release_date') ? undefined : (new Date(json['release_date'])), 'playlistImageSizesMultihash': !exists(json, 'playlist_image_sizes_multihash') ? undefined : json['playlist_image_sizes_multihash'], 'playlistContents': !exists(json, 'playlist_contents') ? undefined : ((json['playlist_contents'] as Array).map(PlaylistAddedTimestampFromJSON)), 'isStreamGated': !exists(json, 'is_stream_gated') ? undefined : json['is_stream_gated'], 'isScheduledRelease': !exists(json, 'is_scheduled_release') ? undefined : json['is_scheduled_release'], 'streamConditions': !exists(json, 'stream_conditions') ? undefined : AccessGateFromJSON(json['stream_conditions']), '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'] === null ? null : (json['artists'] as Array).map(DdexResourceContributorFromJSON)), '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'], 'isImageAutogenerated': !exists(json, 'is_image_autogenerated') ? undefined : json['is_image_autogenerated'], }; } export function CreatePlaylistRequestBodyToJSON(value?: CreatePlaylistRequestBody | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'playlist_id': value.playlistId, 'playlist_name': value.playlistName, 'description': value.description, 'is_private': value.isPrivate, 'is_album': value.isAlbum, 'genre': GenreToJSON(value.genre), 'mood': MoodToJSON(value.mood), 'tags': value.tags, 'license': value.license, 'upc': value.upc, 'release_date': value.releaseDate === undefined ? undefined : (value.releaseDate.toISOString().substr(0,10)), 'playlist_image_sizes_multihash': value.playlistImageSizesMultihash, 'playlist_contents': value.playlistContents === undefined ? undefined : ((value.playlistContents as Array).map(PlaylistAddedTimestampToJSON)), 'is_stream_gated': value.isStreamGated, 'is_scheduled_release': value.isScheduledRelease, 'stream_conditions': AccessGateToJSON(value.streamConditions), 'ddex_app': value.ddexApp, 'ddex_release_ids': value.ddexReleaseIds, 'artists': value.artists === undefined ? undefined : (value.artists === null ? null : (value.artists as Array).map(DdexResourceContributorToJSON)), 'copyright_line': CreatePlaylistRequestBodyCopyrightLineToJSON(value.copyrightLine), 'producer_copyright_line': CreatePlaylistRequestBodyProducerCopyrightLineToJSON(value.producerCopyrightLine), 'parental_warning_type': value.parentalWarningType, 'is_image_autogenerated': value.isImageAutogenerated, }; }