Skip to main content

Update Connection

The updateConnection() function is used to update a connection with a specified action.

Steps to Update a Connection

  1. Build an UpdateConnectionRequest object using the UpdateConnectionRequestBuilder class.

  2. Call the updateConnection() function using an instance of the appropriate class or repository.

  3. 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:

VariableTypeDescriptionOptional
receiverUUIDStringThe UUID of the user to whom the connection update is applied.
actionConnectionActionThe action to perform on the connection (e.g., accept, reject).
connectionTypeConnectionTypeThe type of connection being updated (e.g., oneWay, twoWay).