/* 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 { AnnouncementNotification, instanceOfAnnouncementNotification, AnnouncementNotificationFromJSON, AnnouncementNotificationFromJSONTyped, AnnouncementNotificationToJSON, } from './AnnouncementNotification'; import { ApproveManagerRequestNotification, instanceOfApproveManagerRequestNotification, ApproveManagerRequestNotificationFromJSON, ApproveManagerRequestNotificationFromJSONTyped, ApproveManagerRequestNotificationToJSON, } from './ApproveManagerRequestNotification'; import { ArtistRemixContestEndedNotification, instanceOfArtistRemixContestEndedNotification, ArtistRemixContestEndedNotificationFromJSON, ArtistRemixContestEndedNotificationFromJSONTyped, ArtistRemixContestEndedNotificationToJSON, } from './ArtistRemixContestEndedNotification'; import { ArtistRemixContestEndingSoonNotification, instanceOfArtistRemixContestEndingSoonNotification, ArtistRemixContestEndingSoonNotificationFromJSON, ArtistRemixContestEndingSoonNotificationFromJSONTyped, ArtistRemixContestEndingSoonNotificationToJSON, } from './ArtistRemixContestEndingSoonNotification'; import { ArtistRemixContestSubmissionsNotification, instanceOfArtistRemixContestSubmissionsNotification, ArtistRemixContestSubmissionsNotificationFromJSON, ArtistRemixContestSubmissionsNotificationFromJSONTyped, ArtistRemixContestSubmissionsNotificationToJSON, } from './ArtistRemixContestSubmissionsNotification'; import { ChallengeRewardNotification, instanceOfChallengeRewardNotification, ChallengeRewardNotificationFromJSON, ChallengeRewardNotificationFromJSONTyped, ChallengeRewardNotificationToJSON, } from './ChallengeRewardNotification'; import { ClaimableRewardNotification, instanceOfClaimableRewardNotification, ClaimableRewardNotificationFromJSON, ClaimableRewardNotificationFromJSONTyped, ClaimableRewardNotificationToJSON, } from './ClaimableRewardNotification'; import { CommentMentionNotification, instanceOfCommentMentionNotification, CommentMentionNotificationFromJSON, CommentMentionNotificationFromJSONTyped, CommentMentionNotificationToJSON, } from './CommentMentionNotification'; import { CommentNotification, instanceOfCommentNotification, CommentNotificationFromJSON, CommentNotificationFromJSONTyped, CommentNotificationToJSON, } from './CommentNotification'; import { CommentReactionNotification, instanceOfCommentReactionNotification, CommentReactionNotificationFromJSON, CommentReactionNotificationFromJSONTyped, CommentReactionNotificationToJSON, } from './CommentReactionNotification'; import { CommentThreadNotification, instanceOfCommentThreadNotification, CommentThreadNotificationFromJSON, CommentThreadNotificationFromJSONTyped, CommentThreadNotificationToJSON, } from './CommentThreadNotification'; import { CosignNotification, instanceOfCosignNotification, CosignNotificationFromJSON, CosignNotificationFromJSONTyped, CosignNotificationToJSON, } from './CosignNotification'; import { CreateNotification, instanceOfCreateNotification, CreateNotificationFromJSON, CreateNotificationFromJSONTyped, CreateNotificationToJSON, } from './CreateNotification'; import { FanRemixContestEndedNotification, instanceOfFanRemixContestEndedNotification, FanRemixContestEndedNotificationFromJSON, FanRemixContestEndedNotificationFromJSONTyped, FanRemixContestEndedNotificationToJSON, } from './FanRemixContestEndedNotification'; import { FanRemixContestEndingSoonNotification, instanceOfFanRemixContestEndingSoonNotification, FanRemixContestEndingSoonNotificationFromJSON, FanRemixContestEndingSoonNotificationFromJSONTyped, FanRemixContestEndingSoonNotificationToJSON, } from './FanRemixContestEndingSoonNotification'; import { FanRemixContestStartedNotification, instanceOfFanRemixContestStartedNotification, FanRemixContestStartedNotificationFromJSON, FanRemixContestStartedNotificationFromJSONTyped, FanRemixContestStartedNotificationToJSON, } from './FanRemixContestStartedNotification'; import { FanRemixContestWinnersSelectedNotification, instanceOfFanRemixContestWinnersSelectedNotification, FanRemixContestWinnersSelectedNotificationFromJSON, FanRemixContestWinnersSelectedNotificationFromJSONTyped, FanRemixContestWinnersSelectedNotificationToJSON, } from './FanRemixContestWinnersSelectedNotification'; import { FollowNotification, instanceOfFollowNotification, FollowNotificationFromJSON, FollowNotificationFromJSONTyped, FollowNotificationToJSON, } from './FollowNotification'; import { ListenStreakReminderNotification, instanceOfListenStreakReminderNotification, ListenStreakReminderNotificationFromJSON, ListenStreakReminderNotificationFromJSONTyped, ListenStreakReminderNotificationToJSON, } from './ListenStreakReminderNotification'; import { MilestoneNotification, instanceOfMilestoneNotification, MilestoneNotificationFromJSON, MilestoneNotificationFromJSONTyped, MilestoneNotificationToJSON, } from './MilestoneNotification'; import { ReactionNotification, instanceOfReactionNotification, ReactionNotificationFromJSON, ReactionNotificationFromJSONTyped, ReactionNotificationToJSON, } from './ReactionNotification'; import { ReceiveTipNotification, instanceOfReceiveTipNotification, ReceiveTipNotificationFromJSON, ReceiveTipNotificationFromJSONTyped, ReceiveTipNotificationToJSON, } from './ReceiveTipNotification'; import { RemixNotification, instanceOfRemixNotification, RemixNotificationFromJSON, RemixNotificationFromJSONTyped, RemixNotificationToJSON, } from './RemixNotification'; import { RepostNotification, instanceOfRepostNotification, RepostNotificationFromJSON, RepostNotificationFromJSONTyped, RepostNotificationToJSON, } from './RepostNotification'; import { RepostOfRepostNotification, instanceOfRepostOfRepostNotification, RepostOfRepostNotificationFromJSON, RepostOfRepostNotificationFromJSONTyped, RepostOfRepostNotificationToJSON, } from './RepostOfRepostNotification'; import { RequestManagerNotification, instanceOfRequestManagerNotification, RequestManagerNotificationFromJSON, RequestManagerNotificationFromJSONTyped, RequestManagerNotificationToJSON, } from './RequestManagerNotification'; import { SaveNotification, instanceOfSaveNotification, SaveNotificationFromJSON, SaveNotificationFromJSONTyped, SaveNotificationToJSON, } from './SaveNotification'; import { SaveOfRepostNotification, instanceOfSaveOfRepostNotification, SaveOfRepostNotificationFromJSON, SaveOfRepostNotificationFromJSONTyped, SaveOfRepostNotificationToJSON, } from './SaveOfRepostNotification'; import { SendTipNotification, instanceOfSendTipNotification, SendTipNotificationFromJSON, SendTipNotificationFromJSONTyped, SendTipNotificationToJSON, } from './SendTipNotification'; import { SupporterDethronedNotification, instanceOfSupporterDethronedNotification, SupporterDethronedNotificationFromJSON, SupporterDethronedNotificationFromJSONTyped, SupporterDethronedNotificationToJSON, } from './SupporterDethronedNotification'; import { SupporterRankUpNotification, instanceOfSupporterRankUpNotification, SupporterRankUpNotificationFromJSON, SupporterRankUpNotificationFromJSONTyped, SupporterRankUpNotificationToJSON, } from './SupporterRankUpNotification'; import { TastemakerNotification, instanceOfTastemakerNotification, TastemakerNotificationFromJSON, TastemakerNotificationFromJSONTyped, TastemakerNotificationToJSON, } from './TastemakerNotification'; import { TierChangeNotification, instanceOfTierChangeNotification, TierChangeNotificationFromJSON, TierChangeNotificationFromJSONTyped, TierChangeNotificationToJSON, } from './TierChangeNotification'; import { TrackAddedToPlaylistNotification, instanceOfTrackAddedToPlaylistNotification, TrackAddedToPlaylistNotificationFromJSON, TrackAddedToPlaylistNotificationFromJSONTyped, TrackAddedToPlaylistNotificationToJSON, } from './TrackAddedToPlaylistNotification'; import { TrackAddedToPurchasedAlbumNotification, instanceOfTrackAddedToPurchasedAlbumNotification, TrackAddedToPurchasedAlbumNotificationFromJSON, TrackAddedToPurchasedAlbumNotificationFromJSONTyped, TrackAddedToPurchasedAlbumNotificationToJSON, } from './TrackAddedToPurchasedAlbumNotification'; import { TrendingNotification, instanceOfTrendingNotification, TrendingNotificationFromJSON, TrendingNotificationFromJSONTyped, TrendingNotificationToJSON, } from './TrendingNotification'; import { TrendingPlaylistNotification, instanceOfTrendingPlaylistNotification, TrendingPlaylistNotificationFromJSON, TrendingPlaylistNotificationFromJSONTyped, TrendingPlaylistNotificationToJSON, } from './TrendingPlaylistNotification'; import { TrendingUndergroundNotification, instanceOfTrendingUndergroundNotification, TrendingUndergroundNotificationFromJSON, TrendingUndergroundNotificationFromJSONTyped, TrendingUndergroundNotificationToJSON, } from './TrendingUndergroundNotification'; import { UsdcPurchaseBuyerNotification, instanceOfUsdcPurchaseBuyerNotification, UsdcPurchaseBuyerNotificationFromJSON, UsdcPurchaseBuyerNotificationFromJSONTyped, UsdcPurchaseBuyerNotificationToJSON, } from './UsdcPurchaseBuyerNotification'; import { UsdcPurchaseSellerNotification, instanceOfUsdcPurchaseSellerNotification, UsdcPurchaseSellerNotificationFromJSON, UsdcPurchaseSellerNotificationFromJSONTyped, UsdcPurchaseSellerNotificationToJSON, } from './UsdcPurchaseSellerNotification'; /** * @type Notification * * @export */ export type Notification = { type: 'announcement' } & AnnouncementNotification | { type: 'approve_manager_request' } & ApproveManagerRequestNotification | { type: 'artist_remix_contest_ended' } & ArtistRemixContestEndedNotification | { type: 'artist_remix_contest_ending_soon' } & ArtistRemixContestEndingSoonNotification | { type: 'artist_remix_contest_submissions' } & ArtistRemixContestSubmissionsNotification | { type: 'challenge_reward' } & ChallengeRewardNotification | { type: 'claimable_reward' } & ClaimableRewardNotification | { type: 'comment' } & CommentNotification | { type: 'comment_mention' } & CommentMentionNotification | { type: 'comment_reaction' } & CommentReactionNotification | { type: 'comment_thread' } & CommentThreadNotification | { type: 'cosign' } & CosignNotification | { type: 'create' } & CreateNotification | { type: 'fan_remix_contest_ended' } & FanRemixContestEndedNotification | { type: 'fan_remix_contest_ending_soon' } & FanRemixContestEndingSoonNotification | { type: 'fan_remix_contest_started' } & FanRemixContestStartedNotification | { type: 'fan_remix_contest_winners_selected' } & FanRemixContestWinnersSelectedNotification | { type: 'follow' } & FollowNotification | { type: 'listen_streak_reminder' } & ListenStreakReminderNotification | { type: 'milestone' } & MilestoneNotification | { type: 'reaction' } & ReactionNotification | { type: 'remix' } & RemixNotification | { type: 'repost' } & RepostNotification | { type: 'repost_of_repost' } & RepostOfRepostNotification | { type: 'request_manager' } & RequestManagerNotification | { type: 'save' } & SaveNotification | { type: 'save_of_repost' } & SaveOfRepostNotification | { type: 'supporter_dethroned' } & SupporterDethronedNotification | { type: 'supporter_rank_up' } & SupporterRankUpNotification | { type: 'supporting_rank_up' } & SupporterRankUpNotification | { type: 'tastemaker' } & TastemakerNotification | { type: 'tier_change' } & TierChangeNotification | { type: 'tip_receive' } & ReceiveTipNotification | { type: 'tip_send' } & SendTipNotification | { type: 'track_added_to_playlist' } & TrackAddedToPlaylistNotification | { type: 'track_added_to_purchased_album' } & TrackAddedToPurchasedAlbumNotification | { type: 'trending' } & TrendingNotification | { type: 'trending_playlist' } & TrendingPlaylistNotification | { type: 'trending_underground' } & TrendingUndergroundNotification | { type: 'usdc_purchase_buyer' } & UsdcPurchaseBuyerNotification | { type: 'usdc_purchase_seller' } & UsdcPurchaseSellerNotification; export function NotificationFromJSON(json: any): Notification { return NotificationFromJSONTyped(json, false); } export function NotificationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Notification { if ((json === undefined) || (json === null)) { return json; } switch (json['type']) { case 'announcement': return {...AnnouncementNotificationFromJSONTyped(json, true), type: 'announcement'}; case 'approve_manager_request': return {...ApproveManagerRequestNotificationFromJSONTyped(json, true), type: 'approve_manager_request'}; case 'artist_remix_contest_ended': return {...ArtistRemixContestEndedNotificationFromJSONTyped(json, true), type: 'artist_remix_contest_ended'}; case 'artist_remix_contest_ending_soon': return {...ArtistRemixContestEndingSoonNotificationFromJSONTyped(json, true), type: 'artist_remix_contest_ending_soon'}; case 'artist_remix_contest_submissions': return {...ArtistRemixContestSubmissionsNotificationFromJSONTyped(json, true), type: 'artist_remix_contest_submissions'}; case 'challenge_reward': return {...ChallengeRewardNotificationFromJSONTyped(json, true), type: 'challenge_reward'}; case 'claimable_reward': return {...ClaimableRewardNotificationFromJSONTyped(json, true), type: 'claimable_reward'}; case 'comment': return {...CommentNotificationFromJSONTyped(json, true), type: 'comment'}; case 'comment_mention': return {...CommentMentionNotificationFromJSONTyped(json, true), type: 'comment_mention'}; case 'comment_reaction': return {...CommentReactionNotificationFromJSONTyped(json, true), type: 'comment_reaction'}; case 'comment_thread': return {...CommentThreadNotificationFromJSONTyped(json, true), type: 'comment_thread'}; case 'cosign': return {...CosignNotificationFromJSONTyped(json, true), type: 'cosign'}; case 'create': return {...CreateNotificationFromJSONTyped(json, true), type: 'create'}; case 'fan_remix_contest_ended': return {...FanRemixContestEndedNotificationFromJSONTyped(json, true), type: 'fan_remix_contest_ended'}; case 'fan_remix_contest_ending_soon': return {...FanRemixContestEndingSoonNotificationFromJSONTyped(json, true), type: 'fan_remix_contest_ending_soon'}; case 'fan_remix_contest_started': return {...FanRemixContestStartedNotificationFromJSONTyped(json, true), type: 'fan_remix_contest_started'}; case 'fan_remix_contest_winners_selected': return {...FanRemixContestWinnersSelectedNotificationFromJSONTyped(json, true), type: 'fan_remix_contest_winners_selected'}; case 'follow': return {...FollowNotificationFromJSONTyped(json, true), type: 'follow'}; case 'listen_streak_reminder': return {...ListenStreakReminderNotificationFromJSONTyped(json, true), type: 'listen_streak_reminder'}; case 'milestone': return {...MilestoneNotificationFromJSONTyped(json, true), type: 'milestone'}; case 'reaction': return {...ReactionNotificationFromJSONTyped(json, true), type: 'reaction'}; case 'remix': return {...RemixNotificationFromJSONTyped(json, true), type: 'remix'}; case 'repost': return {...RepostNotificationFromJSONTyped(json, true), type: 'repost'}; case 'repost_of_repost': return {...RepostOfRepostNotificationFromJSONTyped(json, true), type: 'repost_of_repost'}; case 'request_manager': return {...RequestManagerNotificationFromJSONTyped(json, true), type: 'request_manager'}; case 'save': return {...SaveNotificationFromJSONTyped(json, true), type: 'save'}; case 'save_of_repost': return {...SaveOfRepostNotificationFromJSONTyped(json, true), type: 'save_of_repost'}; case 'supporter_dethroned': return {...SupporterDethronedNotificationFromJSONTyped(json, true), type: 'supporter_dethroned'}; case 'supporter_rank_up': return {...SupporterRankUpNotificationFromJSONTyped(json, true), type: 'supporter_rank_up'}; case 'supporting_rank_up': return {...SupporterRankUpNotificationFromJSONTyped(json, true), type: 'supporting_rank_up'}; case 'tastemaker': return {...TastemakerNotificationFromJSONTyped(json, true), type: 'tastemaker'}; case 'tier_change': return {...TierChangeNotificationFromJSONTyped(json, true), type: 'tier_change'}; case 'tip_receive': return {...ReceiveTipNotificationFromJSONTyped(json, true), type: 'tip_receive'}; case 'tip_send': return {...SendTipNotificationFromJSONTyped(json, true), type: 'tip_send'}; case 'track_added_to_playlist': return {...TrackAddedToPlaylistNotificationFromJSONTyped(json, true), type: 'track_added_to_playlist'}; case 'track_added_to_purchased_album': return {...TrackAddedToPurchasedAlbumNotificationFromJSONTyped(json, true), type: 'track_added_to_purchased_album'}; case 'trending': return {...TrendingNotificationFromJSONTyped(json, true), type: 'trending'}; case 'trending_playlist': return {...TrendingPlaylistNotificationFromJSONTyped(json, true), type: 'trending_playlist'}; case 'trending_underground': return {...TrendingUndergroundNotificationFromJSONTyped(json, true), type: 'trending_underground'}; case 'usdc_purchase_buyer': return {...UsdcPurchaseBuyerNotificationFromJSONTyped(json, true), type: 'usdc_purchase_buyer'}; case 'usdc_purchase_seller': return {...UsdcPurchaseSellerNotificationFromJSONTyped(json, true), type: 'usdc_purchase_seller'}; default: throw new Error(`No variant of Notification exists with 'type=${json['type']}'`); } } export function NotificationToJSON(value?: Notification | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } switch (value['type']) { case 'announcement': return AnnouncementNotificationToJSON(value); case 'approve_manager_request': return ApproveManagerRequestNotificationToJSON(value); case 'artist_remix_contest_ended': return ArtistRemixContestEndedNotificationToJSON(value); case 'artist_remix_contest_ending_soon': return ArtistRemixContestEndingSoonNotificationToJSON(value); case 'artist_remix_contest_submissions': return ArtistRemixContestSubmissionsNotificationToJSON(value); case 'challenge_reward': return ChallengeRewardNotificationToJSON(value); case 'claimable_reward': return ClaimableRewardNotificationToJSON(value); case 'comment': return CommentNotificationToJSON(value); case 'comment_mention': return CommentMentionNotificationToJSON(value); case 'comment_reaction': return CommentReactionNotificationToJSON(value); case 'comment_thread': return CommentThreadNotificationToJSON(value); case 'cosign': return CosignNotificationToJSON(value); case 'create': return CreateNotificationToJSON(value); case 'fan_remix_contest_ended': return FanRemixContestEndedNotificationToJSON(value); case 'fan_remix_contest_ending_soon': return FanRemixContestEndingSoonNotificationToJSON(value); case 'fan_remix_contest_started': return FanRemixContestStartedNotificationToJSON(value); case 'fan_remix_contest_winners_selected': return FanRemixContestWinnersSelectedNotificationToJSON(value); case 'follow': return FollowNotificationToJSON(value); case 'listen_streak_reminder': return ListenStreakReminderNotificationToJSON(value); case 'milestone': return MilestoneNotificationToJSON(value); case 'reaction': return ReactionNotificationToJSON(value); case 'remix': return RemixNotificationToJSON(value); case 'repost': return RepostNotificationToJSON(value); case 'repost_of_repost': return RepostOfRepostNotificationToJSON(value); case 'request_manager': return RequestManagerNotificationToJSON(value); case 'save': return SaveNotificationToJSON(value); case 'save_of_repost': return SaveOfRepostNotificationToJSON(value); case 'supporter_dethroned': return SupporterDethronedNotificationToJSON(value); case 'supporter_rank_up': return SupporterRankUpNotificationToJSON(value); case 'supporting_rank_up': return SupporterRankUpNotificationToJSON(value); case 'tastemaker': return TastemakerNotificationToJSON(value); case 'tier_change': return TierChangeNotificationToJSON(value); case 'tip_receive': return ReceiveTipNotificationToJSON(value); case 'tip_send': return SendTipNotificationToJSON(value); case 'track_added_to_playlist': return TrackAddedToPlaylistNotificationToJSON(value); case 'track_added_to_purchased_album': return TrackAddedToPurchasedAlbumNotificationToJSON(value); case 'trending': return TrendingNotificationToJSON(value); case 'trending_playlist': return TrendingPlaylistNotificationToJSON(value); case 'trending_underground': return TrendingUndergroundNotificationToJSON(value); case 'usdc_purchase_buyer': return UsdcPurchaseBuyerNotificationToJSON(value); case 'usdc_purchase_seller': return UsdcPurchaseSellerNotificationToJSON(value); default: throw new Error(`No variant of Notification exists with 'type=${value['type']}'`); } }