#import <ZSM/ZSMClient.h>

@class RelyingParty;

NS_ASSUME_NONNULL_BEGIN

@interface UMFAClient : ZSMClient

#pragma mark - Registration and initialization

- (instancetype)init NS_UNAVAILABLE;

- (instancetype)initWithConfig:(ZSMConfig *)config relyingParty:(RelyingParty *)relyingParty;
NS_SWIFT_NAME(init(_:relyingParty:));

/**
 * Checks if a user is enrolled with WebAuthn.
 * @param userId The identifier of the user.
 * @param completion Callback returning enrollment details if the user is enrolled, otherwise an error.
 */
- (void)checkEnrollment:(NSString *)userId
             completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(checkEnrollment(userId:completion:));

/**
 * Initiates the enrollment process for a user.
 * @param userId The identifier of the user.
 * @param completion Callback returning a token if enrollment is successful, otherwise an error.
 */
- (void)enroll:(NSString *)userId
    completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(enroll(userId:completion:));

/**
 * Authenticates a user via WebAuthn.
 * @param userId The identifier of the user.
 * @param completion Callback returning authentication details or an error if authentication fails.
 */
- (void)authenticate:(NSString *)userId
          completion:(ZSMJSONCompletion)completion
NS_SWIFT_NAME(authenticate(userId:completion:));

/**
 * Unenrolls the UMFA client current user, clearing stored credentials and identity mappings.
 * @param userId The identifier of the user.
 * @param completion Callback invoked when the reset is complete.
 */
- (void)unenroll:(NSString *)userId completion:(ZSMBooleanCompletion)completion
NS_SWIFT_NAME(unenroll(userId:completion:));

/// This method is intentionally unavailable in UMFAClient.
/// Do not call this from Swift. Use proper lifecycle methods.
- (void)unbindWithCompletion:(nonnull ZSMBooleanCompletion)completion NS_UNAVAILABLE;
- (void)unbindForUser:(nonnull NSString *)user withCompletion:(nonnull ZSMBooleanCompletion)completion NS_UNAVAILABLE;

@end

NS_ASSUME_NONNULL_END
