PinChange
public protocol PinChange : Operation
The object that can be used to change the PIN.
Usage example:
class PinChangerImpl: PinChanger {
func changePin(context: PinChangeContext, handler: PinChangeHandler) {
handler.pins(oldPin, newPin)
}
}
client.operations.pinChange
.username(username)
.pinChanger(PinChangerImpl(...))
.onSuccess { in
...
}
.onError { error in
...
}
.execute()
-
The username whose PIN must be changed.
Important
Providing the username is required.Declaration
Swift
@discardableResult func username(_ username: String) -> PinChange
Parameters
username
the username.
Return Value
the
PinChange
builder. -
Specifies the object that will be informed of the potential recoverable errors and is responsible for obtaining the PIN from the end-user.
Important
Providing the PIN changer is required.Declaration
Swift
@discardableResult func pinChanger(_ pinChanger: PinChanger) -> PinChange
Parameters
pinChanger
the
PinChanger
Return Value
the
PinChange
builder. -
Specifies the block to execute if the PIN was successfully modified. This object will be invoked in the
DispatchQueue.main
thread.Important
Providing theonSuccess
block is required.Declaration
Swift
@discardableResult func onSuccess(_ onSuccess: @escaping () -> ()) -> PinChange
Parameters
onSuccess
the block to execute on successful PIN modification.
Return Value
the
PinChange
builder. -
Specifies the block to execute when the PIN could not be changed: - the PIN was not enrolled, - the PIN is locked - or the operation was canceled. This object will be invoked in the
DispatchQueue.main
thread.Important
Providing theonError
block is required.Declaration
Swift
@discardableResult func onError(_ onError: @escaping (PinChangeError) -> ()) -> PinChange
Parameters
onError
the block to execute on failed PIN modification, receives a
PinChangeError
.Return Value
the
PinChange
builder.