import { PlatformLocation } from "@angular/common"; import { Injectable } from "@angular/core"; import { HttpClient } from "@angular/common/http"; import { Observable } from "rxjs"; import { ServiceHelpers } from "../service.helpers"; import { ICouchPotatoSettings, IDiscordNotifcationSettings, IEmailNotificationSettings, IEmbyServer, IGotifyNotificationSettings, ILidarrSettings, IMattermostNotifcationSettings, IMobileNotificationTestSettings, INewsletterNotificationSettings, IPlexServer, IPushbulletNotificationSettings, IPushoverNotificationSettings, IRadarrSettings, ISickRageSettings, ISlackNotificationSettings, ISonarrSettings, ITelegramNotifcationSettings, } from "../../interfaces"; @Injectable() export class TesterService extends ServiceHelpers { constructor(http: HttpClient, public platformLocation: PlatformLocation) { super(http, "/api/v1/tester/", platformLocation); } public discordTest(settings: IDiscordNotifcationSettings): Observable { return this.http.post(`${this.url}discord`, JSON.stringify(settings), {headers: this.headers}); } public pushbulletTest(settings: IPushbulletNotificationSettings): Observable { return this.http.post(`${this.url}pushbullet`, JSON.stringify(settings), {headers: this.headers}); } public pushoverTest(settings: IPushoverNotificationSettings): Observable { return this.http.post(`${this.url}pushover`, JSON.stringify(settings), { headers: this.headers }); } public gotifyTest(settings: IGotifyNotificationSettings): Observable { return this.http.post(`${this.url}gotify`, JSON.stringify(settings), { headers: this.headers }); } public mattermostTest(settings: IMattermostNotifcationSettings): Observable { return this.http.post(`${this.url}mattermost`, JSON.stringify(settings), {headers: this.headers}); } public slackTest(settings: ISlackNotificationSettings): Observable { return this.http.post(`${this.url}slack`, JSON.stringify(settings), {headers: this.headers}); } public emailTest(settings: IEmailNotificationSettings): Observable { return this.http.post(`${this.url}email`, JSON.stringify(settings), {headers: this.headers}); } public plexTest(settings: IPlexServer): Observable { return this.http.post(`${this.url}plex`, JSON.stringify(settings), {headers: this.headers}); } public embyTest(settings: IEmbyServer): Observable { return this.http.post(`${this.url}emby`, JSON.stringify(settings), {headers: this.headers}); } public radarrTest(settings: IRadarrSettings): Observable { return this.http.post(`${this.url}radarr`, JSON.stringify(settings), {headers: this.headers}); } public lidarrTest(settings: ILidarrSettings): Observable { return this.http.post(`${this.url}lidarr`, JSON.stringify(settings), {headers: this.headers}); } public sonarrTest(settings: ISonarrSettings): Observable { return this.http.post(`${this.url}sonarr`, JSON.stringify(settings), {headers: this.headers}); } public couchPotatoTest(settings: ICouchPotatoSettings): Observable { return this.http.post(`${this.url}couchpotato`, JSON.stringify(settings), {headers: this.headers}); } public telegramTest(settings: ITelegramNotifcationSettings): Observable { return this.http.post(`${this.url}telegram`, JSON.stringify(settings), {headers: this.headers}); } public sickrageTest(settings: ISickRageSettings): Observable { return this.http.post(`${this.url}sickrage`, JSON.stringify(settings), {headers: this.headers}); } public newsletterTest(settings: INewsletterNotificationSettings): Observable { return this.http.post(`${this.url}newsletter`, JSON.stringify(settings), {headers: this.headers}); } public mobileNotificationTest(settings: IMobileNotificationTestSettings): Observable { return this.http.post(`${this.url}mobile`, JSON.stringify(settings), {headers: this.headers}); } }