Update Connection
The updateConnection()
function is used to update a connection with a specified action.
Steps to Update a Connection
Build an
UpdateConnectionRequest
object using theUpdateConnectionRequestBuilder
class.Call the
updateConnection()
function using an instance of the appropriate class or repository.Use the response (
LMResponse<void>
) as needed.// Create an UpdateConnectionRequest object using the builder
final UpdateConnectionRequest updateConnectionRequest = UpdateConnectionRequestBuilder()
..receiverUUID('receiver_user_id')
..action(ConnectionAction.accept) // Example action
..connectionType(ConnectionType.oneWay) // Example connection type
.build();
// Update the connection
final LMResponse<void> updateConnectionResponse = await updateConnection(updateConnectionRequest);
// Process the response, as needed
if (response.success) {
// Handle successful connection update
handleUpdateConnectionSuccess(updateConnectionResponse);
} else {
// Handle error message
handleUpdateConnectionError(updateConnectionResponse.errorMessage);
}
Models
UpdateConnectionRequest
The UpdateConnectionRequest
class represents a request to update a connection.
List of parameters for the UpdateConnectionRequest
class:
Variable | Type | Description | Optional |
---|---|---|---|
receiverUUID | String | The UUID of the user to whom the connection update is applied. | |
action | ConnectionAction | The action to perform on the connection (e.g., accept, reject). | |
connectionType | ConnectionType | The type of connection being updated (e.g., oneWay, twoWay). |