@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
56 lines (54 loc) • 1.68 kB
JavaScript
import { RpcObservableClient } from '../rpc-observable-client';
import { RpcObservableAliveKey } from './rpc-observable-alive-model';
export class RpcObservableAliveClient extends RpcObservableClient {
/**
* Initializes a new instance of the RpcObservableAliveClient class.
*
* @param rpc the rpc object.
*/
constructor(rpc) {
super(rpc, RpcObservableAliveKey.command, RpcObservableAliveKey.version);
}
/**
* The alive command.
*
* @param request the Rpc alive data object.
* @param outbound the Rpc outbound channel object.
* @return Observable<RpcObservableAliveResult> the observable object.
*/
alive(request, outbound) {
if (!request) {
request = {
timestamp: Date.now()
};
}
return this.observableCall(request, outbound);
}
/**
* The alive forever command.
*
* @param outbound the Rpc outbound channel object.
* @return Observable<RpcObservableAliveResult> the observable object.
*/
forever(outbound) {
const request = {
timestamp: Date.now(),
forever: true
};
return this.observableCall(request, outbound);
}
/**
* The reset forever state command.
*
* @param outbound the Rpc outbound channel object.
* @return Observable<RpcObservableAliveResult> the observable object.
*/
reset(outbound) {
const request = {
timestamp: Date.now(),
forever: false
};
return this.observableCall(request, outbound);
}
}
//# sourceMappingURL=rpc-observable-alive-client.js.map