src/voice-mail/VoiceMailManager.ts
import {Observable} from 'rxjs';
import {WacProxy} from '../wac-proxy/WacProxy';
import {VoiceMailDTO, VoiceMailService} from '../wac-proxy/wac-stack/VoiceMailService';
export class VoiceMailManager {
/** @ignore */
private voiceMailService: VoiceMailService;
/**
* Emits an object with the counts of new and all messages
*/
messages$: Observable<VoiceMailDTO>;
constructor(wacStack: WacProxy) {
this.voiceMailService = wacStack.getVoiceMailService();
this.messages$ = this.voiceMailService.messages$;
}
/**
* Starts the subscription to the update of message values
* @returns {Promise}
*/
public async subscribe(): Promise<void> {
return this.voiceMailService.subscribe();
}
/**
* Stops the subscription to the update of message values
* @returns {Promise}
*/
public async unsubscribe(): Promise<void> {
return this.voiceMailService.unsubscribe();
}
}