PasswordChange

public protocol PasswordChange : Operation

The object that can be used to change the password.

Usage example:

class PasswordChangerImpl: PasswordChanger {
    func changePassword(context: PasswordChangeContext, handler: PasswordChangeHandler) {
        handler.passwords(oldPassword, newPassword)
    }
}

client.operations.passwordChange
    .username(username)
    .passwordChanger(PasswordChangerImpl(...))
    .onSuccess { in
        ...
    }
    .onError { error in
        ...
    }
    .execute()
  • The username whose password must be changed.

    Important

    Providing the username is required.

    Declaration

    Swift

    @discardableResult
    func username(_ username: String) -> PasswordChange

    Parameters

    username

    the username.

    Return Value

    the PasswordChange builder.

  • Specifies the object that will be informed of the potential recoverable errors and is responsible for obtaining the password from the end-user.

    Important

    Providing the password changer is required.

    Declaration

    Swift

    @discardableResult
    func passwordChanger(_ passwordChanger: PasswordChanger) -> PasswordChange

    Parameters

    passwordChanger

    Return Value

    the PasswordChange builder.

  • Specifies the block to execute if the password was successfully modified. This object will be invoked in the DispatchQueue.main thread.

    Important

    Providing the onSuccess block is required.

    Declaration

    Swift

    @discardableResult
    func onSuccess(_ onSuccess: @escaping () -> ()) -> PasswordChange

    Parameters

    onSuccess

    the block to execute on successful password modification.

    Return Value

    the PasswordChange builder.

  • Specifies the block to execute when the password could not be changed: - the password was not enrolled, - the password is locked - or the operation was canceled. This object will be invoked in the DispatchQueue.main thread.

    Important

    Providing the onError block is required.

    Declaration

    Swift

    @discardableResult
    func onError(_ onError: @escaping (PasswordChangeError) -> ()) -> PasswordChange

    Parameters

    onError

    the block to execute on failed PIN modification, receives a PasswordChangeError.

    Return Value

    the PasswordChange builder.