The unlock size button in Sketh App

I can click this button to unlock the size of a layer in Sketch App.
And then I can change the width/height ratio of the image.
But I want my Sketch plugin to do this job instead of using my hand to click the button.
Is there an API for Sketch to unlock the size of MSBitmapLayer?
I've tried "[layer setIsLocked:false]", but it's not about the size lock.
Thank you very much.