def METHOD_NAME(self, workspace_connection, **kwargs) -> WorkspaceConnection:
    """Create or update a workspace connection.
    :param workspace_connection: Workspace Connection definition
        or object which can be translated to a workspace connection.
    :type workspace_connection: WorkspaceConnection
    :return: Created or update workspace connection.
    :rtype: WorkspaceConnection
    """
    rest_workspace_connection = workspace_connection._to_rest_object()
    response = self._operation.create(
        workspace_name=self._workspace_name,
        connection_name=workspace_connection.name,
        body=rest_workspace_connection,
        **self._scope_kwargs,
        **kwargs,
    )
    return WorkspaceConnection._from_rest_object(rest_obj=response)