@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
47 lines (40 loc) • 1.23 kB
text/typescript
/**
* Copyright © 2024 Nevis Security AG. All rights reserved.
*/
import { PasswordChangeContext } from '../../../operations/password/PasswordChangeContext';
import { ChannelMessage } from '../ChannelMessage';
/**
* Holds the parameters of the change password call.
*/
export class PasswordChangerMessage extends ChannelMessage {
/**
* The identifier of the operation.
*/
operationId: string;
/**
* The returned password change context.
*/
context: PasswordChangeContext;
/**
* Default constructor for {@link PasswordChangerMessage}.
*
* @param operationId the identifier of the operation.
* @param context the returned password change context.
* @private
*/
private constructor(operationId: string, context: PasswordChangeContext) {
super();
this.operationId = operationId;
this.context = context;
}
/**
* Alternate constructor that creates an {@link PasswordChangerMessage} from a json.
*
* @param json contains the source for instance creation.
*/
static fromJson(json: any): PasswordChangerMessage {
const operationId = json.operationId;
const context = PasswordChangeContext.fromJson(json.context);
return new PasswordChangerMessage(operationId, context);
}
}