Resize 3d viewport

Is there a method to reposition and resize the viewport to fit around the extents of an imported model?

I have an importer and it imports a model but it is larger than the viewport so I have to zoom out. Can that be done in the api?