/* 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 { ExtendedAccessGate } from './ExtendedAccessGate'; import { ExtendedAccessGateFromJSON, ExtendedAccessGateFromJSONTyped, ExtendedAccessGateToJSON, } from './ExtendedAccessGate'; /** * * @export * @interface TrackAccessInfo */ export interface TrackAccessInfo { /** * Describes what access the given user has * @type {Access} * @memberof TrackAccessInfo */ access?: Access; /** * The user ID of the owner of this track * @type {string} * @memberof TrackAccessInfo */ userId: string; /** * The blocknumber this track was last updated * @type {number} * @memberof TrackAccessInfo */ blocknumber: number; /** * Whether or not the owner has restricted streaming behind an access gate * @type {boolean} * @memberof TrackAccessInfo */ isStreamGated?: boolean; /** * How to unlock stream access to the track * @type {ExtendedAccessGate} * @memberof TrackAccessInfo */ streamConditions?: ExtendedAccessGate; /** * Whether or not the owner has restricted downloading behind an access gate * @type {boolean} * @memberof TrackAccessInfo */ isDownloadGated?: boolean; /** * How to unlock the track download * @type {ExtendedAccessGate} * @memberof TrackAccessInfo */ downloadConditions?: ExtendedAccessGate; } /** * Check if a given object implements the TrackAccessInfo interface. */ export function instanceOfTrackAccessInfo(value: object): value is TrackAccessInfo { let isInstance = true; isInstance = isInstance && "userId" in value && value["userId"] !== undefined; isInstance = isInstance && "blocknumber" in value && value["blocknumber"] !== undefined; return isInstance; } export function TrackAccessInfoFromJSON(json: any): TrackAccessInfo { return TrackAccessInfoFromJSONTyped(json, false); } export function TrackAccessInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrackAccessInfo { if ((json === undefined) || (json === null)) { return json; } return { 'access': !exists(json, 'access') ? undefined : AccessFromJSON(json['access']), 'userId': json['user_id'], 'blocknumber': json['blocknumber'], 'isStreamGated': !exists(json, 'is_stream_gated') ? undefined : json['is_stream_gated'], 'streamConditions': !exists(json, 'stream_conditions') ? undefined : ExtendedAccessGateFromJSON(json['stream_conditions']), 'isDownloadGated': !exists(json, 'is_download_gated') ? undefined : json['is_download_gated'], 'downloadConditions': !exists(json, 'download_conditions') ? undefined : ExtendedAccessGateFromJSON(json['download_conditions']), }; } export function TrackAccessInfoToJSON(value?: TrackAccessInfo | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'access': AccessToJSON(value.access), 'user_id': value.userId, 'blocknumber': value.blocknumber, 'is_stream_gated': value.isStreamGated, 'stream_conditions': ExtendedAccessGateToJSON(value.streamConditions), 'is_download_gated': value.isDownloadGated, 'download_conditions': ExtendedAccessGateToJSON(value.downloadConditions), }; }